Skip to main content
POST
/
api
/
sio
/
createSipTrunkDispatch
curl -X POST "https://api.zudu.ai/api/sio/createSipTrunkDispatch" \
  -H "X-API-KEY: sk_Abc123Def456..." \
  -H "X-API-SECRET: s3cr3t_Xyz789..." \
  -d '{
    "name": "Main Office SIP Trunk",
    "number": "+15551234567",
    "outboundPstn": "sip.gateway.com",
    "authUserName": "sip_user",
    "authPassword": "sip_password"
  }'
{
  "message": "Phone number created successfully",
  "status": "success",
  "error": null,
  "data": "TK1234567890abcdef1234567890abcdef"
}
Create a complete SIP trunk setup including inbound trunk, outbound trunk, dispatch rule, and phone number record in a single operation.
curl -X POST "https://api.zudu.ai/api/sio/createSipTrunkDispatch" \
  -H "X-API-KEY: sk_Abc123Def456..." \
  -H "X-API-SECRET: s3cr3t_Xyz789..." \
  -d '{
    "name": "Main Office SIP Trunk",
    "number": "+15551234567",
    "outboundPstn": "sip.gateway.com",
    "authUserName": "sip_user",
    "authPassword": "sip_password"
  }'
{
  "message": "Phone number created successfully",
  "status": "success",
  "error": null,
  "data": "TK1234567890abcdef1234567890abcdef"
}

Headers

X-API-KEY
string
required
Your API key (format: sk_...)
X-API-SECRET
string
required
Your API secret (format: s3cr3t_...)

Request Body

name
string
required
Descriptive name for the SIP trunkExample: "Main Office SIP Trunk"
number
string
required
Phone number in E.164 formatExample: "+15551234567"Must be a valid E.164 formatted phone number.
outboundPstn
string
required
Outbound PSTN gateway address for making outbound callsExample: "sip.gateway.com"This is your SIP provider’s gateway server address.
authUserName
string
required
SIP authentication username provided by your SIP providerExample: "sip_user"
authPassword
string
required
SIP authentication password provided by your SIP providerExample: "sip_password"
Store SIP credentials securely. They are used for SIP trunk authentication.

Response Fields

data
string
The inbound trunk ID created by LiveKitFormat: TK... (LiveKit trunk identifier)

What Gets Created

This endpoint creates:
  1. Inbound SIP Trunk: For receiving incoming calls
  2. Outbound SIP Trunk: For making outgoing calls
  3. Dispatch Rule: For routing incoming calls to agents
  4. Phone Number Record: Stored in your organization’s phone numbers

Error Responses

error
string
Bad Request - Missing organization ID or validation error
{
  "message": "No Org ID found",
  "status": "success",
  "error": null,
  "data": null
}
error
string
Internal Server Error - SIP trunk creation failed
{
  "message": "Error occurred while creating inboundtrunk",
  "status": "error",
  "error": null,
  "data": null
}

Notes

  • Phone number must be in E.164 format (e.g., +15551234567)
  • SIP credentials are provided by your SIP provider
  • The organization ID is automatically extracted from your API key
  • All components (inbound trunk, outbound trunk, dispatch rule) are created atomically
  • If any component fails to create, the operation fails