Create a destination
POST/v1/streams/destinations
const url = 'https://api.ligr.live/rest/v1/streams/destinations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"YouTube main","type":"youtube","url":"rtmp://a.rtmp.youtube.com/live2","key":"abcd-efgh-ijkl-mnop"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ligr.live/rest/v1/streams/destinations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "YouTube main", "type": "youtube", "url": "rtmp://a.rtmp.youtube.com/live2", "key": "abcd-efgh-ijkl-mnop" }'Creates a destination. A push destination needs url and key. A pull destination needs
neither: LIGR serves it, and the answer carries pullUrl.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
push sends to url. pull lets a player pull from LIGR. Default push.
Inferred from the url when left out: srt:// is SRT, anything else RTMP.
Default program.
Server URL. Required for a push destination.
Stream key. Required for a push destination.
Example
{ "name": "YouTube main", "type": "youtube", "url": "rtmp://a.rtmp.youtube.com/live2", "key": "abcd-efgh-ijkl-mnop"}Responses
Section titled “Responses”Created
A saved destination of the organization. url and key are the server URL and the stream key
for a push destination. A pull destination has no url and key; LIGR serves it at pullUrl.
object
Entity identifier
program carries the graphics. clean is the picture without them.
For a pull destination: the URL a player or a relay pulls from.
True for a destination created for one match by createAndLinkOneOffDestination.
Example
{ "type": "youtube", "transportDirection": "push", "transportProtocol": "rtmp", "feedType": "program"}Request is invalid
object
object
Examplegenerated
{ "message": "example", "details": { "additionalProperty": "example" }}Missing or invalid api key
object
Examplegenerated
{ "message": "example"}Api key provides insufficient access for the request
object
Examplegenerated
{ "message": "example"}Destination not found
object
Examplegenerated
{ "message": "example"}Api key has made too many requests
object
Examplegenerated
{ "message": "example"}An unexpected error has occured. If problems persist please contact support
object
Examplegenerated
{ "message": "example"}