Stop a live channel
const url = 'https://api.iomza.com/v1/live/channels/example/stop';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"refuse_minutes":1}'};
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.iomza.com/v1/live/channels/example/stop \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "refuse_minutes": 1 }'Ends the session in progress within seconds and refuses the encoder for refuse_minutes (2 by default), or until the channel is reactivated. The body may be empty.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”The channel.
A live channel.
object
preparing: the channel is being set up, which can take a few minutes; its encoder is refused until then. idle: waiting for an encoder. live: streaming now. reconnecting: its encoder dropped during a stream and the stream waits up to 5 minutes for it to come back (viewers keep the DVR). stopped: refusing its encoder (see stopped_until).
Until when it refuses its encoder after a stop; null with status stopped: until reactivated.
object
Where the encoder streams to, encrypted (RTMPS): OBS’s “Server”.
The same without encryption (RTMP), for encoders that don’t support RTMPS. The stream key travels in the clear.
Where the encoder streams to over SRT, which holds up better on unstable networks: replace {stream_key} with the stream key, it goes in this address. The stream key travels in the clear.
The stream key’s last characters, to recognize it.
Whether GET …/stream-key can show the key; false for an old key: rotate it once to get one that can.
Where a channel is played from: HLS and DASH, live at the edge or with the DVR window.
object
HLS at the live edge (the last seconds): for players that only follow the live stream.
DASH at the live edge.
HLS with the DVR window, to rewind (dvr_minutes).
DASH with the DVR window.
Whether sessions are kept whole when they end (the playback URLs then play them from the start).
How far back viewers may rewind on the DVR URLs, in minutes (1–120).
The longest session, in minutes.
When its session on air started; null when it isn’t on air.
Only encoders at these IPv4 addresses or ranges may stream to it; empty: any.
Only encoders in these countries may stream to it; empty: any.
Example
{ "object": "live_channel", "status": "preparing"}Invalid fields: details lists each problem with its path.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}The API key is missing, invalid or revoked.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}Valid credentials that may not do this (forbidden), your plan doesn’t include the module the route belongs to (module_not_in_plan), or your organization is suspended (organization_suspended).
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}It doesn’t exist in your organization.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}Too many requests: wait and retry. Answered by the gateway, so the body may differ.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}Ours: retry, and tell us if it persists.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}Momentarily unavailable: retry in a few seconds.
object
object
Stable: branch on it.
English, for people; may change.
Each problem, as path: message (validation errors).
Example
{ "error": { "code": "validation_error" }}