Skip to content
Products

HTTP API

Alta has an HTTP API with JSON requests and responses. Use it to create channels, connect input streams, manage archive storages and access control, and read the state of the service from your billing system, middleware, or scripts.

The Alta web interface uses the same API, so everything you can do in the interface you can automate.

All requests go to the API Server, not to the OTT Server that serves viewers. The default port is 8100. Read more in HTTP Server.

http://alta.example.com:8100/api/...

Every request, except /api/login, needs the credentials of an Alta user. There are two ways:

  • Bearer token: get a token with POST /api/login and send it in the Authorization: Bearer <token> header.
  • HTTP Basic: send the login and the password of the user in every request.

Read more in Quick Start.

The role of the user decides what the API allows. Roles are set in Users.

RoleAccess
adminAll requests of this section
observerRead-only: Status, receivers (GET, status), channel storage, previews and M3U export
anonymousNo access. Every request returns 401

Any signed-in user can read their own options and change their own password. See Users.

  • Send JSON bodies with the Content-Type: application/json header.
  • A request for a single item uses the id query parameter, for example /api/ott/receiver?id=news-hd.
  • Channel and variant IDs contain a slash, for example discovery/hd. Send the slash as is or URL-encoded as %2F.
  • POST creates an item, PUT replaces it, DELETE removes it. A PUT request replaces all fields of the item. Send the complete object, not only the changed fields.
  • A successful request that changes data returns 204 No Content with an empty body. Alta saves the configuration before it answers.
  • Alta has no requests that list channels, receivers, or storages. To get the IDs of the items, use the status requests, for example receiver status, storage status, and session status.
CodeDescription
200Success with a body
204Success, or the item has nothing to return, for example a channel without a storage
400The id parameter is missing, or the request is invalid. The body can contain a reason as plain text
401No credentials, or the credentials are wrong
403The role of the user does not allow the request. Wrong login or password for /api/login
404The item does not exist
409The item already exists, or a receiver is already used by another channel
422A field value is not valid
500Alta could not save the configuration
SectionWhat you can do
Quick StartLog in and publish the first channel
StatusRead the version, uptime, CPU, memory, and disk space
ChannelsCreate, change, start, stop, and delete channels, and export M3U playlists
ReceiversManage input streams and import channels from an M3U playlist
StoragesManage archive storages and read their size
Preview APIDownload MP4 preview clips from the archive
AuthorizersManage access rules and generate Securetoken values
SessionsSee who watches now
HLS AccessChange segment duration and playlist size
UsersManage users and passwords