# `bird voice trunks gateways update`

## Usage

```bash
bird voice trunks gateways update <trunk-id> <gateway-id> [flags]
```

## Description

Update a SIP trunk gateway

Change an inbound gateway address, priority, or number formats. Omitted fields stay unchanged; an empty format restores E.164. Requires inbound calling enabled.

Build the request from flags, a JSON VoiceTrunkGatewayUpdate body via --body-file ("-" reads
stdin), or both — a flag overrides the matching body field. Run --example to
print a ready-to-edit body, or --dry-run to print the resolved request without
sending it.

## Examples

```bash
# print the body shape (no credentials needed)
bird voice trunks gateways update --example

# the body it prints:
```

```json
{
  "destination_format": "1234#{number}",
  "origination_format": "+{number}",
  "priority": 0,
  "sip_uri": "sip:pbx.example.com:5060"
}
```

## Options

#### Request

| Name                | Description                                                  |
| ------------------- | ------------------------------------------------------------ |
| `--body-file`       | Read the JSON request body from this file; "-" reads stdin   |
| `--example`         | Print a complete example request body, then exit             |
| `--dry-run`         | Print the resolved request without sending it, then exit     |
| `--idempotency-key` | Deduplication key; a retry with the same key won't act twice |

#### Options

| Name                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--sip-uri`            | SIP URI an inbound call to this trunk should be forwarded to. Give the host only, with an optional port: which number is dialed there comes from destination\_format, so a URI carrying a user part is rejected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `--priority <n>`       | The order gateways are tried in, lowest first. Give two gateways the same priority to share calls between them evenly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--origination-format` | How this gateway wants the calling number spelled, as a template whose {number} stands for the number without its leading +. The result is stated in the P-Asserted-Identity header of the delivered call. Send an empty string to go back to E.164, which is +{number}. The template may add digits, letters and the characters -\_.!~\*'()&=+$,;?/%# around {number}, which may appear at most once, and anything else in braces is rejected so a misspelled placeholder cannot reach a call. A format with no {number} at all states the same identity on every call, which is what a peer that only accepts one authorized number wants. The call then carries nothing about who really called. |
| `--destination-format` | How this gateway formats the dialed number. In the template, {number} represents the number without its leading +. The result is placed before the sip\_uri host. For example, 1234#{number} formats +31201234567 as sip:1234#31201234567@pbx.example.com:5060. Send an empty string to go back to E.164, which is +{number}. A format with no {number} at all sends every number this trunk answers to one fixed number, so 777000447973 reaches sip:777000447973@pbx.example.com:5060 whatever was dialed. The same rules as origination\_format apply to what the template may contain.                                                                                                          |
| `--response-schema`    | Print the fields this command returns, then exit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

## Related

| Name                                                                                    | Description                     |
| --------------------------------------------------------------------------------------- | ------------------------------- |
| [`bird voice trunks gateways create`](/docs/cli/reference/voice-trunks-gateways-create) | Create a gateway on a SIP trunk |
| [`bird voice trunks gateways delete`](/docs/cli/reference/voice-trunks-gateways-delete) | Delete a SIP trunk gateway      |
| [`bird voice trunks gateways get`](/docs/cli/reference/voice-trunks-gateways-get)       | Get a SIP trunk gateway         |
| [`bird voice trunks gateways list`](/docs/cli/reference/voice-trunks-gateways-list)     | List a SIP trunk's gateways     |

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
