---
title: "Update a trunk"
method: PATCH
path: "/api/v1/trunks/{id}"
tags: ["SIP Trunks"]
---

# Update a trunk

`PATCH /api/v1/trunks/{id}`

## Request

- Base URL: `https://api.callnode.io`
- URL: `https://api.callnode.io/api/v1/trunks/{id}`
- Auth: API key in header `X-Api-Key` and API key in header `X-Timestamp` and API key in header `X-Signature`

Updates any subset of a trunk's fields. Send `egressHost` as `null` or
`""` to clear it and make the trunk ingress-only. The same validation
codes as create apply; a request with no recognized fields returns
`400 no_fields`.

## Request body

- UpdateTrunkRequest: Any subset of the fields below. Send `egressHost` as `null` or `""` to clear it (ingress-only). A request with no recognized fields returns `no_fields`.
  - `name` string
  - `egressHost` string, nullable: Null or empty string clears egress delivery.
  - `egressPort` integer
  - `egressTransport` 'udp' | 'tcp' | 'tls'
  - `status` 'active' | 'disabled'
  - `egressEnabled` boolean
  - `allowedIps` string[]
  - `ingressEnabled` boolean
  - `registrationEnabled` boolean: Turning this on for the first time mints credentials and returns `sipPassword` once in the response. Turning it off keeps the credentials on file so re-enabling does not disturb a configured PBX.
  - `defaultPhoneNumberId` string, nullable
  - `outboundCliNumberId` string, nullable: Null clears the trunk-level outbound caller ID.

## Response `200`

The updated trunk.

- SipTrunk: A saved SIP trunk — egress (outbound BYOC), ingress (inbound from your PBX/SBC), or both.
  - `id` string
  - `name` string: 1–64 characters. Unique across your active trunks.
  - `status` 'active' | 'disabled'
  - `egressEnabled` boolean: Whether outbound (BYOC) delivery to `egressHost` is enabled.
  - `egressHost` string, nullable: Hostname or IP of your SIP endpoint for outbound delivery. Null for an ingress-only trunk.
  - `egressPort` integer
  - `egressTransport` 'udp' | 'tcp' | 'tls'
  - `ingressEnabled` boolean: Whether inbound calls from `allowedIps` are accepted.
  - `allowedIps` string[]: Public IPv4 addresses your PBX/SBC sends from — the accepted ingress source IPs.
  - `defaultPhoneNumberId` string, nullable: The id of one of your numbers — the default agent for ingress calls that do not match one of your own DIDs.
  - `outboundCliNumberId` string, nullable: The id of one of your numbers, presented as caller ID on outbound (termination) calls when the INVITE's From is not itself one of your numbers — the normal case for a registration trunk, whose From carries its auth username. A From that IS one of your live numbers always wins, so a multi-number PBX can still present per-call caller ID.
  - `monthlyFeeApplies` boolean: True when this trunk is beyond your plan's included count and is billed the additional-trunk fee.
  - `nextBillingDate` string, date-time, nullable
  - `registration` object: Registration-trunk settings, for a PBX with no static public IP. Never contains the password or its digest.
    - `enabled` boolean: Whether this trunk authenticates by registration rather than by source IP.
    - `username` string, nullable: The SIP username your PBX registers with.
    - `domain` string: SIP domain / digest realm.
    - `server` string: Host and port your PBX registers to.
    - `transport` 'tls': Registration trunks are TLS-only.
    - `passwordSetAt` string, date-time, nullable
    - `registered` boolean: True when your PBX is registered right now.
    - `lastRegisteredAt` string, date-time, nullable
    - `lastRegisteredIp` string, nullable: The address your PBX last registered from.
  - `sipPassword` string: Present ONLY on the response that mints it — creating a registration trunk, enabling registration, or rotating credentials. It cannot be retrieved afterwards; store it immediately.
  - `sipPasswordNotice` string: Human-readable reminder that accompanies `sipPassword`.
  - `createdAt` string, date-time
  - `updatedAt` string, date-time

## Other responses

- `400`: Malformed request or failed validation.
- `401`: Missing, unknown, or badly signed credentials — check the HMAC and the timestamp skew.
- `404`: No such resource on this account.

---

[API](https://skmtc.dev/callnode/apis/callnode-outbound-api.md) · [All operations](https://skmtc.dev/callnode/apis/callnode-outbound-api/llms.txt) · [OpenAPI document](https://skmtc.dev/callnode/apis/callnode-outbound-api/revisions/c7da6ad06509?raw)
