MiroTalk LK HTTP API
| Method | Path | Description |
|---|---|---|
POST |
/api/token |
Body { "name", "room", "password"?, "hostKey"?, "identity"? } → { token, url, identity, name, room, isHost, locked, attendee, e2ee, recording, streaming, clientRecording, recordingUploads, captions, whiteboard, hostKey? } (attendee: joined a webinar view-only, without publish rights; e2ee: the meeting is end-to-end encrypted, so recording, streaming and captions are false; recording: the server records; streaming: hosts may stream the meeting live; clientRecording / recordingUploads: hosts may record in their browser / upload it; whiteboard: hosts may open the whiteboard). identity (the tab's previous session) lets the host resume it, and lets anyone try again while their last token's session hasn't connected yet (they keep that identity). 401/403 with code: PASSWORD_REQUIRED/PASSWORD_INVALID for locked rooms, 403 with code: MEETING_NOT_STARTED when host sign-in is enabled and no host is in the meeting, 409 with code: NAME_TAKEN when the name is already in the meeting, or was given to someone else in the last 30 seconds who hasn't connected yet, 403 with code: ROOM_FULL when the meeting has reached LiveKit's room.max_participants (agents and recorders don't count). With the waiting room on, guests get 202 { waiting: true, knock, e2ee } instead and poll /api/knock. waitingRoom: true turns the waiting room on, webinar: true turns webinar mode on and moderation (the settings of /api/host/moderation that are on, e.g. { "chatOff": true }) sets the moderation settings and e2ee: true makes it end-to-end encrypted (the key never leaves the browser) when starting a new meeting |
GET |
/api/rooms/:room |
{ started } – whether guests can join now (polled by waiting guests) |
POST |
/api/connection-check |
{ url, token } for the lobby's network check: a short-lived token that may only publish a camera track in a throwaway netcheck.* room of its own |
POST |
/api/knock |
Body { "knock" } → { status: "waiting" }, or the /api/token response with status: "admitted" once the host lets the guest in (single use). 403 KNOCK_DENIED when turned away or the meeting ended, 404 KNOCK_EXPIRED when unknown |
POST |
/api/knock/cancel |
Body { "knock" } – stop waiting |
GET |
/api/auth |
Host sign-in status → { enabled, user, password, sso } (password: HOST_USERS sign-in is available; sso: the single sign-on provider's name or null) |
POST |
/api/auth/login |
Body { "username", "password" } → { user } and a session cookie (404 unless HOST_USERS is set) |
POST |
/api/auth/logout |
Clear the host session cookie |
GET |
/api/auth/oidc/login |
Single sign-on: ?returnTo=<path> → redirect to the OIDC provider (404 unless OIDC_ISSUER is set) |
GET |
/api/auth/oidc/callback |
The provider redirects back here → session cookie and redirect to returnTo (with ?sso_error=failed or notAllowed if sign-in didn't work) |
POST |
/api/host/mute |
Host or co-host. Body { "identity" } – mute a participant's microphone |
POST |
/api/host/camera-off |
Host or co-host. Body { "identity" } – turn off a participant's camera → { stopped } |
POST |
/api/host/mute-all |
Host or co-host. Mute every other participant's microphone → { muted } |
POST |
/api/host/camera-off-all |
Host or co-host. Turn off every other participant's camera → { stopped } |
POST |
/api/host/lower-hand |
Host or co-host. Body { "identity" } – lower a participant's raised hand → { lowered } |
POST |
/api/host/kick |
Host or co-host. Body { "identity" } – remove a participant |
POST |
/api/host/kick-all |
Host or co-host. Remove every other participant (co-hosts keep the host and other co-hosts) → { removed } |
POST |
/api/host/cohost |
Host only. Body { "identity", "enabled": true \| false } – make someone co-host or take it back |
POST |
/api/host/transfer |
Host only. Body { "identity" } – hand the host role over; you become a regular participant and your host key stops working |
POST |
/api/host/host-key |
Host only. A new host key ({ hostKey }) for a browser that was handed the host role, so it stays host after a refresh; replaces the previous key |
POST |
/api/host/end |
Host only. End the meeting: disconnect everyone and close the room |
POST |
/api/host/lock |
Host or co-host. Body { "password" } – set (4-64 chars) or clear ("") the room password |
POST |
/api/host/waiting-room |
Host or co-host. Body { "enabled": true \| false } – turn the waiting room on or off (off lets everyone waiting in) → { enabled, admitted } |
POST |
/api/host/moderation |
Host or co-host. Body: one or more of { "joinMuted", "joinCameraOff", "screenShareHostsOnly", "chatOff", "privateChatOff", "annotateHostsOnly", "whiteboardHostsOnly" } (booleans) – change the moderation settings → { moderation } with all of them. Turning screenShareHostsOnly on stops other participants' screen shares |
POST |
/api/host/spotlight |
Host or co-host. Body { "identity", "type": "camera" \| "screen" } (type defaults to "camera") – put that person's camera or screen share (yours included) in the spotlight for everyone; { "identity": null } clears it → { spotlight } ({ identity, type } or null) |
POST |
/api/host/whiteboard |
Host or co-host. Body { "enabled": true \| false } – open the whiteboard for everyone or close it (kept in the room metadata as wb) → { open } (503 if the whiteboard is disabled) |
POST |
/api/host/webinar |
Host or co-host. Body { "enabled": true \| false } – turn webinar mode on or off (kept in the room metadata as web; people who join while it's on are attendees; off brings every attendee on stage) → { enabled, onStage } (how many were brought on stage) |
POST |
/api/host/stage |
Host or co-host. Body { "identity", "onStage": true \| false } – bring an attendee on stage (lowers their hand, grants publishing) or move someone back to the audience (409 for hosts and co-hosts, or while webinar mode is off) → { onStage, changed } |
GET |
/api/host/waiting |
Host or co-host. People in the waiting room → { waiting: [{ id, name, since }] } |
POST |
/api/host/admit |
Host or co-host. Body { "id" } – let someone in (409 NAME_TAKEN if their name was taken meanwhile; they're told so. 403 ROOM_FULL if the meeting is full; they keep waiting) |
POST |
/api/host/admit-all |
Host or co-host. Let everyone waiting in → { admitted } |
POST |
/api/host/deny |
Host or co-host. Body { "id" } – turn someone away |
POST |
/api/host/recording/start |
Host or co-host. Start recording the meeting (409 if already recording or the meeting is end-to-end encrypted, 503 if recording is disabled or egress is unavailable) |
POST |
/api/host/recording/stop |
Host or co-host. Stop the recording; the file is finalized and saved |
POST |
/api/host/recording/client/start |
Host or co-host. Body { "mode": "local" \| "stream" \| "after", "mimeType" } – you start recording in your browser; everyone is told through the room metadata (rec) → { id } (the recording) and, for stream / after, upload: { id, token, chunkBytes, maxBytes }, an upload only you can use (409 if anything already records, 503 if in-browser recording or uploads are disabled, 400 for a format other than WebM / MP4) |
POST |
/api/host/recording/client/stop |
The person recording, or a host or co-host (whose stop is sent to the recording browser). Body { "id" } – clears that in-browser recording (409 if it isn't the one in progress, so a late request can't end a newer one) |
POST |
/api/host/stream/start |
Host or co-host. Body { "url", "key" }: the platform's rtmp:// or rtmps:// URL and the stream key (added as the URL's last part), or { "url" } with the key in it. Starts streaming the meeting live → { egressId, active } once egress streams. Neither is logged or kept. 400 for an invalid URL or key or a host that can't be found, 403 for a host that isn't allowed (this server, private networks, or not in STREAMING_ALLOWED_HOSTS), 409 if already streaming or the meeting is end-to-end encrypted, 502 if the stream failed to start, 503 if streaming is disabled or egress is unavailable |
POST |
/api/host/stream/stop |
Host or co-host. End the live stream (the meeting goes on) → { stopped }: how many streams were stopped (0 when only a LIVE badge left by a stream that ended unnoticed was cleared). 409 if not streaming |
PUT |
/api/recordings/:id/chunks/:n |
Authorization: Bearer <upload token>, application/octet-stream body (≤ 16 MB). Appends piece n (from 0) → { next, bytes }. A piece sent again is accepted without being written twice; one that skips ahead gets 409 { next }. 413 over CLIENT_RECORDING_MAX_MB |
POST |
/api/recordings/:id/finish |
Upload token. Body { "chunks" } (how many pieces were sent; 409 { next } if some are missing) – saves the file (asking again, e.g. after a lost answer, gives the same answer) → { file, location, storage: "local" \| "s3", size } |
DELETE |
/api/recordings/:id |
Upload token. Cancels the upload and deletes what was received |
POST |
/api/host/captions/start |
Host or co-host. Turn live captions on: dispatches the captions agent and answers once it's in the meeting (409 if already on or the meeting is end-to-end encrypted, 503 if captions are disabled or no agent is running) |
POST |
/api/host/captions/stop |
Host or co-host. Turn live captions off: the captions agent leaves (409 if they're off) |
POST |
/api/hand |
Any participant. Body { "raised": true \| false } – raise or lower your own hand |
POST |
/api/webhooks/livekit |
LiveKit webhook receiver (signed with the LiveKit API key, 401 otherwise); forwards room and recording events to WEBHOOK_URLS |
GET |
/healthz |
Liveness: { status: "ok", uptime } while the process is up (Docker healthcheck) |
GET |
/readyz |
Readiness for load balancers: 200 { status: "ok", livekit: "up" }, or 503 when the LiveKit server API is unreachable (checked at most every 5 s). With SCALING_MODE=distributed also redis: "up", and 503 while Redis is unreachable |
GET |
/metrics |
Prometheus metrics (404 unless METRICS_ENABLED; 401 without Authorization: Bearer <METRICS_TOKEN> when that is set). See Monitoring |
Host endpoints require Authorization: Bearer <caller's LiveKit token> and that the caller is in the meeting with the right role (the server-set role participant attribute: host or cohost; webinar attendees have the server-set attendee attribute instead, until they're brought on stage); /api/hand takes the caller's own LiveKit token the same way. Hosts and co-hosts are told about changes to the waiting room with a LiveKit data message (mirotalk-lk.host topic, type: "waiting") sent only to them. Room names: 1–64 chars of A-Z a-z 0-9 - _. Display names are sanitized and limited to 32 chars.
Every /api answer has an X-Request-Id header (a proxy's own X-Request-Id is kept); it's in the request log too. Errors are JSON { error, code? }, plus requestId for unexpected server errors (500). error is a message for people, in the language of the request's Accept-Language header (one of the supported languages, English otherwise; the browser client sends its UI language). code (e.g. PASSWORD_REQUIRED) is the same in every language, so match on it, never on error. Data messages, webhooks and LiveKit signaling carry no translated text.