Skip to content

Distribution API

The Distribution API manages the delivery nodes your organization runs: streamers that ingest and serve live channels, cache nodes that sit in front of them, and server load balancers (SLBs) that spread viewer traffic. It also sets how each cache node routes requests to streamers, which external streams it relays, and which of your workspaces may put channels on each streamer.

Resources

Resource What it is
Streamer A node that ingests a live source and packages it for playback. Channel origins run on streamers.
Streamer access Which workspaces of the organization may put channels on a streamer.
Cache node A node that serves viewers and caches what it fetches from streamers or from an external source.
Origin key A routing rule on a cache node: requests whose path matches a pattern go to an ordered list of streamers.
External relay A rule that makes a cache node serve a third-party HTTP(S) stream under a path of its own.
SLB A server load balancer that spreads viewer traffic across cache nodes.

Nodes belong to an organization, not to a workspace: every workspace of the organization shares them.

Authentication and permissions

Every route needs a bearer token. See Authentication. The {orgId} in the path must be the organization in your token; any other value returns 403.

Action Permission
List and get streamers, cache nodes, SLBs, origin keys and relays; read streamer access; list a streamer's channels or caches org:distribution:view
Ping a streamer, cache node or SLB org:distribution:view
Register, update or delete nodes; set streamer access org:distribution:manage
Create, change, delete or push origin keys and relays org:distribution:manage
Probe a UDP signal or its format org:distribution:manage

With the default roles, every organization role has org:distribution:view; only the organization owner and admin have org:distribution:manage. Workspace users pick a streamer for a channel through the Playback API, which lists only the streamers their workspace may use.

Base path

CoreAPI, on <API_HOST>:

https://<API_HOST>/api/v1/distribution/{orgId}/…

{orgId} is your organization's ID. Node, origin key and relay IDs in the path are integers.

Capabilities

  • Register, list, update and ping streamers
  • Choose which workspaces may use each streamer
  • Check for a UDP multicast signal, and inspect its codec and scan type, through a streamer
  • List the channels on a streamer and the cache nodes it feeds
  • Register, list, update, delete and ping cache nodes and SLBs
  • Route a cache node to streamers with origin keys, and push them to the node
  • Serve a third-party HTTP(S) stream through a cache node with external relays
  • Delete a streamer (planned)

Object model

Streamer

Field Type Required Description
id integer read-only Streamer ID.
organizationId string read-only Owning organization, taken from the path.
name string required Name, unique in the organization. Up to 100 characters.
host string required Address PlayTelly uses to reach the node.
publicHost string optional Address viewers use for playback. Empty means host.
httpPort integer required Port that serves playback (HLS and DASH).
apiPort integer required Port of the node's control API.
hasGpu boolean optional The node can transcode on a GPU. Default false.
role string optional ingest (default): takes live UDP or multicast feeds. cproxy: serves and caches only, so a UDP channel origin on it fails.
accessMode string read-only all_workspaces or selected. Change it with PUT …/streamers/{id}/access. New streamers start as selected with no workspaces.
status string read-only online, offline or unknown (not pinged yet). Updated by a ping.
lastPingedAt string read-only Time of the last ping, ISO 8601 UTC. Omitted before the first ping.
installStatus string read-only not_installed, pending, installing, installed or failed: whether PlayTelly installed the node's software. Nodes you register yourself stay not_installed.
installStage, installError, installStartedAt string read-only Progress and result of that installation.
createdAt, updatedAt string read-only ISO 8601 UTC.
{
  "id": 12,
  "createdAt": "2026-11-16T03:10:00Z",
  "updatedAt": "2026-11-16T03:12:41Z",
  "deletedAt": null,
  "organizationId": "5f0c8a52-3c1e-4d7b-9a51-2f6b1e0c9d11",
  "name": "streamer-bkk-01",
  "host": "streamer-bkk-01.example.com",
  "publicHost": "live-bkk-01.example.com",
  "httpPort": 18080,
  "apiPort": 18081,
  "hasGpu": true,
  "role": "ingest",
  "accessMode": "selected",
  "status": "online",
  "lastPingedAt": "2026-11-16T03:12:41Z",
  "installStatus": "not_installed",
  "installStage": ""
}

Streamer access

Field Type Required Description
accessMode string required all_workspaces: every workspace of the organization may use the streamer. selected: only the workspaces in workspaceIds.
workspaceIds array of string optional Workspace IDs, each in this organization. Stored in both modes, applied only in selected.
{ "accessMode": "selected", "workspaceIds": ["088566eb-dc55-460a-b3cf-7352ba96e6bd"] }

