Rooms

Programmatically create, list, inspect, and end rooms — and remove participants from them. Every room you manage is scoped to your project: you only ever see and act on your own rooms.

Authentication & scoping

All Rooms endpoints require your secret key as a Bearer token. Secret keys must only be used server-side.

HTTP header
Authorization: Bearer sk_live_...

The room name you send is automatically namespaced to your project internally (as p_<projectId>__<name>), but every response returns your original display name with that prefix stripped. Listing only ever returns rooms in your own project, and named operations are confined to your namespace — there is no way to see or affect another project's rooms.

Create a room

POSThttps://api.relay.welbuiltai.tech/v1/rooms

Pre-create a room (optionally configuring limits and metadata) before anyone joins. Rooms are also created on demand when the first participant connects with a token, so this call is optional.

Request body

FieldTypeDescription
name
required
stringRoom name. Allowed characters are letters, digits, and . _ - :, up to 128 characters. The name is automatically namespaced to your project; the value you send here is the display name returned in every response.
maxParticipants
optional
numberMaximum number of participants allowed in the room. Positive integer, up to 10000.
emptyTimeout
optional
numberSeconds to keep the room alive after the last participant leaves. Positive integer, up to 86400 (24 hours).
metadata
optional
stringOptional opaque string attached to the room (max 4096 characters).

Example request

curl
curl https://api.relay.welbuiltai.tech/v1/rooms \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-room",
    "maxParticipants": 50,
    "emptyTimeout": 600,
    "metadata": "{\"topic\":\"standup\"}"
  }'

Response

A 201 Created response returns the room object:

201 Created
{
  "room": "my-room",
  "sid": "RM_xxxxxxxxxxxx",
  "numParticipants": 0,
  "maxParticipants": 50,
  "creationTime": 1718800000,
  "metadata": "{\"topic\":\"standup\"}"
}
FieldTypeDescription
room
required
stringYour display name for the room — the internal project prefix is stripped.
sid
required
stringLiveKit session ID for the room.
numParticipants
required
numberCurrent number of participants connected to the room.
maxParticipants
required
numberConfigured participant cap (0 means unlimited).
creationTime
required
numberUnix timestamp (seconds) when the room was created.
metadata
required
stringThe room metadata string (empty if none was set).

List active rooms

GEThttps://api.relay.welbuiltai.tech/v1/rooms

Returns every active room in your project.

curl
curl https://api.relay.welbuiltai.tech/v1/rooms \
  -H "Authorization: Bearer sk_live_..."

A 200 OK response wraps the rooms in a rooms array (each entry has the same shape as the create response):

200 OK
{
  "rooms": [
    {
      "room": "my-room",
      "sid": "RM_xxxxxxxxxxxx",
      "numParticipants": 3,
      "maxParticipants": 50,
      "creationTime": 1718800000,
      "metadata": ""
    }
  ]
}

Inspect a room

GEThttps://api.relay.welbuiltai.tech/v1/rooms/:name

Returns a single room plus the list of participants currently connected. Responds 404 not_found if the room does not exist in your project.

curl
curl https://api.relay.welbuiltai.tech/v1/rooms/my-room \
  -H "Authorization: Bearer sk_live_..."

A 200 OK response includes a participants array alongside the room fields:

200 OK
{
  "room": "my-room",
  "sid": "RM_xxxxxxxxxxxx",
  "numParticipants": 1,
  "maxParticipants": 50,
  "creationTime": 1718800000,
  "metadata": "",
  "participants": [
    {
      "identity": "user-123",
      "name": "Ada Lovelace",
      "state": 2,
      "joinedAt": 1718800050,
      "tracks": 2
    }
  ]
}

Participant fields

FieldTypeDescription
identity
required
stringUnique identity of the participant.
name
required
stringDisplay name of the participant.
state
required
numberLiveKit connection state (0 = JOINING, 1 = JOINED, 2 = ACTIVE, 3 = DISCONNECTED).
joinedAt
required
numberUnix timestamp (seconds) when the participant joined.
tracks
required
numberNumber of tracks the participant is currently publishing.

End a room

DELETEhttps://api.relay.welbuiltai.tech/v1/rooms/:name

Ends the room and disconnects everyone in it. This is idempotent — deleting a room that no longer exists still succeeds.

curl
curl -X DELETE https://api.relay.welbuiltai.tech/v1/rooms/my-room \
  -H "Authorization: Bearer sk_live_..."
200 OK
{
  "ended": true
}

Remove a participant

DELETEhttps://api.relay.welbuiltai.tech/v1/rooms/:name/participants/:identity

Forcibly disconnects a single participant (by their identity) from a room. Responds 404 not_found if the participant is not in the room.

curl
curl -X DELETE \
  https://api.relay.welbuiltai.tech/v1/rooms/my-room/participants/user-123 \
  -H "Authorization: Bearer sk_live_..."
200 OK
{
  "removed": true
}

Errors

  • 401 unauthorized — the API key is missing, invalid, or revoked.
  • 422 validation_error / invalid_request — the request body or a path parameter (room name) failed validation.
  • 404 not_found — the room (on inspect) or participant (on remove) does not exist in your project.
  • 502 livekit_error — the upstream realtime service returned an error.
404 Not Found
{
  "error": {
    "type": "not_found",
    "code": "not_found",
    "message": "Room not found"
  }
}