Managed vs customer-owned trunks
Every trunk belongs to one organization. A trunk with amanaged_account_id is provisioned and operated by Anyreach (for example a managed Twilio account) and is read-only over the API. A trunk with no managed_account_id is customer-owned: you control its inbound and outbound configuration. This is the BYOC path.
| Managed trunk | Customer-owned (BYOC) trunk | |
|---|---|---|
managed_account_id | set | null |
| Editable via API | No (PUT and DELETE return 400) | Yes |
| Inbound/outbound config | Managed by Anyreach | You set it |
When to use BYOC: choose a customer-owned trunk when you must route calls through your own carrier or PBX rather than an Anyreach-managed account. Otherwise use a managed trunk.
Trunk CRUD
All trunk endpoints live under/core/trunks and require the trunks:read or trunks:manage scope. Reads accept either scope; writes require trunks:manage.
| Method | Path | Scope | Notes |
|---|---|---|---|
GET | /core/trunks | trunks:read or trunks:manage | List trunks. Supports name, created_after, created_before, updated_after, updated_before, limit, cursor. |
GET | /core/trunks/{id} | trunks:read or trunks:manage | Get one trunk. 404 if not found. |
POST | /core/trunks | trunks:manage | Create a customer-owned trunk. |
PUT | /core/trunks/{id} | trunks:manage | Update name and config. 400 if the trunk is managed. |
DELETE | /core/trunks/{id} | trunks:manage | Delete the trunk. 400 if the trunk is managed. Returns 204. |
name and optional inbound_config and outbound_config. The organization is taken from your token, so you do not send organization_id.
The
X-Anyreach-Org header is required only for user personal access tokens (pat_). Organization API keys (ak_) carry their organization implicitly.Inbound config
inbound_config governs calls arriving from your carrier.
| Field | Type | Default | Description |
|---|---|---|---|
enable_noise_cancellation | boolean | false | Apply noise cancellation to inbound audio. |
media_encryption | enum | SIP_MEDIA_ENCRYPT_DISABLE | Media encryption policy. See below. |
allowed_addresses | array of strings | null | Source addresses permitted to send calls. Empty strings are stripped; an empty list becomes null (no restriction). |
Outbound config
outbound_config defines how Anyreach connects to your carrier to place calls. address, auth_username, and auth_password are required when you supply an outbound config.
| Field | Type | Default | Description |
|---|---|---|---|
address | string | — | Carrier SIP host or domain. Required, non-empty. |
auth_username | string | — | SIP auth username. Required, non-empty. |
auth_password | string | — | SIP auth password. Required, non-empty. |
transport | enum | SIP_TRANSPORT_UDP | Transport protocol. See below. |
media_encryption | enum | SIP_MEDIA_ENCRYPT_DISABLE | Media encryption policy. See below. |
Enum values
| Enum | Allowed values |
|---|---|
media_encryption | SIP_MEDIA_ENCRYPT_DISABLE (none), SIP_MEDIA_ENCRYPT_ALLOW, SIP_MEDIA_ENCRYPT_REQUIRE |
transport | SIP_TRANSPORT_UDP, SIP_TRANSPORT_TCP, SIP_TRANSPORT_TLS |
Deploy an agent as a SIP endpoint
Instead of (or in addition to) attaching a phone number, you can expose a published agent as a dialable SIP URI. The agent then answers calls placed directly to its SIP address. The URI has the form:Publish the agent
The agent must have at least one published version. Deploying an agent with no published version returns
409.Deploy as SIP
Call
POST /core/agents/{id}/deploy-as-sip with the agents:manage scope. The response returns the SIP URI and deployed: true. The operation is idempotent.SIP endpoint state on the agent
The agentGET response includes a sip_endpoint object reflecting current state, or null when state cannot be resolved.
| Field | Type | Description |
|---|---|---|
uri | string | The agent’s SIP URI. |
deployed | boolean | Whether the agent is currently reachable at that URI. |
Errors
| Status | Cause |
|---|---|
404 | Agent not found. |
409 | Deploy attempted before the agent has a published version. |
Related
Telephony overview
How phone numbers, trunks, and agents fit together.
Telephony API reference
Full endpoint reference for telephony resources.

