v1
latestOpenAPI 3.1.0Apache-2.02026-07-17144068.3 KBlivekit
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
- Validate request fields are not empty
- Check room access via metadata.auth_id
- Verify participant exists in the room
- Remove the participant
- Return success or appropriate error
delete/livekit/participant
Request body
Example request
{
"participant_identity": "user-alice-456",
"room_name": "conversation-room-123"
}Response
Participant removed successfully
Example response
{
"participant_identity": "user-alice-456",
"room_name": "conversation-room-123",
"status": "removed"
}