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

# Update SIP trunk

> Update an existing SIP trunk configuration

This endpoint updates an existing SIP trunk. Only include the fields you want to change — partial updates are supported. Changing credentials, address, or proxy settings automatically re-provisions the affected voice infrastructure trunks.

### Path Parameters

**id** `integer` *required*

The unique identifier of the SIP trunk to update

### Body Parameters

All fields are optional. Only send the fields you want to update.

**phone\_number** `string`

The SIP extension or phone number (1-15 characters)

**nickname** `string`

A short, human-friendly label for the trunk. Maximum 50 characters. Send `null` to clear it.

**sip\_username** `string`

Username for SIP authentication (3-128 characters)

**sip\_password** `string`

Password for SIP authentication (minimum 3 characters)

**sip\_address** `string`

The SIP server address without port

**sip\_calling\_format** `string`

The outbound calling number format: `+e164`, `e164`, or `national`

**inbound\_authorization\_type** `string`

How inbound calls are authenticated: `auth` or `ip`. When switching to `ip`, you must also provide `allowed_inbound_ips`. When switching to `auth`, any existing IP whitelist is cleared.

**allowed\_inbound\_ips** `array`

Array of IP addresses allowed for inbound calls. **Required** when `inbound_authorization_type` is set to `ip`.

**country\_code** `string`

ISO 3166-2 country code

**outbound\_proxy** `boolean`

Route outbound calls through a fixed IP address

### Response

**message** `string`

Success message

**data** `object`

The updated SIP trunk object (same fields as [Get SIP trunk](https://docs.lacy.ai/api-reference/sip-trunks/get-sip-trunk.md))

```json 200 Updated credentials theme={null}
{
  "message": "SIP trunk updated successfully.",
  "data": {
    "id": 42,
    "phone_number": "1000",
    "nickname": "Provider X — Main",
    "sip_username": "new_username",
    "sip_address": "sip.provider.com",
    "sip_calling_format": "+e164",
    "inbound_authorization_type": "auth",
    "allowed_inbound_ips": null,
    "outbound_proxy": false,
    "country_code": "US",
    "inbound_trunk_id": "ST_newtrunkid1",
    "outbound_trunk_id": "ST_newtrunkid2",
    "created_at": "2026-03-31T10:00:00.000000Z",
    "updated_at": "2026-03-31T12:00:00.000000Z"
  }
}
```

```json 200 Switched to IP auth theme={null}
{
  "message": "SIP trunk updated successfully.",
  "data": {
    "id": 42,
    "phone_number": "1000",
    "nickname": "Provider X — Main",
    "sip_username": "myuser",
    "sip_address": "sip.provider.com",
    "sip_calling_format": "+e164",
    "inbound_authorization_type": "ip",
    "allowed_inbound_ips": ["203.0.113.10"],
    "outbound_proxy": false,
    "country_code": "US",
    "inbound_trunk_id": "ST_newtrunkid1",
    "outbound_trunk_id": "ST_yyyyyyyyyyyy",
    "created_at": "2026-03-31T10:00:00.000000Z",
    "updated_at": "2026-03-31T12:00:00.000000Z"
  }
}
```

```json 404 Not Found theme={null}
{
  "error": "SIP trunk not found."
}
```

```json 422 Validation Error theme={null}
{
  "message": "The given data was invalid.",
  "errors": {
    "allowed_inbound_ips": ["At least one allowed IP address is required when authorization type is \"ip\"."]
  }
}
```

```json 500 Provisioning Error theme={null}
{
  "error": "Failed to update SIP trunk. Please try again or contact support."
}
```

### Re-provisioning behavior

The following field changes trigger automatic re-provisioning of voice infrastructure trunks:

| Field changed | Inbound trunk | Outbound trunk |
| - | :-: | :-: |
| `sip_username` | Re-created | Re-created |
| `sip_password` | Re-created | Re-created |
| `sip_address` | — | Re-created |
| `phone_number` | Re-created | Re-created |
| `inbound_authorization_type` | Re-created | — |
| `allowed_inbound_ips` | Re-created | — |
| `outbound_proxy` | — | Re-created |

Fields like `sip_calling_format`, `country_code` are stored locally and do not trigger re-provisioning.


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