Documentation

Room API

You can also manage rooms via API.

Create room

Endpoint https://chatbackend.watchers.io/external/room

Request payload

ParameterTypeRequiredDescription
roomIdstringYesUnique room ID
namestringYesRoom name shown in the admin panel
aboutstringYesRoom description, used for scheduled rooms
isSpeakbooleanYesEnables voice chat in the room
startTimestringNoRoom start time. Format: 2024-12-31 05:33:32
endTimestringNoRoom end time. Format: 2024-12-31 05:33:32
streamUrlstringNoOptional. External livestream URL (Vimeo, YouTube Live, etc.)

If startTime is provided, the room will be scheduled with the status SOON and will automatically switch to LIVE at the specified time.
If endTime is provided, the room will automatically switch to the status ENDED at the specified time. If streamUrl is provided, an embedded video player will be displayed inside the room on the frontend.

CURL example

curl -X 'POST' \
  'https://chatbackend.watchers.io/external/room' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}' \
  -d '{
  "roomId": "liveevent123",
  "name": "Live Conference",
  "about": "Annual keynote",
  "isSpeak": true,
  "startTime": "2024-06-19T08:00:00.000Z",
  "endTime": "2024-06-19T21:00:00.000Z",
  "streamUrl": "https://player.vimeo.com/video/12345678"
}'

Get room

Endpoint https://chatbackend.watchers.io/external/room/:roomId

GET parameters

ParameterTypeRequiredDescription
roomIdstringYesUnique room ID

CURL example

curl -X 'GET' \
  'https://chatbackend.watchers.io/external/room/321textroom321' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}'

Enable Voice in room

Endpoint https://chatbackend.watchers.io/external/room/speak

Request payload

ParameterTypeRequiredDescription
roomIdstringYesroomid
isSpeakbooleanYesEnables or disables voice in room

CURL example

curl -X 'POST' \
  'https://chatbackend.watchers.io/external/room/speak' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}' \
  -d '{
  "roomId": "321textroom321",
  "isSpeak": false
}'

Change room status

Endpoint https://chatbackend.watchers.io/external/room/status

Request payload

ParameterTypeRequiredDescription
roomIdstringYesRoom ID
statusenumYesOne of: LIVE, SOON, ENDED, DISABLED
streamUrlstringNoOptional. Update external video URL

CURL example

curl -X 'POST' \
  'https://chatbackend.watchers.io/external/room/speak' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}' \
  -d '{
  "roomId": "321textroom321",
  "isSpeak": false,
  "streamUrl": "https://player.vimeo.com/video/87654321"

}'

Delete room

Endpoint https://chatbackend.watchers.io/external/room/:roomId

GET parameters

ParameterTypeRequiredDescription
roomIdstringYesroomid

CURL example

curl -X 'DELETE' \
  'https://chatbackend.watchers.io/external/room/321textroom321' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {Api key of project from admin panel}' \
  -H 'Authorization: Bearer {Bearer token from admin panel}'

What’s Next