Revoking a workspace stops new channels from using the streamer; channels already on it keep running.

Cache node

Same identity, status, ping and installation fields as a streamer, plus:

Field Type Required Description
name, host string required As for a streamer.
publicHost string optional Host name viewers use.
publicBaseUrl string optional How viewers reach the node: scheme://host[:port], no path, query or credentials. Used for external relay addresses. Empty means http://<publicHost or host>:<httpPort>.
relayDefault boolean optional This node serves new external relay channels. At most one node per organization; setting it moves the mark. Default false.
httpPort integer required Port that serves viewers.
apiPort integer required Port of the node's control API.
{
  "id": 3,
  "organizationId": "5f0c8a52-3c1e-4d7b-9a51-2f6b1e0c9d11",
  "name": "cache-bkk-01",
  "host": "cache-bkk-01.example.com",
  "publicHost": "cdn-bkk-01.example.com",
  "publicBaseUrl": "https://cdn-bkk-01.example.com",
  "relayDefault": true,
  "httpPort": 8080,
  "apiPort": 8081,
  "status": "online",
  "installStatus": "not_installed",
  "installStage": ""
}

Origin key

Field Type Required Description
id integer read-only Origin key ID, used as {keyId}.
cacheId integer read-only Cache node the key belongs to.
originKey string required, write-once Key name, unique on the node. Must not start with relay-.
urlPattern string required Regular expression matched against the request path, for example ^/live/.*$.
urlRewriteMatch, urlRewriteReplace string optional Rewrite applied to the path before it is forwarded, for example ^/live/(.*)$ → /$1.
ttl string optional Default cache time as a duration (500ms, 1s). Default 1s.
priority integer optional Order among the node's keys, lowest first. Default 0.
sourceKind string read-only streamer for an origin key, external for an external relay.
streamers array read-only Assigned streamers (streamerId, priority), tried lowest priority first; the next one takes over when one fails.
{
  "id": 7,
  "cacheId": 3,
  "originKey": "live",
  "urlPattern": "^/live/.*$",
  "urlRewriteMatch": "^/live/(.*)$",
  "urlRewriteReplace": "/$1",
  "ttl": "1s",
  "priority": 0,
  "sourceKind": "streamer",
  "streamers": [{ "id": 9, "originKeyId": 7, "streamerId": 12, "priority": 0 }]
}

Changes to origin keys are stored in PlayTelly first. They reach the node when you push them with POST …/caches/{id}/keys/sync, which replaces the node's whole origin configuration.

External relay

An origin key with sourceKind: external. Create one directly, or let the Playback API create one when you add an external relay channel; a relay that belongs to a channel can only be changed through that channel.

Field Type Required Description
originKey string required, write-once relay- plus lowercase letters, digits and dashes (at most 59 characters). Must not end in -master or -seg.
pathPrefix string required Path the relay is served under on the node, for example /radio-one. Unique among the node's enabled relays.
externalUrl string required Upstream origin, http or https, host and optional port only. Must resolve to public addresses.
upstreamBasePath string optional Path the stream lives under on the upstream.
hostOverride string optional Host header sent upstream. Empty sends the upstream's own host.
ttlNoCache string optional Cache time for playlists. Default 2s.
pinMasterPath, pinMasterTtl string optional, together Entry playlist (relative to pathPrefix) and how long to cache it, so all viewers share one upstream session.
segmentTtl string optional Cache time of media segments. Empty means 60s; off means the same as ttlNoCache.
disableWarm boolean optional Don't keep the playlist and newest segments pre-fetched.
disabled boolean optional Keep the relay but take it off the node.
priority integer optional Order among the node's relays, lowest first.
lastSyncedAt, lastSyncStatus, lastSyncError string read-only Result of the last push: ok, error or disabled.
{
  "id": 21,
  "cacheId": 3,
  "originKey": "relay-radio-one",
  "sourceKind": "external",
  "pathPrefix": "/radio-one",
  "externalUrl": "https://radio.example.com",
  "upstreamBasePath": "/live/radio-one",
  "ttlNoCache": "2s",
  "pinMasterPath": "playlist.m3u8",
  "pinMasterTtl": "30s",
  "segmentTtl": "60s",
  "disableWarm": false,
  "disabled": false,
  "lastSyncedAt": "2026-11-16T04:00:01Z",
  "lastSyncStatus": "ok"
}

Creating, changing or deleting a relay pushes the node's relays straight away; PlayTelly also re-pushes them about every minute. A relay push only touches relay- origins, so it never removes your origin keys.

A node holds at most 50 relays.

SLB

