> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zype.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Block

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Playout Scheduler",
    "description": "",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.zype.com/"
    }
  ],
  "security": [
    {
      "api_key": []
    }
  ],
  "paths": {
    "/scheduler/v2/assets/blocks": {
      "post": {
        "summary": "Create Block",
        "description": "",
        "operationId": "createPlayoutSchedulerBlockV2",
        "tags": [
          "Assets"
        ],
        "x-codegen-request-body-name": "block",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "BlockRequest",
                "type": "object",
                "required": [
                  "block"
                ],
                "properties": {
                  "block": {
                    "type": "object",
                    "title": "BlockProperties",
                    "properties": {
                      "title": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "draft": {
                        "type": "boolean",
                        "description": "If true, duration must be present and items list will be empty"
                      },
                      "dynamic": {
                        "type": "boolean",
                        "description": "If true, duration must be present and items list will be filled when pushed into the timeline based on the given criteria"
                      },
                      "originalConfig": {
                        "description": "Applies only to Dynamic Blocks",
                        "type": "object",
                        "properties": {
                          "orderBy": {
                            "type": "string",
                            "enum": [
                              "createdAt",
                              "publishedAt",
                              "season",
                              "title"
                            ],
                            "description": "Specifies the field used to sort assets when populating the item list."
                          },
                          "reuseAssets": {
                            "type": "boolean",
                            "description": "If true, and no 'reuseContentConfig' is specified, assets will be reused with the same filling rules but in the inverted sort order."
                          },
                          "sortOrder": {
                            "type": "string",
                            "enum": [
                              "ASC",
                              "DESC"
                            ],
                            "description": "Defines the order of sorting: ascending (ASC) or descending (DESC)."
                          },
                          "startFrom": {
                            "type": "string",
                            "description": "Specifies the starting point for the asset list. Can be a date, season number, or in hours if relativeStartFrom is enabled."
                          },
                          "relativeStartFrom": {
                            "type": "boolean",
                            "description": "If true, the starting point is relative to the current time."
                          },
                          "fitToContent": {
                            "type": "boolean",
                            "description": "If true, adjusts the block's duration to fit the content."
                          }
                        }
                      },
                      "contentFillingRules": {
                        "type": "array",
                        "description": "A list of rules with different criteria used to fill dynamic block items",
                        "items": {
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "category",
                                "episode",
                                "season",
                                "series"
                              ]
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "adRule": {
                        "type": "object",
                        "description": "Required only for dynamic blocks",
                        "properties": {
                          "assetId": {
                            "type": "string",
                            "description": "The id if the ad inserted"
                          },
                          "preRolls": {
                            "type": "boolean",
                            "description": "If enabled, the selected asset will be inserted before every video in the block"
                          },
                          "midRolls": {
                            "type": "boolean",
                            "description": "If enabled, the selected asset will be inserted as a mid-roll ad, honouring videos' ad timings"
                          },
                          "postRolls": {
                            "type": "boolean",
                            "description": "If enabled, the selected asset will be inserted after every video in the block"
                          }
                        }
                      },
                      "reuseContentConfig": {
                        "type": "object",
                        "description": "Optional. Applies only to Dynamic Blocks with reuseAssets as 'true'.",
                        "properties": {
                          "orderBy": {
                            "type": "string",
                            "enum": [
                              "createdAt",
                              "publishedAt",
                              "season",
                              "title"
                            ],
                            "description": "Specifies the field used to sort assets when populating the item list."
                          },
                          "sortOrder": {
                            "type": "string",
                            "enum": [
                              "ASC",
                              "DESC"
                            ],
                            "description": "Defines the order of sorting: ascending (ASC) or descending (DESC)."
                          },
                          "startFrom": {
                            "type": "string",
                            "description": "Specifies the starting point for the asset list. Can be a date, season number, or in hours if relativeStartFrom is enabled."
                          },
                          "relativeStartFrom": {
                            "type": "boolean",
                            "description": "If true, the starting point is relative to the current time."
                          }
                        }
                      },
                      "reuseFillingRules": {
                        "type": "array",
                        "description": "A list of rules with different criteria used to fill a dynamic block re use items",
                        "items": {
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "category",
                                "episode",
                                "season",
                                "series"
                              ]
                            },
                            "value": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "properties": {
                            "assetType": {
                              "type": "string"
                            },
                            "assetId": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Block",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "duration": {
                      "type": "number"
                    },
                    "draft": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "object",
                      "properties": {
                        "assetType": {
                          "type": "string"
                        },
                        "assetId": {
                          "type": "string"
                        }
                      }
                    },
                    "adRule": {
                      "type": "object",
                      "properties": {
                        "assetId": {
                          "type": "string",
                          "description": "The id if the ad inserted"
                        },
                        "preRolls": {
                          "type": "boolean",
                          "description": "If enabled, the selected asset will be inserted before every video in the block"
                        },
                        "midRolls": {
                          "type": "boolean",
                          "description": "If enabled, the selected asset will be inserted as a mid-roll ad, honouring videos' ad timings"
                        },
                        "postRolls": {
                          "type": "boolean",
                          "description": "If enabled, the selected asset will be inserted after every video in the block"
                        }
                      }
                    },
                    "originalConfig": {
                      "description": "Applies only to Dynamic Blocks",
                      "type": "object",
                      "properties": {
                        "orderBy": {
                          "type": "string",
                          "enum": [
                            "createdAt",
                            "publishedAt",
                            "season",
                            "title"
                          ],
                          "description": "Specifies the field used to sort assets when populating the item list."
                        },
                        "reuseAssets": {
                          "type": "boolean",
                          "description": "If true, assets will be reused with the same filling rules but in the inverted sort order."
                        },
                        "sortOrder": {
                          "type": "string",
                          "enum": [
                            "ASC",
                            "DESC"
                          ],
                          "description": "Defines the order of sorting: ascending (ASC) or descending (DESC)."
                        },
                        "startFrom": {
                          "type": "string",
                          "description": "Specifies the starting point for the asset list. Can be a date, season number, or in hours if relativeStartFrom is enabled."
                        },
                        "relativeStartFrom": {
                          "type": "boolean",
                          "description": "If true, the starting point is relative to the current time."
                        },
                        "fitToContent": {
                          "type": "boolean",
                          "description": "If true, adjusts the block's duration to fit the content."
                        }
                      }
                    },
                    "contentFillingRules": {
                      "type": "array",
                      "description": "A list of rules with different criteria used to fill dynamic block items",
                      "items": {
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "reuseContentConfig": {
                      "type": "object",
                      "description": "Optional. Applies only to Dynamic Blocks with reuseAssets as 'true'.",
                      "properties": {
                        "orderBy": {
                          "type": "string",
                          "enum": [
                            "createdAt",
                            "publishedAt",
                            "season",
                            "title"
                          ],
                          "description": "Specifies the field used to sort assets when populating the item list."
                        },
                        "sortOrder": {
                          "type": "string",
                          "enum": [
                            "ASC",
                            "DESC"
                          ],
                          "description": "Defines the order of sorting: ascending (ASC) or descending (DESC)."
                        },
                        "startFrom": {
                          "type": "string",
                          "description": "Specifies the starting point for the asset list. Can be a date, season number, or in hours if relativeStartFrom is enabled."
                        },
                        "relativeStartFrom": {
                          "type": "boolean",
                          "description": "If true, the starting point is relative to the current time."
                        }
                      }
                    },
                    "reuseFillingRules": {
                      "type": "array",
                      "description": "A list of rules with different criteria used to fill a dynamic block re use items",
                      "items": {
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "category",
                              "episode",
                              "season",
                              "series"
                            ]
                          },
                          "value": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1scheduler~1v1~1types/get/responses/422/content/application~1json/schema"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "X-API-Key",
        "in": "header"
      }
    }
  }
}
```