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"
}
Your API key (format: sk_...)
Your API secret (format: s3cr3t_...)
Request Body
Descriptive name for the SIP trunkExample: "Main Office SIP Trunk"
Phone number in E.164 formatExample: "+15551234567"Must be a valid E.164 formatted phone number.
Outbound PSTN gateway address for making outbound callsExample: "sip.gateway.com"This is your SIP provider’s gateway server address.
SIP authentication username provided by your SIP providerExample: "sip_user"
SIP authentication password provided by your SIP providerExample: "sip_password"Store SIP credentials securely. They are used for SIP trunk authentication.
Response Fields
The inbound trunk ID created by LiveKitFormat: TK... (LiveKit trunk identifier)
What Gets Created
This endpoint creates:
- Inbound SIP Trunk: For receiving incoming calls
- Outbound SIP Trunk: For making outgoing calls
- Dispatch Rule: For routing incoming calls to agents
- Phone Number Record: Stored in your organization’s phone numbers
Error Responses
Bad Request - Missing organization ID or validation error{
"message": "No Org ID found",
"status": "success",
"error": null,
"data": null
}
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