Play uploaded media on a display with the API
Use this guide to take a file from your system to a screen with API calls only: upload it, wait until it is ready, put it in a playlist and send the playlist to a paired display. To do the same in the web app, see Schedule content on a display.
The display plays the playlist until you stop it or send another one. To play content on every display in a space on a schedule instead, use a feed; see Next steps.
Before you begin¶
- You can get an access token. See Quickstart and
Authentication. Replace
<API_HOST>with the API host for your environment from API conventions. -
A display is paired with the workspace, runs in
tellyboard(signage) mode and isOnline. See Pair a display with a pairing code.No real display yet? Steps 1 to 5 work without one. For step 6 you need a paired device ID. To test from a script, act as the display yourself: call the three display routes in Pair a display with a pairing code (generate a code, claim it, check the claim) to get a
<DEVICE_ID>. The play call then succeeds, but nothing plays until a real TV app uses that device. - You have a tus client and the tus upload address,<TUS_ENDPOINT>. See Upload media with tus.
IDs you need¶
| Placeholder | What it is | Where you get it |
|---|---|---|
<ACCESS_TOKEN> |
Your user access token. Expires after 15 minutes by default. | access_token from sign-in. See Quickstart: Get an access token. |
<WORKSPACE_ID> |
The workspace that owns the media and the display. | org.workspaces[].workspace_id from GET /api/v1/identity/users/me (step 1). See Find your workspace ID. |
<ORG_ID> |
Your organization. The playlist routes take it in the X-Organization-ID header. |
org.org_id from the same call (step 1). |
<TUS_ENDPOINT> |
The tus upload address for your environment. | No API route returns it: ask your PlayTelly contact. See Upload media with tus. |
<MEDIA_ID> |
The uploaded file, an integer such as 4521. |
mediaId from Get an upload (step 2). See the Media API. |
<PLAYLIST_ID> |
The playlist you send to the display. | playlistId from Create a playlist (step 3). |
<DEVICE_ID> |
The paired display. | deviceId from the display's pairing call (check-claim), or id in GET /api/v1/displays/<WORKSPACE_ID>. See Pair a display. |
<SPACE_ID> |
A room or area of your organization. Not needed for this guide. | Only to place the display in a space when you pair it, or to play a feed in a space. List them with GET /api/v1/venues/<WORKSPACE_ID>/locations/spaces. See the Spatial API. |
<STREAMER_ID> |
A streamer node, an integer. Not needed for this guide. | A display plays files, not a live stream, so no streamer is involved. You need it only for live channels: GET /api/v1/distribution/<ORG_ID>/streamers. See the Distribution API. |
Permissions you need¶
Most steps check a permission in the workspace. To see yours, read org.workspaces[].permissions in step 1.
| Step | Permission | Listed on |
|---|---|---|
| 2. Upload and follow the file | workspace:media:upload and workspace:media:view |
Media API |
| 3, 4. Create a playlist and add the media | A valid token for the organization in X-Organization-ID; no named permission |
Catalogue API |
| 5. Read the playlist as the display gets it, read the display, take a screenshot | workspace:devices:view |
Provisioning API |
| 6. Play, stop or test-play | workspace:devices:edit |
Provisioning API |
| Before you begin: pair the display | workspace:devices:create |
Pair a display with a pairing code |
Permissions come from your role in the workspace. A workspace admin (WORKSPACE_ADMIN), or an organization owner or
admin, gives you a role that includes them; organization owners and admins pass every workspace check. See
Workspace API.
Field names between the APIs¶
The same media appears under different names and types in each API. Copy the values as this table shows:
| Media API (step 2) | Catalogue playlist item (step 4) | Display playlist (step 5) | Play body (step 6) |
|---|---|---|---|
id: integer, 4521 |
mediaId: string, "4521" |
id: string |
mediaId: string |
mediaType |
mediaType |
mediaType |
type |
title |
name |
name |
name |
duration (seconds) |
duration |
duration |
duration |
url |
url |
url |
url |
Where the workspace goes. Media and display routes take the workspace in the path (/media/{workspaceId}/…,
/displays/{workspaceId}/…). The Catalogue playlist routes take the organization and workspace in the
X-Organization-ID and X-Workspace-ID headers instead. See API conventions.
Steps¶
-
Sign in and read your IDs. Get
<ACCESS_TOKEN>as in Quickstart, then ask who you are:You get
200 OK. Noteorg.org_id(<ORG_ID>), theworkspace_idof your workspace (<WORKSPACE_ID>) and itspermissions. The playlist routes (steps 3 and 4) take the organization and workspace in headers; the/media/…and/displays/…routes take the workspace in the path and need noX-Organization-ID:{ "org": { "org_id": "4f0c2a9e-1b7d-4e55-9a3c-2d8e6f1a7b90", "workspaces": [ { "workspace_id": "b3e1f0d4-8a2c-4f6e-9d17-5c0a3e9b2f48", "workspace_name": "Grand Hotel", "permissions": ["workspace:media:upload", "workspace:media:view", "workspace:devices:view", "workspace:devices:edit"] } ] } }The response has more fields; this shows the ones you need.
-
Upload the file and wait until it is ready. Follow Upload media with tus: prepare the upload, send the file to
<TUS_ENDPOINT>, then poll Get an upload until it returnsmediaId. That number is<MEDIA_ID>. Then poll the media until it is ready:curl "https://<API_HOST>/api/v1/media/<WORKSPACE_ID>/<MEDIA_ID>" \ -H "Authorization: Bearer <ACCESS_TOKEN>"The media is ready when
statusisready; a video is fully processed whentranscodingStageisdone:{ "success": true, "data": { "id": 4521, "title": "Lobby welcome", "mediaType": "video", "status": "ready", "duration": 42.5, "transcodingStage": "done", "url": "https://<ASSET_HOST>/playtelly/acme/hotel-lobby/4521/source/lobby-welcome.mp4" } }Keep
id,title,mediaType,durationandurl: the playlist copies them in step 4.<ASSET_HOST>stands for the host that serves your media files; useurlexactly as the response gives it. -
Create a playlist in the workspace:
curl -X POST "https://<API_HOST>/api/v1/playlists" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "X-Organization-ID: <ORG_ID>" \ -H "X-Workspace-ID: <WORKSPACE_ID>" \ -H "Content-Type: application/json" \ -d '{"name": "Lobby welcome loop"}'You get
201 Createdwith the new playlist's ID,<PLAYLIST_ID>:A retry creates a second playlist, so don't repeat this call on a timeout without listing the playlists first.
-
Add the media to the playlist. A new playlist has one version, the live one, and this call replaces all its items, so send the full ordered list:
curl -X POST "https://<API_HOST>/api/v1/playlists/<PLAYLIST_ID>/media" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "X-Organization-ID: <ORG_ID>" \ -H "X-Workspace-ID: <WORKSPACE_ID>" \ -H "Content-Type: application/json" \ -d '[{"mediaId": "4521", "position": 0, "duration": 43, "name": "Lobby welcome", "mediaType": "video", "url": "https://<ASSET_HOST>/playtelly/acme/hotel-lobby/4521/source/lobby-welcome.mp4"}]'mediaIdis<MEDIA_ID>from step 2, sent as a string.durationis how long the item plays, in whole seconds: the media'sdurationrounded up for a video, or the time to show an image.name,mediaTypeandurlare copied from step 2. The server stores what you send and doesn't look them up in the Media API, so copyurlexactly.
You get
200 OK:The same body is safe to send again.
-
Read the playlist as the display will get it, and check that the item is there:
curl "https://<API_HOST>/api/v1/displays/<WORKSPACE_ID>/playlists/<PLAYLIST_ID>/media" \ -H "Authorization: Bearer <ACCESS_TOKEN>"You get
200 OKwith the items in play order. Eachidis the media ID:[ { "id": "4521", "name": "Lobby welcome", "mediaType": "video", "position": 0, "zoneIndex": 0, "duration": 43, "url": "https://<ASSET_HOST>/playtelly/acme/hotel-lobby/4521/source/lobby-welcome.mp4" } ]An empty array
[]means step 4 didn't save; a404means the playlist isn't in this workspace. -
Send the playlist to the display. The body names the playlist and lists the items the display downloads. The server passes
itemsto the display as you send them and doesn't read them from the playlist, so build each item from step 5 (idbecomesmediaId,mediaTypebecomestype):curl -X POST "https://<API_HOST>/api/v1/displays/<WORKSPACE_ID>/<DEVICE_ID>/play" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{"id": "<PLAYLIST_ID>", "playlistName": "Lobby welcome loop", "items": [{"mediaId": "4521", "name": "Lobby welcome", "type": "video", "duration": 43, "url": "https://<ASSET_HOST>/playtelly/acme/hotel-lobby/4521/source/lobby-welcome.mp4"}]}'You get
200 OK:This means the playlist was sent to the display and recorded as its current playlist, not that it started playing: check that in Verify. A campaign or an emergency message on the display plays over it.
Try it for a few minutes first
POST /api/v1/displays/<WORKSPACE_ID>/<DEVICE_ID>/test-playwith{"playlistId": "<PLAYLIST_ID>", "minutes": 10}plays the playlist over the display's normal content and then returns to it. The server reads the items itself, so you send noitems. You get{"success": true, "message": "Test playback started for 10 minute(s)", …}.
Verify¶
-
Read the display:
curl "https://<API_HOST>/api/v1/displays/<WORKSPACE_ID>/<DEVICE_ID>" \ -H "Authorization: Bearer <ACCESS_TOKEN>"The device has your playlist as its current playlist, and
nowPlayingnames it with the sourcedirect. The response has more fields; this shows the ones to check:{ "id": "6f1c2a9e-3b7d-4c0e-9a51-2d8f4e7b1c30", "name": "Lobby screen A", "status": "Online", "currentPlaylistId": "2d9b7f10-4c3e-4a8b-9e6d-1f0a2b3c4d5e", "nowPlaying": { "source": "direct", "name": "Lobby welcome loop" } }nowPlayingsays what the display should show. A source ofcampaignoremergencymeans that content outranks your playlist right now. -
See the screen. Ask the display for a screenshot and wait for it:
curl -X POST "https://<API_HOST>/api/v1/displays/<WORKSPACE_ID>/<DEVICE_ID>/capture" \ -H "Authorization: Bearer <ACCESS_TOKEN>"The call waits up to 20 seconds for the picture (
?wait=40for longer;504if none arrives). You get200 OKwith the picture in base64 (addformat=rawto get the image file instead):{ "deviceId": "6f1c2a9e-3b7d-4c0e-9a51-2d8f4e7b1c30", "takenAt": "2026-11-19T08:45:02Z", "contentType": "image/jpeg", "bytes": 183204, "imageBase64": "/9j/4AAQSkZJRgABAQ..." }The image shows your media. A large video can take a while to download before it starts.
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
403 with Forbidden - Insufficient permissions on a /displays/… route, or 403 on a /media/… route |
Your role lacks the permission for that step. | Ask a workspace admin for a role with it. See Permissions you need. |
403 with Forbidden - the organization or workspace is not yours on /playlists |
X-Organization-ID or X-Workspace-ID is missing or names another organization or workspace. |
Send X-Organization-ID: <ORG_ID> and X-Workspace-ID: <WORKSPACE_ID> from step 1. |
404 with Playlist not found in this workspace in step 5 |
The playlist was created without X-Workspace-ID, or in another workspace. |
Create it again with X-Workspace-ID: <WORKSPACE_ID>. |
404 with Device not found in this workspace |
The device ID is wrong or the display is in another workspace. | List the devices with GET /api/v1/displays/<WORKSPACE_ID>. |
400 with No valid content on play |
The body has no playable items. | Send at least one item with url, as in step 6. |
409 on capture |
The display is offline. | Check it sends heartbeats; see Pair a display. |
nowPlaying is right but the screen shows something else |
The display hasn't downloaded the file yet, or can't reach url. |
Wait and capture again. Check that the display can open the url from step 2. |
How this maps to Tellyboard¶
In the Tellyboard web app, a playlist goes Draft, Active, then Publish to a space or endpoints
(Schedule content on a display). Step 6 here (/play on one device)
is the API equivalent of publishing to a single endpoint, without the approval step. Publishing to a whole space goes
through a feed: see the Next steps.
Next steps¶
- Play content on every display in a space, on a schedule: create a feed with your playlist as its base playlist and assign it to a space. See How content reaches a display.
- Stop the playlist:
POST /api/v1/displays/<WORKSPACE_ID>/<DEVICE_ID>/stop. See the Provisioning API. - Change the playlist safely with drafts and versions: Catalogue API: Playlist versions.
- Media API, Catalogue API, Provisioning API