Skip to content
Products

Receivers API

A receiver is an input stream: a UDP multicast, an HTTP or HLS source, or an RTSP camera. A channel takes its video from a receiver. Read more about the supported sources in Receivers.

{
"id": "news-source",
"enable": true,
"name": "News source",
"source": "udp://239.1.1.1:1234",
"user_agent": "Alta"
}
  • id: Receiver ID. Only in the create request. If you omit it, Alta generates a UUID.
  • enable: Starts the receiver.
  • name: Name of the receiver. If you omit it in the create request, Alta uses the ID.
  • source: URL of the input stream.
  • user_agent (optional): User-Agent header for HTTP sources.
Terminal window
POST /api/ott/receiver

Example:

Terminal window
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
'http://alta.example.com:8100/api/ott/receiver' \
-d '{"id": "news-source", "name": "News source", "source": "udp://239.1.1.1:1234", "enable": true}'

Returns 204, or 409 if a receiver with this ID already exists.

Terminal window
GET /api/ott/receiver?id=<receiver_id>

Returns the receiver object without the id field, or 404. Available to admin and observer.

Terminal window
PUT /api/ott/receiver?id=<receiver_id>

Send all fields: enable, name, source, and user_agent. A field you omit is cleared. An omitted enable disables the receiver.

Terminal window
curl -sS -X PUT -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
'http://alta.example.com:8100/api/ott/receiver?id=news-source' \
-d '{"enable": true, "name": "News source", "source": "udp://239.1.1.2:1234"}'

When the source, name, or enable changes, Alta restarts the receiver and the channels that use it. If a channel cannot start, the answer is 200 with an object where the value is the reason:

{ "-": "reason of the error" }

Disabling a receiver also disables the channels that use it.

Terminal window
DELETE /api/ott/receiver?id=<receiver_id>

Stops the channels that use the receiver, then removes it. The channels stay in the configuration and are disabled. Before you enable them again, set another receiver with Update a Channel. Returns 204, or 404.

Terminal window
GET /api/ott/receiver/status

Returns the traffic of all receivers by ID. Use it to get the list of receiver IDs. Available to admin and observer.

Response:

{
"receivers": {
"news-source": { "totalBytes": "1.5 GB", "speed": "4.2 Mbit/s" }
}
}
  • totalBytes: Received data since the start, as text for display.
  • speed: Current speed, as text for display.

Alta can create receivers and channels from an M3U playlist. The import has two steps: read the playlist, then import the items you select.

1. Read a playlist from a URL:

Terminal window
GET /api/ott/receiver/importm3u?id=<playlist_url>

Alta downloads the URL from the server, not from your computer. The server must reach the address. Returns 422 if the download fails.

To read a playlist from your own file, send it as a Base64 string in the JSON body of a POST request to /api/ott/receiver/importm3u.

Terminal window
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
'http://alta.example.com:8100/api/ott/receiver/importm3u' \
-d "\"$(base64 < playlist.m3u | tr -d '\n')\""

Response:

[
{
"id": "1",
"name": "News",
"channel_path": "news",
"address": "udp://239.1.1.1:1234"
}
]

2. Import the selected items:

Terminal window
PUT /api/ott/receiver/importm3u

The body is an object with the items to import, in the same format. Each item needs the address and the channel_path.

Terminal window
curl -sS -X PUT -H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
'http://alta.example.com:8100/api/ott/receiver/importm3u' \
-d '{"1": {"id": "1", "name": "News", "channel_path": "news", "address": "udp://239.1.1.1:1234"}}'

For each item, Alta creates a disabled receiver and the channel <channel_path>/main. Enable them with Update a Receiver and Start and Stop.

CodeDescription
204All items are imported
200Some items are skipped. The body groups them by the reason: the channel already exists, or a receiver with this source already exists
400An item has no address or no channel path
413More than 256 items