---
title: "Attach a number to a SIP trunk"
method: POST
path: "/v1/phone-numbers/{id}/sip-trunk"
tags: ["Voice"]
---

# Attach a number to a SIP trunk

`POST /v1/phone-numbers/{id}/sip-trunk`

Routes the number's calls to the trunk: the external platform receives
its inbound directly and can present it as outbound caller ID. While
attached, Zernio-side voice features are off for this number (call
forwarding, IVR, voicemail, recording, the softphone, and WhatsApp
calling), so the number must have Calls and WhatsApp calling disabled
before attaching. SMS and WhatsApp messaging are unaffected.

## Path parameters

- `id` string, required

## Request body

- object
  - `trunkId` string, required — SIP trunk ID (from POST /v1/phone-numbers/sip-trunks).

## Response `200`

Number attached (idempotent for the same trunk).

- object
  - `attached` boolean
  - `phoneNumber` string
  - `trunkId` string

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `403` — SIP trunking is not enabled for this workspace, or the workspace is on legacy (non-usage-based) billing, which cannot invoice trunk call costs (code feature_not_available).
- `404` — Number or trunk not found
- `409` — The number still has Calls or WhatsApp calling enabled, is mid WhatsApp verification, is not active, or is attached to another trunk (code invalid_resource_state).
- `422` — This number is hosted by your own carrier (brought via WhatsApp embedded signup), so it cannot be trunked.

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/revisions/1307bc21beec/schema)
