v1

latestOpenAPI 3.1.0Apache-2.02026-07-17144068.3 KB
livekit

Handler for DELETE /livekit/participant endpoint

Removes a participant from a LiveKit room, forcibly disconnecting them. Access is authorized via metadata.auth_id check.

Note: This does not invalidate the participant's token. To prevent rejoining, use short-lived tokens and avoid issuing new tokens to removed participants.

Arguments

  • state - Shared application state containing LiveKit configuration
  • auth - Authentication context from middleware
  • request - Request with room name and participant identity

Returns

  • Response - JSON response with removal status or error

Authorization

  • When auth.id is present: Requires room.metadata.auth_id == auth.id
  • When auth.id is absent: Access is allowed (backward-compatible mode)

Errors

  • 400 Bad Request - Empty room name or participant identity
  • 404 Not Found - Room/participant not found or access denied (masked)
  • 500 Internal Server Error - LiveKit not configured or removal failed

Flow

  1. Validate request fields are not empty
  2. Check room access via metadata.auth_id
  3. Verify participant exists in the room
  4. Remove the participant
  5. Return success or appropriate error
delete/livekit/participant

Request body

participant_identitystring required

The identity of the participant to remove

room_namestring required

The LiveKit room name where the participant is connected

Example request

{
  "participant_identity": "user-alice-456",
  "room_name": "conversation-room-123"
}

Response

Participant removed successfully

participant_identitystring required

The identity of the removed participant

room_namestring required

The room name

statusstring required

Status of the removal operation

Example response

{
  "participant_identity": "user-alice-456",
  "room_name": "conversation-room-123",
  "status": "removed"
}