---
updatedAt: 2026-08-24T15:26:20.000Z
agentTools:
  projectIndex: https://docs.dacast.com/llms.txt
---

# Playlists

Create, look up, replace content, update, and delete playlists via /v2/playlists.

## Organizing VOD and livestreams into playlists

Playlists group VOD and live channels so viewers can watch a series in one player. This guide covers create, lookup, replace content, update metadata, and delete.

> 📘 All examples use `https://developer.dacast.com` as the API host. Authenticate with `X-Api-Key` and send `X-Format: default`. JSON bodies must include `Content-Type: application/json`. Create, lookup, and content update return **200**. Delete returns **204**.

The content endpoints are under **`/v2/playlists`** (plural).

Setting playlist items is a **full replace**, not a delta: every `PUT …/content` must send the complete list you want after the change. To add an item, include the existing items plus the new one. To remove an item, omit it. To reorder, send the same ids with new `position` values.

A VOD must be **online** before you can add it to a playlist. After `PUT …/content`, `content.list` on that response may still be `null` - confirm with `GET /v2/playlists/{id}` (indexing can lag).

***

## 1. Create a playlist

```curl
curl -X POST "https://developer.dacast.com/v2/playlists" \
  -H "X-Api-Key: insertYourApiKeyHere" \
  -H "X-Format: default" \
  -H "Content-Type: application/json" \
  -d "{\"title\":\"Conference playlist\",\"description\":\"Highlighted sessions\"}"
```

```javascript
const headers = new Headers();
headers.append('X-Api-Key', 'insertYourApiKeyHere');
headers.append('X-Format', 'default');
headers.append('Content-Type', 'application/json');

fetch('https://developer.dacast.com/v2/playlists', {
  method: 'POST',
  headers,
  body: JSON.stringify({
    title: 'Conference playlist',
    description: 'Highlighted sessions'
  })
})
  .then((response) => response.json())
  .then((playlist) => {
    // store playlist.id
  });
```

