Create a trunk
trunk_createCreate a new trunk group with authentication mode and per-direction capacity limits. Capacity of 0 disables inbound or outbound calls.
Instructions
Create a new trunk group on your account. Enforces your account's allowed number-classes and per-direction capacity ceilings (check acct_get_capacity first). Note: a capacity of 0 means 'direction disabled' — calls in that direction are rejected with 503 + Retry-After. Errors: NO_ACTIVE_CUSTOMER, INVALID_PAYLOAD, VALIDATION_ERROR, INTERNAL_ERROR.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Trunk name (required) | |
| auth_type | Yes | Authentication mode: IP_ACL (source-IP allowlist), DIGEST (SIP username/password), EITHER, or BOTH | |
| sip_config | No | SIP config object persisted as JSONB (e.g. { codecs: [...], dtmf_mode: '...' }). The customer portal only writes codecs and dtmf_mode; other keys are admin-surface. | |
| description | No | Free-text description of the trunk | |
| capacity_cps_inbound | No | Max inbound calls-per-second. 0 is valid and means the direction is disabled (runtime gate returns 503 + Retry-After) | |
| capacity_cps_outbound | No | Max outbound calls-per-second; 0 disables outbound | |
| allowed_number_classes | No | Number classes this trunk may carry (must be within the account's allowed classes) | |
| capacity_channels_inbound | No | Max concurrent inbound channels; 0 disables inbound | |
| capacity_channels_outbound | No | Max concurrent outbound channels; 0 disables outbound |