Import a phone number from a provider (Twilio or LiveKit SIP).
For Twilio numbers, you must first create a Twilio integration and provide its ID.
For SIP numbers, LiveKit trunks are automatically created.
Your API key for authentication.
Must be application/json.
Permissions
phone_numbers:create (admin, agent_manager)
Request Body
Phone number in E.164 format (e.g., +12345678900).
Provider type: twilio or sip.
Whether the number supports inbound calls.
Whether the number supports outbound calls.
Twilio-Specific Parameters
Integration ID (required for Twilio provider). Must be a valid Twilio integration.
SIP-Specific Parameters (LiveKit)
SIP username for authentication.
SIP password for authentication.
SIP server address (required for outbound).
Room name pattern for inbound calls.
Optional PIN for inbound calls (4-10 characters).
SIP media encryption mode: disable, allow, or require.
Response
Indicates if the import was successful.
Human-readable success message.
The created phone number object.
{
"phone_number": "+15551234567",
"provider": "twilio",
"supports_inbound": true,
"supports_outbound": true,
"integration_id": "intg_a1b2c3d4e5f6"
}
{
"phone_number": "+15559876543",
"provider": "sip",
"supports_inbound": true,
"supports_outbound": true,
"sip_trunk_name": "my-trunk",
"sip_server_address": "sip.example.com",
"sip_username": "user",
"sip_password": "pass",
"media_encryption": "require"
}
{
"success": true,
"message": "Phone number imported successfully with twilio",
"data": {
"phone_number_id": "phon_a1b2c3d4e5f6",
"phone_number": "+15551234567",
"provider": "twilio",
"status": "free",
"supports_inbound": true,
"supports_outbound": true,
"integration_id": "intg_a1b2c3d4e5f6",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
Errors
Missing required fields or invalid provider.
Integration not found (for Twilio).
Integration belongs to different organization.
Phone number already exists in the system.