Skip to main content
POST
/
user
/
phone-numbers
/
sip-trunks
Create SIP trunk
curl --request POST \
  --url https://app.autocalls.ai/api/user/phone-numbers/sip-trunks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sip_trunk_type": "<string>",
  "phone_number": "<string>",
  "sip_username": "<string>",
  "sip_password": "<string>",
  "sip_address": "<string>",
  "sip_calling_format": "<string>",
  "inbound_authorization_type": "<string>",
  "allowed_inbound_ips": [
    {}
  ],
  "country_code": "<string>",
  "outbound_proxy": true
}
'
{
  "message": "SIP trunk created successfully.",
  "data": {
    "id": 42,
    "phone_number": "1000",
    "sip_username": "myuser",
    "sip_address": "sip.provider.com",
    "sip_calling_format": "+e164",
    "inbound_authorization_type": "auth",
    "allowed_inbound_ips": null,
    "outbound_proxy": false,
    "country_code": "US",
    "inbound_trunk_id": "ST_xxxxxxxxxxxx",
    "outbound_trunk_id": "ST_yyyyyyyyyyyy",
    "created_at": "2026-03-31T10:00:00.000000Z",
    "updated_at": "2026-03-31T10:00:00.000000Z"
  }
}
This endpoint creates a new SIP trunk. The platform automatically provisions inbound and outbound trunks on the voice infrastructure using the provided credentials.

Body Parameters

sip_trunk_type
string
required
The type of SIP trunk: extension for a SIP extension, or number for a phone number (DID). This determines the expected format of the phone_number field.
phone_number
string
required
The SIP extension (1-15 characters, e.g. 1000) when sip_trunk_type is extension, or a phone number in E.164 format (e.g. +14155551234) when sip_trunk_type is number.
sip_username
string
required
Username for SIP authentication (3-128 characters)
sip_password
string
required
Password for SIP authentication (minimum 3 characters)
sip_address
string
required
The SIP server address without port (e.g. sip.provider.com)
sip_calling_format
string
required
The outbound calling number format:
  • +e164 — International with + prefix (e.g. +12025550123)
  • e164 — International without + prefix (e.g. 12025550123)
  • national — National format without country code (e.g. 0741926265)
inbound_authorization_type
string
required
How inbound calls are authenticated:
  • auth — Uses the same SIP username and password configured for outbound
  • ip — Whitelists specific IP addresses (requires allowed_inbound_ips)
allowed_inbound_ips
array
Array of IP addresses allowed to send inbound calls. Required when inbound_authorization_type is ip. Must contain at least one valid IP address.
country_code
string
required
ISO 3166-2 country code where the SIP trunk is located (e.g. US, GB, DE). When sip_trunk_type is number, the country is auto-detected from the phone number if possible.
outbound_proxy
boolean
Route outbound calls through a fixed IP address. Default: false. Only enable this if your SIP provider requires IP-based authentication for outbound traffic.

Response

message
string
Success message
data
object
The created SIP trunk object (same fields as Get SIP trunk)
{
  "message": "SIP trunk created successfully.",
  "data": {
    "id": 42,
    "phone_number": "1000",
    "sip_username": "myuser",
    "sip_address": "sip.provider.com",
    "sip_calling_format": "+e164",
    "inbound_authorization_type": "auth",
    "allowed_inbound_ips": null,
    "outbound_proxy": false,
    "country_code": "US",
    "inbound_trunk_id": "ST_xxxxxxxxxxxx",
    "outbound_trunk_id": "ST_yyyyyyyyyyyy",
    "created_at": "2026-03-31T10:00:00.000000Z",
    "updated_at": "2026-03-31T10:00:00.000000Z"
  }
}

What happens after creation

When you create a SIP trunk, the platform automatically:
  1. Provisions an inbound trunk on the voice infrastructure — using either username/password or IP-based authentication depending on your inbound_authorization_type setting
  2. Provisions an outbound trunk — using the SIP address and credentials you provided, optionally through the outbound proxy
If provisioning fails, the SIP trunk is not saved and a 500 error is returned.

Next steps

After creating a SIP trunk, assign it to an AI assistant: