> ## Documentation Index
> Fetch the complete documentation index at: https://www.vobiz.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Trunk

> Provision a new Vobiz SIP trunk with concurrent-call limits, CPS caps, TLS/SRTP, credentials, IP ACLs, and origination URIs - all in a single API call.

```http theme={null}
POST https://api.vobiz.ai/api/v1/Account/{auth_id}/trunks
```

Use this endpoint to create a new SIP trunk for handling voice traffic. Each trunk can be configured with rate limits, authentication methods (credentials and IP ACLs), and origination URIs for outbound routing.

The request takes three fields: a name, a direction, and a concurrent-call limit. Vobiz returns the new [Trunk object](https://www.vobiz.ai/docs/trunks/trunk-object.md) with its `trunk_id` and an auto-generated SIP domain. Authentication and routing are added afterwards with their own endpoints.

## When to use it

* **Connect a PBX, SBC, or carrier** to Vobiz over SIP for inbound or outbound calling.
* **Give an AI voice agent its own trunk** so its call limits are separate from your other traffic.
* **Separate environments or customers** onto their own trunks, each with its own `concurrent_calls_limit`.

> [!NOTE]
>
> **Authentication required:**
>
> * `X-Auth-ID` - Your account Auth ID
> * `X-Auth-Token` - Your account Auth Token
> * `Content-Type: application/json`

> [!NOTE]
>
> **Auto-Generated Domain:** Upon creation, Vobiz automatically generates a unique SIP domain for your trunk in the format: `trunk_id.sip.vobiz.ai`. This domain is used for routing inbound calls to your trunk.

## Request Parameters

Only three fields are required to create a trunk. The rest of the trunk's configuration - transport, TLS/SRTP, recording, attached credentials, IP ACLs, and origination URIs - is applied afterwards through the dedicated endpoints or the Console.

| Field | Type | Required | Description |
| - | - | - | - |
| `name` | string | Yes | Descriptive name for the trunk. Maximum 255 characters. |
| `trunk_type` | string | Yes | Trunk direction. One of `INBOUND` or `OUTBOUND` (uppercase). Determines how the trunk routes traffic. |
| `max_concurrent_calls` | integer | Yes | Maximum number of simultaneous calls. Returned on the trunk object as `concurrent_calls_limit`. |

### Request headers

| Header | Value |
| - | - |
| `X-Auth-ID` | Your account Auth ID |
| `X-Auth-Token` | Your account Auth Token |
| `Content-Type` | `application/json` |

### Trunk direction

`trunk_type` is sent in uppercase. The trunk object reports the direction in lowercase as `trunk_direction`, and carries different routing fields for each direction.

| `trunk_type` | `trunk_direction` on the trunk object | Direction-specific fields on the trunk object |
| - | - | - |
| `OUTBOUND` | `outbound` | `credential_uuid`, the credential attached to the trunk |
| `INBOUND` | `inbound` | `primary_uri_uuid` (the primary origination URI) and `inbound_destination` |

> [!NOTE]
>
> **Defaults applied at creation.** New trunks come back with `cps_limit: 2`, `secure: false`, `transport: udp`, and `trunk_status: active`. The `trunk_domain` is auto-generated as `{trunk_id}.sip.vobiz.ai`. Tune limits later with [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md), and attach auth and routing with [Credentials](https://www.vobiz.ai/docs/trunks/credentials/create-credential.md), [IP ACLs](https://www.vobiz.ai/docs/trunks/ip-acl/create-ip-acl.md), and [Origination URIs](https://www.vobiz.ai/docs/trunks/origination-uri/create-origination-uri.md).

### Defaults applied at creation

| Field | Value on a new trunk | Change it with |
| - | - | - |
| `cps_limit` | `2` | [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md) |
| `secure` | `false` | [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md) |
| `transport` | `udp` | [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md) |
| `trunk_status` | `active` | [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md) |
| `trunk_domain` | `{trunk_id}.sip.vobiz.ai` | Generated by Vobiz |
| `concurrent_calls_limit` | The `max_concurrent_calls` you sent | [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md) |

> [!TIP]
>
> **`cps_limit` vs `concurrent_calls_limit`.** `cps_limit` caps how many new calls can be **started per second** (flood protection); `concurrent_calls_limit` caps how many calls can be **live at once** (capacity and cost control). They are independent.

| Limit | What it caps | Purpose | Set it with |
| - | - | - | - |
| `cps_limit` | New calls started per second | Flood protection | [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md) |
| `concurrent_calls_limit` | Calls live at the same time | Capacity and cost control | `max_concurrent_calls` here, or [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md) |

## Examples

```bash cURL theme={null}
curl -X POST https://api.vobiz.ai/api/v1/Account/AUTH_ID/trunks \
  -H "X-Auth-ID: AUTH_ID" \
  -H "X-Auth-Token: AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My SIP Trunk",
    "trunk_type": "OUTBOUND",
    "max_concurrent_calls": 10
  }'
```

```javascript Node.js theme={null}
const response = await fetch(
  'https://api.vobiz.ai/api/v1/Account/AUTH_ID/trunks',
  {
    method: 'POST',
    headers: {
      'X-Auth-ID': 'AUTH_ID',
      'X-Auth-Token': 'AUTH_TOKEN',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'My SIP Trunk',
      trunk_type: 'OUTBOUND',
      max_concurrent_calls: 10,
    }),
  }
);
const trunk = await response.json();
console.log(trunk.trunk_id);
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.vobiz.ai/api/v1/Account/AUTH_ID/trunks",
    headers={
        "X-Auth-ID": "AUTH_ID",
        "X-Auth-Token": "AUTH_TOKEN",
        "Content-Type": "application/json",
    },
    json={
        "name": "My SIP Trunk",
        "trunk_type": "OUTBOUND",
        "max_concurrent_calls": 10,
    },
)
trunk = response.json()
print(trunk["trunk_id"])
```

```go Go theme={null}
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    body, _ := json.Marshal(map[string]any{
        "name":                 "My SIP Trunk",
        "trunk_type":           "OUTBOUND",
        "max_concurrent_calls": 10,
    })
    req, _ := http.NewRequest("POST",
        "https://api.vobiz.ai/api/v1/Account/AUTH_ID/trunks",
bytes.NewBuffer(body))
    req.Header.Set("X-Auth-ID", "AUTH_ID")
    req.Header.Set("X-Auth-Token", "AUTH_TOKEN")
    req.Header.Set("Content-Type", "application/json")

    resp, _ := (&http.Client{}).Do(req)
    defer resp.Body.Close()
    var trunk map[string]any
    json.NewDecoder(resp.Body).Decode(&trunk)
    fmt.Println(trunk["trunk_id"])
}
```

```ruby Ruby theme={null}
require 'net/http'
require 'uri'
require 'json'

uri = URI('https://api.vobiz.ai/api/v1/Account/AUTH_ID/trunks')
req = Net::HTTP::Post.new(uri)
req['X-Auth-ID'] = 'AUTH_ID'
req['X-Auth-Token'] = 'AUTH_TOKEN'
req['Content-Type'] = 'application/json'
req.body = {
  name: 'My SIP Trunk',
  trunk_type: 'OUTBOUND',
  max_concurrent_calls: 10
}.to_json

res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)['trunk_id']
```

```csharp C# theme={null}
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Auth-ID", "AUTH_ID");
client.DefaultRequestHeaders.Add("X-Auth-Token", "AUTH_TOKEN");

var payload = new StringContent(
    System.Text.Json.JsonSerializer.Serialize(new {
name = "My SIP Trunk",
trunk_type = "OUTBOUND",
max_concurrent_calls = 10
    }),
    System.Text.Encoding.UTF8,
    "application/json");

var res = await client.PostAsync(
    "https://api.vobiz.ai/api/v1/Account/AUTH_ID/trunks", payload);
Console.WriteLine(await res.Content.ReadAsStringAsync());
```

## Response

Returns the complete trunk object, including the auto-generated `trunk_id` UUID and timestamps.

```json Response - 201 Created theme={null}
{
  "trunk_id": "aabbccdd-1234-5678-90ab-cdef12345678",
  "account_id": "MA_XXXXXXXX",
  "name": "My Outbound Trunk",
  "trunk_domain": "aabbccdd-1234-5678-90ab-cdef12345678.sip.vobiz.ai",
  "trunk_status": "active",
  "secure": false,
  "trunk_direction": "both",
  "concurrent_calls_limit": 10,
  "cps_limit": 2,
  "description": "",
  "transport": "udp",
  "recording": false,
  "enable_transcription": false,
  "pii_redaction": false,
  "webhook_method": "POST",
  "recording_webhook_enabled": false,
  "created_at": "2026-05-12T05:11:52.054462Z",
  "updated_at": "2026-05-12T05:11:52.054462Z"
}
```

### Response fields

| Field | Type | Description |
| - | - | - |
| `trunk_id` | string (UUID) | Unique identifier for the trunk. Every other trunk endpoint needs it. |
| `account_id` | string | Account (`auth_id`) that owns the trunk. |
| `name` | string | The name you sent. |
| `trunk_domain` | string | Auto-generated SIP domain, `{trunk_id}.sip.vobiz.ai`. |
| `trunk_status` | string | Status of the trunk. `active` on creation. |
| `secure` | boolean | Whether media is encrypted with SRTP. `false` on creation. |
| `trunk_direction` | string | One of `inbound`, `outbound`, or `both`. |
| `concurrent_calls_limit` | integer | Maximum simultaneous calls, from `max_concurrent_calls`. |
| `cps_limit` | integer | Calls-per-second limit. `2` on creation. |
| `description` | string | Optional description. Empty on creation. |
| `transport` | string | SIP transport protocol: `udp`, `tcp`, or `tls`. `udp` on creation. |
| `recording` | boolean | Whether call recording is enabled. |
| `enable_transcription` | boolean | Whether call transcription is enabled. |
| `pii_redaction` | boolean | Whether PII redaction is applied to transcripts. |
| `webhook_method` | string | HTTP method used for trunk webhooks, for example `POST`. |
| `recording_webhook_enabled` | boolean | Whether the recording webhook is enabled. |
| `created_at` | string (ISO 8601) | When the trunk was created (UTC). |
| `updated_at` | string (ISO 8601) | When the trunk was last updated (UTC). |

See [The Trunk Object](https://www.vobiz.ai/docs/trunks/trunk-object.md) for the full reference.

## Next steps

A new trunk has a name, a direction, and a call limit. To make it usable:

1. Save the `trunk_id`. Every other trunk endpoint needs it.
2. Add [credentials](https://www.vobiz.ai/docs/trunks/credentials/create-credential.md) or [IP ACLs](https://www.vobiz.ai/docs/trunks/ip-acl/create-ip-acl.md) for authentication.
3. Configure [origination URIs](https://www.vobiz.ai/docs/trunks/origination-uri/create-origination-uri.md) for outbound call routing.
4. Adjust limits if needed with [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md).
5. Test the trunk with a sample call before production use.

## Choose an authentication method

A new trunk has no authentication attached. Add one or both of these methods after you create it. See [SIP Trunking](https://www.vobiz.ai/docs/trunks.md#authentication-methods) for details.

| | Username and password | IP whitelisting |
| - | - | - |
| Endpoint | [Create Credential](https://www.vobiz.ai/docs/trunks/credentials/create-credential.md) | [Create IP ACL](https://www.vobiz.ai/docs/trunks/ip-acl/create-ip-acl.md) |
| How it works | SIP digest authentication with a username and password | Calls from whitelisted IPv4 addresses are accepted without a password |
| Works from | Any IP address | Static IP addresses only |
| Best for | Devices with dynamic IP addresses and mobile softphones | PBX systems, SIP gateways, and carrier connections |
| Per trunk | Multiple credentials, for different devices or use cases | Specific whitelisted IPv4 addresses |

You can combine both methods on the same trunk.

## Related endpoints

| Task | Endpoint |
| - | - |
| List every trunk on the account | [Retrieve All Trunks](https://www.vobiz.ai/docs/trunks/retrieve-all-trunks.md) |
| Read one trunk by ID | [Retrieve a Trunk](https://www.vobiz.ai/docs/trunks/retrieve-trunk.md) |
| Change limits, transport, or recording | [Update a Trunk](https://www.vobiz.ai/docs/trunks/update-trunk.md) |
| Add SIP username and password auth | [Create Credential](https://www.vobiz.ai/docs/trunks/credentials/create-credential.md) |
| Allow traffic from specific IP addresses | [Create IP ACL](https://www.vobiz.ai/docs/trunks/ip-acl/create-ip-acl.md) |
| Route calls to your SIP server | [Create Origination URI](https://www.vobiz.ai/docs/trunks/origination-uri/create-origination-uri.md) |
| Remove the trunk | [Delete a Trunk](https://www.vobiz.ai/docs/trunks/delete-trunk.md) |


## OpenAPI

````yaml POST /api/v1/Account/{auth_id}/trunks
openapi: 3.0.3
info:
  title: Vobiz API
  description: >
    The Vobiz API lets you make calls, manage phone numbers, configure SIP
    trunks, 

    and access account data programmatically.


    **Base URL:** `https://api.vobiz.ai`


    **Authentication:** Most requests require `X-Auth-ID` and `X-Auth-Token`
    headers.

    Selected account endpoints also accept an account access token as a Bearer
    token.

    Obtain account credentials from your [Vobiz
    Console](https://console.vobiz.ai).
  version: '1.0'
  contact:
    email: support@vobiz.ai
    url: https://www.vobiz.ai
servers:
  - url: https://api.vobiz.ai
    description: Production
security:
  - AuthID: []
    AuthToken: []
tags:
  - name: Account
    description: Manage your account details and credentials
  - name: Balance
    description: Retrieve balance and transaction history
  - name: Calls
    description: Make and manage outbound calls
  - name: Live Calls
    description: Retrieve and control in-progress calls
  - name: CDR
    description: Call detail records and history
  - name: Sub-Accounts
    description: Create and manage sub-accounts
  - name: Phone Numbers
    description: Manage phone numbers on your account
  - name: Trunks
    description: Configure SIP trunks for inbound and outbound calling
  - name: Conference
    description: Manage conference calls and members
  - name: Applications
    description: Manage voice and messaging applications with webhook URLs
  - name: Endpoints
    description: Manage SIP endpoints for IP phones, softphones, and SIP clients
  - name: Partner API
    description: >-
      Reseller endpoints for managing customer sub-accounts, balance transfers,
      transactions, CDRs, and DIDs across your partner ecosystem
  - name: Sub-Account KYC
    description: >-
      Per-sub-account KYC verification (PAN, GST, CIN, Aadhaar, DigiLocker) and
      hosted email/redirect KYC sessions. Authenticated as the parent main
      account.
  - name: Sub-Account KYC (Test Mode)
    description: >-
      Mock KYC endpoints that never call the upstream provider. Drive verified /
      failed / pending / error outcomes with magic inputs for integration
      testing.
  - name: Bulk Operations
    description: >-
      Endpoints that act on many records in one request. These accept the
      request, process it in the background, and deliver the result by email.
paths:
  /api/v1/Account/{auth_id}/trunks:
    post:
      tags:
        - Trunks
      summary: Create a trunk
      description: Create a new SIP trunk for inbound or outbound calling.
      operationId: create-trunk
      parameters:
        - $ref: '#/components/parameters/AuthId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 100
                  description: Trunk name.
                trunk_direction:
                  type: string
                  enum:
                    - inbound
                    - outbound
                  description: >-
                    Direction of the trunk - **`inbound` or `outbound` only** (a
                    trunk is one direction, not both).
                trunk_status:
                  type: string
                  enum:
                    - enabled
                    - disabled
                  description: >-
                    Trunk status to set - `enabled` or `disabled`. Responses
                    report `enabled` as `active` and `disabled` as `suspended`.
                secure:
                  type: boolean
                trunk_domain:
                  type: string
                  maxLength: 255
                  description: >-
                    SIP domain. Auto-generated as `{first8ofUUID}.sip.vobiz.ai`
                    if omitted.
                transport:
                  type: string
                  enum:
                    - udp
                    - tcp
                    - tls
                inbound_destination:
                  type: string
                  maxLength: 255
                description:
                  type: string
                  maxLength: 500
                concurrent_calls_limit:
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: >-
                    Stored on the trunk. The **enforced** concurrency limit is
                    account-level (account base + channel subscriptions), not
                    this field.
                cps_limit:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: >-
                    Stored on the trunk. The **enforced** CPS is account-level,
                    not this field.
                credential_uuid:
                  type: string
                  description: >-
                    Attach an existing SIP credential (username / password /
                    realm) by UUID.
                ipacl_uuid:
                  type: string
                  description: >-
                    Attach an existing IP access-control list (IP-based auth) by
                    UUID.
                primary_uri_uuid:
                  type: string
                  description: Primary origination URI UUID.
                fallback_uri_uuid:
                  type: string
                  description: Fallback origination URI UUID.
                recording:
                  type: boolean
                  default: false
                  description: Enable call recording.
                enable_transcription:
                  type: boolean
                  default: false
                  description: Auto-transcribe recordings when `recording=true`.
                pii_redaction:
                  type: boolean
                  default: false
                  description: Redact PII from transcriptions.
                pii_entity_types:
                  type: string
                  description: Comma-separated list of entity types to redact.
                webhook_url:
                  type: string
                  maxLength: 500
                  description: >
                    Customer webhook for call-admission events (`CallInitiated`
                    / `Hangup`).

                    Must be a valid **public** http/https URL. SSRF-validated -
                    localhost,

                    private (RFC1918), and cloud-metadata (`169.254.169.254`)
                    URLs are

                    rejected with `invalid webhook_url`. See [Trunk
                    Webhooks](/trunks/webhook).
                  example: https://example.com/vobiz/webhook
                webhook_method:
                  type: string
                  enum:
                    - POST
                    - GET
                  default: POST
                  description: HTTP method for the webhook callback.
                recording_webhook_enabled:
                  type: boolean
                  default: false
                  description: >-
                    Fire a `recording.completed` webhook to `webhook_url` after
                    a recording is saved.
                username:
                  type: string
                  maxLength: 100
                  deprecated: true
                  description: Deprecated - use `credential_uuid`.
                password:
                  type: string
                  maxLength: 100
                  deprecated: true
                  description: Deprecated - use `credential_uuid`.
                ip_whitelist:
                  type: array
                  items:
                    type: string
                  deprecated: true
                  description: Deprecated - use `ipacl_uuid`.
              required:
                - name
            example:
              name: Retell AI SIP
              trunk_direction: outbound
              transport: udp
              webhook_url: https://example.com/vobiz/webhook
              webhook_method: POST
              recording: true
              enable_transcription: true
              concurrent_calls_limit: 50
              cps_limit: 15
              credential_uuid: b1e2...
              ipacl_uuid: c3d4...
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  trunk_id:
                    type: string
                  account_id:
                    type: string
                  name:
                    type: string
                  trunk_domain:
                    type: string
                  trunk_status:
                    type: string
                    enum:
                      - active
                      - suspended
                    description: >-
                      Trunk state as reported in responses - `active` or
                      `suspended`. Requests set it with `enabled` (reported as
                      `active`) or `disabled` (reported as `suspended`).
                  secure:
                    type: boolean
                  trunk_direction:
                    type: string
                  concurrent_calls_limit:
                    type: integer
                  cps_limit:
                    type: integer
                  description:
                    type: string
                  transport:
                    type: string
                  recording:
                    type: boolean
                  enable_transcription:
                    type: boolean
                  pii_redaction:
                    type: boolean
                  webhook_method:
                    type: string
                  recording_webhook_enabled:
                    type: boolean
                  created_at:
                    type: string
                  updated_at:
                    type: string
                required:
                  - trunk_id
                  - account_id
                  - name
                  - trunk_domain
                  - trunk_status
                  - secure
                  - trunk_direction
                  - concurrent_calls_limit
                  - cps_limit
                  - description
                  - transport
                  - recording
                  - enable_transcription
                  - pii_redaction
                  - webhook_method
                  - recording_webhook_enabled
                  - created_at
                  - updated_at
        '201':
          description: Trunk created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trunk'
              example:
                trunk_id: aabbccdd-1234-5678-90ab-cdef12345678
                account_id: MA_XXXXXXXX
                name: My Outbound Trunk
                trunk_domain: aabbccdd-1234-5678-90ab-cdef12345678.sip.vobiz.ai
                trunk_status: active
                secure: false
                trunk_direction: outbound
                concurrent_calls_limit: 10
                cps_limit: 2
                description: ''
                transport: udp
                recording: false
                enable_transcription: false
                pii_redaction: false
                webhook_method: POST
                recording_webhook_enabled: false
                created_at: '2026-03-25T05:11:52.054462Z'
                updated_at: '2026-03-25T05:11:52.054462Z'
components:
  parameters:
    AuthId:
      name: auth_id
      in: path
      required: true
      description: Your account Auth ID
      schema:
        type: string
        example: MA_XXXXXX
  schemas:
    Trunk:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        trunk_type:
          type: string
          enum:
            - INBOUND
            - OUTBOUND
        sip_domain:
          type: string
          example: abc123.sip.vobiz.ai
        enabled:
          type: boolean
        created_at:
          type: string
          format: date-time
  securitySchemes:
    AuthID:
      type: apiKey
      in: header
      name: X-Auth-ID
      description: Your Vobiz account Auth ID
    AuthToken:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: Your Vobiz account Auth Token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.