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.
state - Shared application state containing LiveKit configurationauth - Authentication context from middlewarerequest - Request with room name and participant identityResponse - JSON response with removal status or errorauth.id is present: Requires room.metadata.auth_id == auth.idauth.id is absent: Access is allowed (backward-compatible mode)metadata.auth_id check.
| Mode | Behavior |
|---|---|
Authenticated (auth.id present) | Requires room.metadata.auth_id == auth.id. |
Unauthenticated (auth.id absent) | Access is allowed (backward-compatible mode). |
room_name and participant_identity in the request body.
| Status | Condition |
|---|---|
400 Bad Request | Empty room name or participant identity. |
404 Not Found | Room/participant not found or access denied (masked for security). |
500 Internal Server Error | LiveKit not configured or removal failed. |
JWT token obtained from the authentication service. Required when AUTH_REQUIRED is enabled.
Request body for removing a participant from a LiveKit room
{
"room_name": "conversation-room-123",
"participant_identity": "user-alice-456"
}Participant removed successfully
Response for a successful participant removal
{
"status": "removed",
"room_name": "conversation-room-123",
"participant_identity": "user-alice-456"
}