JustOnAir docs
View as Markdown

Errors

Every error has a stable code. Match on the code, show the message to people.

Errors come back with an HTTP status and this body:

JSON
{
  "error": {
    "code": "limit_pending_streams",
    "message": "At most 2 streams may be waiting to go live at once. Start or delete one first.",
    "details": { "limit": 2, "current": 2 },
    "request_id": "req_8k2m0q4b7c1d8e3a9f5x"
  }
}

code never changes for a given condition, so program against it. message is written for people and may change. details appears when there are numbers worth having. request_id is also in the X-Request-Id header of every response: quote it when you write to us.

When waiting fixes the error, the response has a Retry-After header in seconds: rate_limited, limit_creation_rate, chat_slow_mode, chat_rate_limited, chat_busy and no_capacity. The other limits don't go away by waiting and have none.

Codes

StatuscodeMeaningWhat to do
400invalid_requestA field is missing, unknown or out of range. The message names it.Fix the request.
400invalid_nicknameA chat nickname that isn't 2–24 characters, or contains a link.Show the message to the viewer.
401moderator_unauthorizedNo valid moderator session for this stream: the moderator was removed, or their active_days ran out.Ask the owner for a new moderator link.
401invalid_sessionA missing, forged or expired viewer session on a public chat call.Get a new one: POST /v1/embed/{id}/session.
401invalid_viewer_tokenThe viewer token was refused. The message says why: signature, expiry, unknown or deleted key, another stream.Fix what the message names; sign a fresh token for each page load.
401viewer_token_requiredA members-only stream (player.require_viewer_token), and the session request had no viewer token.Open the stream from your site with a viewer token.
401unauthorizedMissing or wrong API key.Send Authorization: Bearer joa_live_….
402insufficient_creditLess than $1.00 of credit left. details has the balance.Add credit.
403account_pendingThe account hasn't been approved yet.Wait for the approval email.
403viewer_removedA members-only stream: you removed this viewer (a ban by viewer_id).Nothing to do for the viewer; unban them to let them back.
403viewer_access_endedA members-only stream: the viewer token's exp passed.Sign a new token: the viewer reopens the page from your site.
403origin_not_allowedA chat session, post or reaction from a browser on a site not in player.allowed_domains.Add the site, or call from an allowed one.
403tenant_suspendedThe account is suspended.Contact JustOnAir.
404not_foundNo such stream in this account, or no such endpoint.Check the id, the path and the key's account.
409stream_not_pendingThe key can only be replaced before the stream goes live. details.status says the current status.For an expired stream, create a new one.
409stream_endedThe stream has ended, so no new playback links.Use the recording, or turn on replay.
409invite_invalidA moderator link that was already used, revoked, expired, or is for another stream.Ask the owner for a new link.
409chat_not_enabledA chat action on a stream that never had chat on.Set chat.enabled on the stream.
409chat_closedChat isn't open (details.state).See Chat and reactions.
409chat_pausedThe owner paused chat; viewers can't post.Show "chat is paused".
409recording_not_readyThe MP4 isn't ready. details.status says why.Poll the stream until recording.status is ready.
422chat_message_not_allowedA viewer's chat message contains a link.Show "links are not allowed".
422idempotency_key_reusedThis Idempotency-Key was already used with a different body.Use a new key for a different request.
429limit_pending_streamsToo many streams waiting to go live.Start or delete one first.
429limit_creation_rateToo many streams created in the last hour.Wait Retry-After (also details.retry_after_seconds); reuse pending streams.
429limit_ingest_hoursMonthly ingest hours used up (new accounts: 20).Wait for next month or ask to be trusted.
429limit_resolutionmax_resolution above what the account may send (new accounts: 720).Ask to be trusted for 1080p.
429limit_channelsThe account has as many channels as it may (new accounts: 3).Delete one, or ask to be trusted.
429limit_api_keys20 active API keys already.Revoke one in the dashboard.
429limit_moderators50 moderators on this stream or moderation group already.Remove one first.
429limit_viewer_keys10 viewer keys on the account already.Delete one you no longer use (dashboard: API keys → Viewer keys).
429limit_webhook_endpoints5 webhook endpoints already.Delete one, or subscribe one endpoint to more events.
429chat_slow_modeA viewer posted again too soon. details.retry_after_seconds.Show a countdown.
429chat_rate_limited30 chat messages a minute from one address on one stream.Wait details.retry_after_seconds.
429chat_busyThe stream's chat is at its hard limit.Retry after details.retry_after_seconds.
429rate_limitedToo many requests to the public embed or chat endpoints (unknown ids, or a flood from one address).Slow down; wait Retry-After.
4xxhttp_errorA request the API couldn't take at all, such as a body that isn't JSON. The status says which.Fix the request.
500internal_errorA problem on our side.Retry with backoff. If it keeps happening, write to us with the request_id.
503no_capacityNo ingest capacity free right now.Retry after Retry-After (a minute).

Retrying a create with the same Idempotency-Key is always safe; see API basics.

Refusals that aren't HTTP errors

Some problems happen on the video connection, not on an API call. A publisher can be refused (wrong key, stream already finished, another publisher connected, account out of credit), or a live stream can be ended. The API call to read the stream then shows why: status and end_reason on Stream lifecycle.