Skip to content

Live room API

Chat, reactions and gift highlights beside a stream. Your server mints a pass for each viewer or moderator, posts gift highlights from your own giving system, and moderates.

This page is generated from the OpenAPI specification; the same text is inMarkdown for tools and AI assistants.

Get a live room pass

GET/v1/streams/{playback_id}/room

A pass into the stream’s live room (chat, reactions, highlights) for a viewer or a moderator: a WebSocket URL and a token, valid six hours for a viewer and four for a moderator. A viewer can join only while the stream is live. Name a viewer you have signed in with X-Viewer-Name.

Path parameters

NameTypeDescription
playback_idrequiredstring

The stream’s playback_id.

Query parameters

NameTypeDescription
rolestring

viewer (the default) or moderator.

One of "viewer", "moderator".

viewerstring

1 to check a viewer’s access code for a private stream, as for playback.

One of "1", "true".

access_codestring

The viewer’s access code for a private stream (or send X-Access-Code).

viewer_ipstring

The viewer’s IP address (or send X-Viewer-IP).

Headers

NameTypeDescription
X-Viewer-Namestring

The name of a viewer you have signed in, percent-encoded UTF-8, 1-40 characters. Shown in the room. Send it only for a viewer whose identity you have verified.

X-Viewer-Memberstring

1 to mark the named viewer as a member of the customer’s community. Only with X-Viewer-Name.

One of "1".

X-Access-Codestring

The viewer’s access code for a private stream.

X-Viewer-IPstring

The viewer’s IP address, so wrong access codes are limited per viewer.

Response 200

The pass.

Errors

StatusCodeMeaning
400invalid_role

role is not viewer or moderator, or a viewer check asked for a moderator pass.

400invalid_viewer

viewer is not 1 or true.

400invalid_viewer_name

X-Viewer-Name is not a 1-40 character name, percent-encoded.

400invalid_viewer_member

X-Viewer-Member is not 1, or was sent without X-Viewer-Name.

403access_code_required

The stream is private and no access code was given.

403access_code_invalid

That access code is not this stream’s.

404not_found

No such stream in your organization.

409not_live

A viewer can join only while the stream is live.

429too_many_attempts

Too many wrong access codes from this viewer.

503live_unconfigured

The live room is not available on this deployment.

Terminal window
curl "https://api.cardinalstreaming.com/v1/streams/1846bdac2d8c0ce0e846d4a3817012c9/room?role=moderator" \
-H "Authorization: Bearer $CARDINAL_API_KEY"
Response 200
{
"url": "wss://live.cardinal.stream/rooms/1846bdac2d8c0ce0e846d4a3817012c9",
"token": "v1.eyJy...",
"expires_at": "2026-09-20T19:41:07Z",
"role": "moderator",
"viewer_id": "q2Vt3b0yJ1tF6pXhR8m4Ag"
}

Show a gift in the room

POST/v1/streams/{playback_id}/highlights

Shows a gift from your own giving system to everyone in the room, while the stream is live. Cardinal takes no payments: post a highlight after your giving system has taken the gift. id is yours and makes the call safe to retry: a repeat is answered 200 with duplicate: true and shown once. message is accepted and discarded — it reaches no viewer.

Path parameters

NameTypeDescription
playback_idrequiredstring

The stream’s playback_id.

Request body

NameTypeDescription
idrequiredstring

Your id for the gift. A repeat is shown once.

kindrequiredstring

One of "gift".

amount_displayrequiredstring

Shown exactly as given, such as $50.

namestring

The giver, only if they chose to be shown.

messagestring

Accepted and discarded.

Response 200

A repeat of an id already shown; nothing new was shown.

Fields
NameTypeDescription
deliveredrequiredinteger

How many connected viewers it reached.

duplicaterequiredboolean
displayedboolean

Response 202

Delivered to the room (displayed is false when gifts are on but their display is switched off).

Fields
NameTypeDescription
deliveredrequiredinteger

How many connected viewers it reached.

duplicaterequiredboolean
displayedboolean

Errors

StatusCodeMeaning
400invalid_body

The body has a field that is not one of the documented ones.

400unknown_kind

kind is not gift.

400invalid_id

id is not 1-80 letters, digits, ., :, _ or -.

400invalid_amount_display

amount_display is not 1-24 characters.

404not_found

No such stream in your organization.

409not_live

Highlights can be posted only while the stream is live.

409highlights_off

Highlights are switched off for this stream.

502room_unreachable

The live room did not answer; retry shortly.

503live_unconfigured

The live room is not available on this deployment.

Terminal window
curl -X POST "https://api.cardinalstreaming.com/v1/streams/1846bdac2d8c0ce0e846d4a3817012c9/highlights" \
-H "Authorization: Bearer $CARDINAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "gift-5f1c0a92",
"kind": "gift",
"amount_display": "$50",
"name": "The Alvarez family"
}'
Response 202
{
"delivered": 312,
"duplicate": false
}

Moderate the room

POST/v1/streams/{playback_id}/moderation

Removes a chat message, or mutes or unmutes a viewer (optionally removing everything they have said). The ids come from the room’s own messages.

Path parameters

NameTypeDescription
playback_idrequiredstring

The stream’s playback_id.

Request body

NameTypeDescription
actionrequiredstring

One of "remove_message", "mute_viewer", "unmute_viewer".

message_idstring

For remove_message.

viewer_idstring

For mute_viewer and unmute_viewer.

remove_messagesboolean

With mute_viewer, also remove what they have said.

Response 200

What the room did.

Fields
NameTypeDescription
removedone of

Whether the message was removed, or how many messages a mute removed.

mutedboolean
unmutedboolean
duplicateboolean
repeatedboolean

Errors

StatusCodeMeaning
400invalid_body

The body has a field that is not one of the documented ones.

400unknown_action

action is not remove_message, mute_viewer or unmute_viewer.

400invalid_message_id

message_id is missing for remove_message.

400invalid_viewer_id

viewer_id is missing for a mute or unmute.

404not_found

No such stream in your organization.

502room_unreachable

The live room did not answer; retry shortly.

503live_unconfigured

The live room is not available on this deployment.

Terminal window
curl -X POST "https://api.cardinalstreaming.com/v1/streams/1846bdac2d8c0ce0e846d4a3817012c9/moderation" \
-H "Authorization: Bearer $CARDINAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "mute_viewer",
"viewer_id": "q2Vt3b0yJ1tF6pXhR8m4Ag",
"remove_messages": true
}'
Response 200
{
"muted": true,
"removed": 3
}