Store `id` from the **200** response. Optional create fields (see [Create Playlist](https://docs.dacast.com/reference/create-playlist)): `online`, `password`, `google_analytics`, `theme_id`, `referers_id`, `countries_id`.

A new playlist has an empty content list:

```json
{
  "id": "a4c11578-d1e4-3e1e-4d0b-2f4635bec0c0",
  "title": "Conference playlist",
  "description": "Highlighted sessions",
  "content": {
    "list": null,
    "start_time": "00:00:00"
  }
}
```

***

## 2. Look up the playlist

```curl
curl "https://developer.dacast.com/v2/playlists/{playlistId}" \
  -H "X-Api-Key: insertYourApiKeyHere" \
  -H "X-Format: default"
```

Use `content.list` as the current membership. Each item has `id`, `type` (`vod` or `channel`), `position`, and `title`. `position` may be a number or a string - treat it as a string when comparing.

After the playlist contains a VOD, lookup looks like:

```json
{
  "ads": null,
  "asset_id": "8f2facdc-1a29-5903-bffb-8414b3ee5da5-playlist-793c3713-ee42-289a-af29-52aa68e1d89c",
  "autoplay": false,
  "company_url": null,
  "content": {
    "list": [
      {
        "id": "3c7a4c4c-163b-49b1-987e-2b2d139fda64",
        "position": "1",
        "thumbnail_id": "1",
        "title": "Episode 1",
        "type": "vod"
      },
      {
        "id": "6cb5f0ed-13eb-8d86-da0e-fc95db7837ad",
        "position": "2",
        "thumbnail_id": "1",
        "title": "Episode 2",
        "type": "vod"
      }
    ],
    "start_time": "00:00:00"
  },
  "countdown_date": "",
  "countdown_timezone": "",
  "counter_live_limit": -1,
  "countries_id": "",
  "creation_date": "2026-08-20T12:33:07Z",
  "custom_data": null,
  "description": "Highlighted sessions",
  "enable_payperview": false,
  "enable_subscription": false,
  "external_video_page": "http://",
  "google_analytics": "false",
  "id": "793c3713-ee42-289a-af29-52aa68e1d89c",
  "logo_url": null,
  "noframe_security": 0,
  "online": true,
  "password": null,
  "pictures": {
    "splashscreen": null,
    "thumbnail": null
  },
  "player_height": 0,
  "player_size_id": 10,
  "player_width": 0,
  "publish_on_dacast": true,
  "save_date": "2026-08-20T12:33:07Z",
  "stream_category": 0,
  "theme_id": "8cd97b5d-a7f7-4c98-342b-d49b4625d398",
  "title": "Conference playlist"
}
```

> 🚧 `online` means the playlist is **enabled** for playback, not that an item is currently playing.

To list playlists: `GET /v2/playlists?page=1&perpage=15` (page size query param is **`perpage`**, not `per_page`).

***

## 3. Set playlist content (replace)

[Set Playlist Content](https://docs.dacast.com/reference/set-playlist-content): `PUT /v2/playlists/{playlistId}/content`.

Build the **full** list of objects `{ id, type, position }`, then send it as a **JSON string** in the `content` field - not as a raw array:

```json
{
  "content": "[{\"id\":\"3c7a4c4c-163b-49b1-987e-2b2d139fda64\",\"type\":\"vod\",\"position\":1},{\"id\":\"6cb5f0ed-13eb-8d86-da0e-fc95db7837ad\",\"type\":\"vod\",\"position\":2}]"
}
```

```curl
curl -X PUT "https://developer.dacast.com/v2/playlists/{playlistId}/content" \
  -H "X-Api-Key: insertYourApiKeyHere" \
  -H "X-Format: default" \
  -H "Content-Type: application/json" \
  -d "{\"content\":\"[{\\\"id\\\":\\\"VOD_OR_CHANNEL_ID\\\",\\\"type\\\":\\\"vod\\\",\\\"position\\\":1}]\"}"
```

```javascript
const items = [
  { id: 'VOD_OR_CHANNEL_ID', type: 'vod', position: 1 }
];

fetch('https://developer.dacast.com/v2/playlists/' + playlistId + '/content', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'insertYourApiKeyHere',
    'X-Format': 'default',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ content: JSON.stringify(items) })
});
```

| Action  | How                                                                                    |
| ------- | -------------------------------------------------------------------------------------- |
| Add     | GET current list, append `{ id, type, position }`, PUT the whole list                  |
| Remove  | GET current list, drop that object, PUT what remains (empty list = `{"content":"[]"}`) |
| Reorder | PUT the same ids with new `position` values in the full `content` list                 |

`type` must be `vod` or `channel`. Source ids from [List videos](https://docs.dacast.com/reference/list-videos) and [Lookup Stream](https://docs.dacast.com/reference/lookup-stream) / the channel list.

Then poll lookup until `content.list` contains the expected ids.

***

## 4. Update playlist metadata

Title and description are a separate call - not `/content`:

```curl
curl -X PUT "https://developer.dacast.com/v2/playlists/{playlistId}" \
  -H "X-Api-Key: insertYourApiKeyHere" \
  -H "X-Format: default" \
  -H "Content-Type: application/json" \
  -d "{\"title\":\"Updated playlist title\",\"description\":\"Updated description\"}"
```

***

## 5. Delete

```curl
curl -X DELETE "https://developer.dacast.com/v2/playlists/{playlistId}" \
  -H "X-Api-Key: insertYourApiKeyHere" \
  -H "X-Format: default"
```

Expect **204**.

***

## After the playlist exists

* [Embed codes](https://docs.dacast.com/docs/embed-codes) - `/v2/playlist/{playlistId}/embed/javascript` and `…/embed/iframe`
* [Create Thumbnail](https://docs.dacast.com/reference/create-thumbnail) / [Create Splash](https://docs.dacast.com/reference/create-splash) - `resource_type=playlist` (singular)
* [Create Playlist](https://docs.dacast.com/reference/create-playlist) / [Set Playlist Content](https://docs.dacast.com/reference/set-playlist-content)