---
updatedAt: 2026-09-03T10:39:47.000Z
agentTools:
  projectIndex: https://docs.dacast.com/llms.txt
---

# Add ads to content

Append VAST url or Dacast vod-id ads to the existing schedule on a VOD or live channel.

**Add** the ads in the request to the current schedule. Slots already on the content are kept.

Use the same item shape as [Create ads on content](https://docs.dacast.com/reference/create-ad-on-content): `ad-type`, either VAST `url` or `vod-id`, and `timestamp` (integer seconds, mid-roll only).

Success returns **200** with a JSON **array** of every ad on the content after the add.

To replace the whole schedule, use `POST` on [Create ads on content](https://docs.dacast.com/reference/create-ad-on-content) instead.

Step-by-step walkthrough: [Ads on content](https://docs.dacast.com/docs/ads-on-content).

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://developer.dacast.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Api-Key",
        "in": "header",
        "x-default": "api_key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v2/{resource_type}/{id}/ads": {
      "put": {
        "summary": "Add ads to content",
        "description": "Append VAST url or Dacast vod-id ads to the existing schedule on a VOD or live channel.",
        "operationId": "add-ads-to-content",
        "parameters": [
          {
            "name": "resource_type",
            "in": "path",
            "description": "Content type: `vod` or `channel`.",
            "schema": {
              "type": "string",
              "enum": [
                "channel",
                "vod"
              ],
              "default": "vod"
            },
            "required": true
          },
          {
            "name": "id",
            "in": "path",
            "description": "Content id (UUID string).",
            "schema": {
              "type": "string",
              "example": "8a4b0047-44a9-fa36-67a7-b8ec3d875ade"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ads"
                ],
                "properties": {
                  "ads": {
                    "type": "array",
                    "description": "Ads to append. Existing ads on the content are kept. Each item uses `url` (VAST) or `vod-id` (Dacast VOD creative).",
                    "items": {
                      "type": "object",
                      "properties": {
                        "ad-type": {
                          "type": "string",
                          "description": "When the ad plays: `pre-roll`, `mid-roll`, or `post-roll`.",
                          "enum": [
                            "pre-roll",
                            "mid-roll",
                            "post-roll"
                          ],
                          "example": "pre-roll"
                        },
                        "url": {
                          "type": "string",
                          "description": "VAST tag URL (HTTPS). Use this **or** `vod-id`, not both. For `vod-id` slots the API fills `url` on list with a generated `ads.dacast.com` tag.",
                          "example": "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator="
                        },
                        "vod-id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "UUID of a VOD on your account used as the ad creative. Use this **or** `url`, not both.",
                          "example": "YOUR_CREATIVE_VOD_ID"
                        },
                        "timestamp": {
                          "type": "integer",
                          "description": "Required for `mid-roll`. Offset in seconds from the start of the content when the ad should play.",
                          "example": 120
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "ads": [
                  {
                    "ad-type": "post-roll",
                    "url": "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator="
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "ad-type": {
                        "type": "string",
                        "example": "pre-roll"
                      },
                      "url": {
                        "type": "string",
                        "example": "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator="
                      },
                      "vod-id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Present when the slot uses a Dacast VOD creative."
                      },
                      "timestamp": {
                        "type": "integer",
                        "example": 120
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": [
                      {
                        "ad-type": "pre-roll",
                        "url": "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator="
                      },
                      {
                        "ad-type": "post-roll",
                        "url": "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator="
                      }
                    ]
                  },
                  "After append (vod-id)": {
                    "value": [
                      {
                        "ad-type": "pre-roll",
                        "url": "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator="
                      },
                      {
                        "ad-type": "post-roll",
                        "url": "https://ads.dacast.com/YOUR_PLATFORM_ID/YOUR_CUSTOM_AD_TAG_ID",
                        "vod-id": "YOUR_CREATIVE_VOD_ID"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "detail": {
                      "type": "string",
                      "example": "Unauthorized"
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "message": "Unauthorized",
                      "detail": "Unauthorized"
                    }
                  }
                }
              }
            }
          }
        },
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "name": "cURL (VAST url)",
              "code": "curl -X PUT \"https://developer.dacast.com/v2/vod/YOUR_CONTENT_ID/ads\" \\\n  -H \"X-Api-Key: insertYourApiKeyHere\" \\\n  -H \"X-Format: default\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"ads\\\":[{\\\"ad-type\\\":\\\"post-roll\\\",\\\"url\\\":\\\"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator=\\\"}]}\""
            },
            {
              "language": "curl",
              "name": "cURL (vod-id)",
              "code": "curl -X PUT \"https://developer.dacast.com/v2/vod/YOUR_CONTENT_ID/ads\" \\\n  -H \"X-Api-Key: insertYourApiKeyHere\" \\\n  -H \"X-Format: default\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"ads\\\":[{\\\"ad-type\\\":\\\"post-roll\\\",\\\"vod-id\\\":\\\"YOUR_CREATIVE_VOD_ID\\\"}]}\""
            }
          ],
          "samples-languages": [
            "curl"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Format",
        "value": "default"
      }
    ],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```