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.
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
https://api.relay.welbuiltai.tech/v1/roomsPre-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
| Field | Type | Description |
|---|---|---|
namerequired | string | Room 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. |
maxParticipantsoptional | number | Maximum number of participants allowed in the room. Positive integer, up to 10000. |
emptyTimeoutoptional | number | Seconds to keep the room alive after the last participant leaves. Positive integer, up to 86400 (24 hours). |
metadataoptional | string | Optional opaque string attached to the room (max 4096 characters). |
Example request
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:
{
"room": "my-room",
"sid": "RM_xxxxxxxxxxxx",
"numParticipants": 0,
"maxParticipants": 50,
"creationTime": 1718800000,
"metadata": "{\"topic\":\"standup\"}"
}| Field | Type | Description |
|---|---|---|
roomrequired | string | Your display name for the room — the internal project prefix is stripped. |
sidrequired | string | LiveKit session ID for the room. |
numParticipantsrequired | number | Current number of participants connected to the room. |
maxParticipantsrequired | number | Configured participant cap (0 means unlimited). |
creationTimerequired | number | Unix timestamp (seconds) when the room was created. |
metadatarequired | string | The room metadata string (empty if none was set). |
List active rooms
https://api.relay.welbuiltai.tech/v1/roomsReturns every active room in your project.
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):
{
"rooms": [
{
"room": "my-room",
"sid": "RM_xxxxxxxxxxxx",
"numParticipants": 3,
"maxParticipants": 50,
"creationTime": 1718800000,
"metadata": ""
}
]
}Inspect a room
https://api.relay.welbuiltai.tech/v1/rooms/:nameReturns a single room plus the list of participants currently connected. Responds 404 not_found if the room does not exist in your project.
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:
{
"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
| Field | Type | Description |
|---|---|---|
identityrequired | string | Unique identity of the participant. |
namerequired | string | Display name of the participant. |
staterequired | number | LiveKit connection state (0 = JOINING, 1 = JOINED, 2 = ACTIVE, 3 = DISCONNECTED). |
joinedAtrequired | number | Unix timestamp (seconds) when the participant joined. |
tracksrequired | number | Number of tracks the participant is currently publishing. |
End a room
https://api.relay.welbuiltai.tech/v1/rooms/:nameEnds the room and disconnects everyone in it. This is idempotent — deleting a room that no longer exists still succeeds.
curl -X DELETE https://api.relay.welbuiltai.tech/v1/rooms/my-room \
-H "Authorization: Bearer sk_live_..."{
"ended": true
}Remove a participant
https://api.relay.welbuiltai.tech/v1/rooms/:name/participants/:identityForcibly disconnects a single participant (by their identity) from a room. Responds 404 not_found if the participant is not in the room.
curl -X DELETE \
https://api.relay.welbuiltai.tech/v1/rooms/my-room/participants/user-123 \
-H "Authorization: Bearer sk_live_..."{
"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.
{
"error": {
"type": "not_found",
"code": "not_found",
"message": "Room not found"
}
}