Field Type Required Description
id, organizationId, createdAt, updatedAt read-only As for a streamer.
name string required Name, unique in the organization.
host string required Address PlayTelly uses to reach the SLB.
publicHost string optional Host name viewers use.
proxyPort integer required Port that takes viewer traffic.
apiPort integer required Port of the SLB's control API.
status, lastPingedAt string read-only Result of the last ping.
{
  "id": 2,
  "organizationId": "5f0c8a52-3c1e-4d7b-9a51-2f6b1e0c9d11",
  "name": "slb-bkk-01",
  "host": "slb-bkk-01.example.com",
  "publicHost": "edge-bkk.example.com",
  "proxyPort": 8090,
  "apiPort": 8100,
  "status": "unknown"
}

Updates and lists

  • PUT on a streamer, cache node or SLB is a partial update: empty strings, 0 and false are ignored, so it can't clear publicHost or set hasGpu back to false.

Lists

Streamer, cache node and SLB lists are paginated. page starts at 1 (default 1). limit defaults to 10 and is capped at 100; a value below 1 or not a number falls back to the default. Results are newest first (createdAt descending). Filter with status and search (matches part of name or host).

Origin keys (lowest priority first, then oldest), relays, streamer access, and a streamer's channels and caches are not paginated: they return all items in data, with no meta.

curl "https://<API_HOST>/api/v1/distribution/<ORG_ID>/streamers?page=1&limit=10&status=online" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
{
  "success": true,
  "data": [
    {
      "id": 12,
      "createdAt": "2026-11-16T03:10:00Z",
      "updatedAt": "2026-11-16T03:12:41Z",
      "deletedAt": null,
      "organizationId": "5f0c8a52-3c1e-4d7b-9a51-2f6b1e0c9d11",
      "name": "streamer-bkk-01",
      "host": "streamer-bkk-01.example.com",
      "publicHost": "live-bkk-01.example.com",
      "httpPort": 18080,
      "apiPort": 18081,
      "hasGpu": true,
      "role": "ingest",
      "accessMode": "selected",
      "status": "online",
      "lastPingedAt": "2026-11-16T03:12:41Z",
      "installStatus": "not_installed",
      "installStage": ""
    }
  ],
  "meta": {
    "count": 1,
    "total": 1,
    "page": 1,
    "limit": 10,
    "total_pages": 1,
    "has_next": false,
    "has_prev": false,
    "timestamp": "2026-11-16T03:12:50Z"
  }
}

count is the number of items on this page and total the number across all pages.

Lifecycle or states

A node's status comes from the last ping:

Status Meaning
unknown Registered, not pinged yet.
online The node's control API answered the last ping.
offline It didn't.

status isn't refreshed on a fixed schedule: call the ping route before you rely on it.

Errors

Errors raised by a route have the body { "success": false, "error": "<message>" }. The message is English text for people, not a stable code. A missing token (401) or permission (403) returns { "message": "<message>" }.

Status When What to do
400 Body isn't JSON, a required field is missing, an ID in the path isn't a number, a value is invalid (for example publicBaseUrl with a path, or a relay host that resolves to a private address), or a body reference (streamerId, workspaceIds) isn't in your organization. Fix the request; the message says which field.
401 No token, or it expired. Sign in again or refresh the token.
403 {orgId} isn't the organization in your token, or your role lacks the permission. Use your own organization ID, or ask an organization admin.
404 The node, origin key, relay or assignment doesn't exist in your organization. Check the IDs.
409 You changed an origin key that is a relay (use …/relays), a relay that belongs to a channel (change the channel), or pushed origin keys to a node that serves relays (use …/relays/sync). Use the route the message names.
500 The change couldn't be saved, for example a node name already used in the organization. Check for a duplicate name, then retry.
502 The node didn't accept a pushed configuration. Ping the node, then retry.

Example bodies, exactly as returned (the message text varies by route):

{ "success": false, "error": "invalid JSON" }

400: a validation failure from the route.

{ "message": "Unauthorized - No token provided" }

401: a missing, malformed or expired token. Other messages are Unauthorized - Invalid token format and Unauthorized - <reason the token was rejected>.

{ "message": "Forbidden - Insufficient permissions" }

403: wrong organization or missing permission.

{ "success": false, "error": "streamer not found" }

404: the same shape for a cache node, SLB, origin key or relay, with the matching message.

{ "success": false, "error": "this is an external relay; manage it under /relays" }

409.

{ "success": false, "error": "failed to process request" }

500: a generic failed to … message; the cause is not returned. A 502 has the same shape, with a message that says the node failed or refused the push.

Endpoints