v1

latestOpenAPI 3.1.0Apache-2.02026-07-17144068.3 KB
sip

Handler for POST /sip/transfer endpoint

Initiates a SIP REFER transfer for a participant in a LiveKit room. The transfer moves an ongoing SIP call to a different phone number.

Arguments

  • state - Shared application state containing LiveKit handlers
  • auth - Authentication context for room metadata authorization
  • request - Transfer request with room name, participant identity, and destination

Returns

  • Response - JSON response with transfer status or error

Errors

  • 400 Bad Request - Invalid phone number format or empty fields
  • 404 Not Found - Room not found, not accessible, or participant not found
  • 500 Internal Server Error - LiveKit not configured or transfer operation failed

Flow

  1. Validate the phone number format
  2. Check LiveKit handlers are configured
  3. Check room access via metadata auth_id
  4. Verify the participant exists and is a SIP participant
  5. Execute the SIP transfer
  6. Return success or appropriate error
post/sip/transfer

Request body

participant_identitystring required

The identity of the SIP participant to transfer. This can be obtained by listing participants in the room via LiveKit API.

room_namestring required

The LiveKit room name where the SIP participant is connected

transfer_tostring required

The phone number to transfer the call to. Supports international format (+1234567890), national format (07123456789), or internal extensions (1234).

Example request

{
  "participant_identity": "sip_participant_456",
  "room_name": "call-room-123",
  "transfer_to": "+15551234567"
}

Response

Transfer initiated successfully

participant_identitystring required

The identity of the participant being transferred

room_namestring required

The room name where the transfer was initiated

statusstring required

Status of the transfer request ("initiated" or "completed")

transfer_tostring required

The normalized phone number with tel: prefix

Example response

{
  "participant_identity": "sip_participant_456",
  "room_name": "call-room-123",
  "status": "initiated",
  "transfer_to": "tel:+15551234567"
}