Skip to main content

Base URL

The Ant Media Server REST API is accessible at:
https://{host}:{port}/{application}/rest/v2/
Example:
https://test.antmedia.io:5443/LiveApp/rest/v2/

API Endpoints

Ant Media Server provides the following API endpoint groups:
  • Broadcasts - /v2/broadcasts - Manage live streams, IP cameras, and stream sources
  • VoD - /v2/vods - Manage video-on-demand files
  • Push Notifications - /v2/push-notification - Send notifications to subscribers
  • Cluster - /cluster-communication - Internal cluster node communication (hidden)

Authentication

Ant Media Server REST API uses JWT (JSON Web Token) authentication. You need to include the JWT token in the Authorization header:
Authorization: Bearer {your_jwt_token}

Getting a JWT Token

You can generate JWT tokens for specific streams using the authentication endpoints. Tokens can be created for:
  • Publish - Allow publishing to a stream
  • Play - Allow playing a stream
  • Room Access - Allow joining a conference room
See the Authentication page for detailed token generation methods.

Common Response Format

Most API endpoints return a Result object:
{
  "success": true,
  "message": "Operation completed successfully",
  "dataId": "stream123",
  "errorId": 0
}
success
boolean
Indicates whether the operation was successful
message
string
Human-readable message describing the result
dataId
string
ID of the created or affected resource
errorId
integer
Error code if the operation failed (0 for success)

Common Error Codes

CodeDescription
200Success
400Bad Request - Invalid parameters
404Not Found - Resource does not exist
500Internal Server Error

Rate Limits

There are no explicit rate limits, but resource-intensive operations may be throttled based on system load. The server monitors CPU and memory usage and may reject requests with:
{
  "success": false,
  "message": "Resource usage is high",
  "errorId": -3
}

Pagination

List endpoints support pagination with offset and size parameters:
GET /v2/broadcasts/list/{offset}/{size}
  • Maximum items per request: 50
  • Default offset: 0

Next Steps

Authentication

Learn how to generate and validate tokens

Broadcasts API

Manage live streams and recordings

VoD API

Handle video-on-demand content

Push Notifications

Send notifications to subscribers

Build docs developers (and LLMs) love