POST
/
projects
/
{project_id}
/
ads
curl --request POST \
  --url https://api.beyondwords.io/v1/projects/{project_id}/ads \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "type": "custom",
  "enabled": true,
  "placement": "pre-roll",
  "vast_url": null,
  "title": "My Ad",
  "click_through_url": "https://example.com",
  "image_url": "https://example.com/image.png",
  "media_url": "https://example.com/advert.mp3",
  "theme": "dark",
  "dark_theme": {
    "text_color": "#fff",
    "background_color": "#333",
    "icon_color": "#ff0"
  },
  "light_theme": null,
  "time_range": {
    "start": "2023-12-01 00:00:00 UTC",
    "end": "2023-12-31 23:59:59 UTC"
  }
}'
{
  "id": 1,
  "type": "custom",
  "enabled": true,
  "placement": "pre-roll",
  "vast_url": null,
  "title": "My advert title",
  "click_through_url": "https://example.com",
  "image_url": "https://example.com/image.png",
  "media_url": "https://example.com/advert.mp3",
  "media": [
    {
      "id": 123,
      "content_type": "audio/mpeg",
      "url": "https://example.com/transcoded.mp3",
      "duration": 15000
    },
    {
      "id": 124,
      "content_type": "application/vnd.apple.mpegurl",
      "url": "https://example.com/transcoded.m3u8",
      "duration": 15000
    }
  ],
  "theme": "dark",
  "dark_theme": {
    "text_color": "#fff",
    "background_color": "#333",
    "icon_color": "#ff0"
  },
  "light_theme": null,
  "video_theme": null,
  "time_range": {
    "start": "2023-12-01 00:00:00 UTC",
    "end": "2023-12-31 23:59:59 UTC"
  },
  "created": "2023-01-01 00:00:00 UTC",
  "updated": "2023-01-01 00:00:05 UTC"
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

project_id
string
required

The numeric ID of your project

Body

application/json

Create ad with custom type

Response

201 - application/json
successful

The response is of type object.