# Update SMS Trunk

Updates an SMS trunk.

All attributes and relationships are optional. The configuration type cannot be changed:
in `configuration`, `type` must match the trunk's type, and a different type is
rejected with `422`. The configuration attributes you send are written and the others keep
their stored values. For example, when you change `http_method` of an `http_in` trunk to
`get`, also send `body_type` and `body` as `null`.

## Request

HTTP Method: `PATCH`

URI Path: `/v3/sms_trunks/{id}`

### URI Query Parameters

| Name | Type | Is Required? | Description |
| --- | --- | --- | --- |
| id | `string` | Yes | Unique identifier of the SMS trunk. |

### Request Body Object Attributes

| Name | Type | Nullable | Is Required? | Description |
| --- | --- | --- | --- | --- |
| name | `string` | No | No | Friendly name of the SMS trunk. Must be unique among the SMS trunks and SMS trunk groups of the account. |
| external\_reference\_id | `string` | Yes | No | Optional identifier for the SMS trunk in the customer's external system. Maximum length is 100 characters. |
| blocked | `boolean` | No | No | When `true`, the trunk does not handle messages. |
| priority | `integer` | Yes | No | Routing priority of the trunk within its SMS trunk group. The range is 0-32767. On `sms_to_email`, `http_in`, `smpp_esme`, and `smpp_smsc` trunks, `null` sets the value to `100`. On `http_out` trunks, `priority` must be omitted or `null`. |
| allow\_any\_did\_as\_source | `boolean` | No | No | When `true`, any DID of the account can be used as the source address of messages sent through the trunk. Enabling it removes all `outgoing_dids`. Can be enabled only on `http_out`, `smpp_esme`, and `smpp_smsc` trunks. |
| configuration | `object` | No | No | Trunk configuration object with `type` and `attributes`. `type` must match the trunk's type. `attributes` may contain any subset of the writable attributes of that type. See [Configuration Attributes by Type](create-sms-trunk.html#sms-trunk-create-configuration-v35). |

### Request Body Object Relationships

| Name | Type | Description |
| --- | --- | --- |
| outgoing\_dids | [To many](../../../specification/relationships.html#api-relationships) | Replaces the DIDs allowed as the source address of messages sent through the trunk. Applies to `http_out`, `smpp_esme`, and `smpp_smsc` trunks. Must be empty while `allow_any_did_as_source` is `true`. Only DIDs of the account that support the `p2p` feature are accepted; a DID awaiting registration is rejected. |
| sms\_trunk\_group | [To one](../../../specification/relationships.html#api-relationships) | The [SMS Trunk Group](../sms-trunk-groups/index.html) the trunk joins, or `null` to leave the group. Not allowed on `http_out` trunks. |

Generated credentials cannot be changed through this endpoint. Use
[Regenerate SMS Trunk Credentials](sms-trunk-regenerate-credentials.html) instead.

## Examples

Update Configuration AttributeAllow Any DID as SourceJoin SMS Trunk Group

[[DIDWW-API-EXAMPLE-START]]

http

```
 1PATCH /v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24 HTTP/1.1
 2Host: api.didww.com
 3Content-Type: application/vnd.api+json
 4Accept: application/vnd.api+json
 5Authorization: Bearer [access token]
 6
 7{
 8  "data": {
 9    "id": "3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24",
10    "type": "sms_trunks",
11    "attributes": {
12      "configuration": {
13        "type": "http_in",
14        "attributes": {
15          "url": "https://example.com/sms/v2"
16        }
17      }
18    }
19  }
20}
```

curl

```
1curl -i -X PATCH https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24 -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer [access token]" --data-raw '{"data": {"attributes": {"configuration": {"attributes": {"url": "https://example.com/sms/v2"}, "type": "http_in"}}, "id": "3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24", "type": "sms_trunks"}}'
```

response

```
 1HTTP/1.1 200 OK
 2Content-Type: application/vnd.api+json
 3
 4{
 5  "data": {
 6    "id": "3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24",
 7    "type": "sms_trunks",
 8    "attributes": {
 9      "name": "Inbound webhook",
10      "external_reference_id": null,
11      "blocked": false,
12      "priority": 100,
13      "allow_any_did_as_source": false,
14      "allow_in": true,
15      "allow_out": false,
16      "created_at": "2026-10-22T09:15:42.118Z",
17      "updated_at": "2026-10-22T10:02:17.541Z",
18      "configuration": {
19        "type": "http_in",
20        "attributes": {
21          "http_method": "post",
22          "url": "https://example.com/sms/v2",
23          "query_parameters": null,
24          "headers": {
25            "X-Source": "didww"
26          },
27          "follow_redirect": false,
28          "validate_https_certificate": true,
29          "body_type": "json",
30          "body": "{\"text\":\"{SMS_TEXT}\",\"from\":\"{SMS_SRC_ADDR}\",\"to\":\"{SMS_DST_ADDR}\"}"
31        }
32      }
33    },
34    "relationships": {
35      "outgoing_dids": {
36        "links": {
37          "self": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/relationships/outgoing_dids",
38          "related": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/outgoing_dids"
39        }
40      },
41      "incoming_dids": {
42        "links": {
43          "self": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/relationships/incoming_dids",
44          "related": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/incoming_dids"
45        }
46      },
47      "sms_trunk_group": {
48        "links": {
49          "self": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/relationships/sms_trunk_group",
50          "related": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/sms_trunk_group"
51        }
52      },
53      "sender_id_verifications": {
54        "links": {
55          "self": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/relationships/sender_id_verifications",
56          "related": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/sender_id_verifications"
57        }
58      }
59    }
60  },
61  "meta": {
62    "api_version": "2026-11-19"
63  }
64}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
 1PATCH /v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67 HTTP/1.1
 2Host: api.didww.com
 3Content-Type: application/vnd.api+json
 4Accept: application/vnd.api+json
 5Authorization: Bearer [access token]
 6
 7{
 8  "data": {
 9    "id": "8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67",
10    "type": "sms_trunks",
11    "attributes": {
12      "allow_any_did_as_source": true
13    }
14  }
15}
```

curl

```
1curl -i -X PATCH https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67 -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer [access token]" --data-raw '{"data": {"attributes": {"allow_any_did_as_source": true}, "id": "8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67", "type": "sms_trunks"}}'
```

response

```
 1HTTP/1.1 200 OK
 2Content-Type: application/vnd.api+json
 3
 4{
 5  "data": {
 6    "id": "8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67",
 7    "type": "sms_trunks",
 8    "attributes": {
 9      "name": "SMPP ESME",
10      "external_reference_id": null,
11      "blocked": false,
12      "priority": 100,
13      "allow_any_did_as_source": true,
14      "allow_in": true,
15      "allow_out": true,
16      "created_at": "2026-10-22T09:15:42.118Z",
17      "updated_at": "2026-10-22T10:02:17.541Z",
18      "configuration": {
19        "type": "smpp_esme",
20        "attributes": {
21          "allowed_ips": [
22            "203.0.113.10/32",
23            "198.51.100.0/24"
24          ],
25          "system_id": "a7k2m9x4",
26          "system_type": null,
27          "password": "p3z8q1w6",
28          "server_location": "nyc"
29        }
30      }
31    },
32    "relationships": {
33      "outgoing_dids": {
34        "links": {
35          "self": "https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67/relationships/outgoing_dids",
36          "related": "https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67/outgoing_dids"
37        }
38      },
39      "incoming_dids": {
40        "links": {
41          "self": "https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67/relationships/incoming_dids",
42          "related": "https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67/incoming_dids"
43        }
44      },
45      "sms_trunk_group": {
46        "links": {
47          "self": "https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67/relationships/sms_trunk_group",
48          "related": "https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67/sms_trunk_group"
49        }
50      },
51      "sender_id_verifications": {
52        "links": {
53          "self": "https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67/relationships/sender_id_verifications",
54          "related": "https://api.didww.com/v3/sms_trunks/8e4b2c6a-9d1f-4a3e-b7c5-5f0d2e8a1b67/sender_id_verifications"
55        }
56      }
57    }
58  },
59  "meta": {
60    "api_version": "2026-11-19"
61  }
62}
```

[[DIDWW-API-EXAMPLE-END]]

[[DIDWW-API-EXAMPLE-START]]

http

```
 1PATCH /v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24 HTTP/1.1
 2Host: api.didww.com
 3Content-Type: application/vnd.api+json
 4Accept: application/vnd.api+json
 5Authorization: Bearer [access token]
 6
 7{
 8  "data": {
 9    "id": "3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24",
10    "type": "sms_trunks",
11    "attributes": {
12      "priority": 50
13    },
14    "relationships": {
15      "sms_trunk_group": {
16        "data": {
17          "type": "sms_trunk_groups",
18          "id": "c5e7a9b1-6d3f-4f2a-8c4e-9b1d7f3a5e46"
19        }
20      }
21    }
22  }
23}
```

curl

```
1curl -i -X PATCH https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24 -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: Bearer [access token]" --data-raw '{"data": {"attributes": {"priority": 50}, "id": "3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24", "relationships": {"sms_trunk_group": {"data": {"id": "c5e7a9b1-6d3f-4f2a-8c4e-9b1d7f3a5e46", "type": "sms_trunk_groups"}}}, "type": "sms_trunks"}}'
```

response

```
 1HTTP/1.1 200 OK
 2Content-Type: application/vnd.api+json
 3
 4{
 5  "data": {
 6    "id": "3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24",
 7    "type": "sms_trunks",
 8    "attributes": {
 9      "name": "Inbound webhook",
10      "external_reference_id": null,
11      "blocked": false,
12      "priority": 50,
13      "allow_any_did_as_source": false,
14      "allow_in": true,
15      "allow_out": false,
16      "created_at": "2026-10-22T09:15:42.118Z",
17      "updated_at": "2026-10-22T10:02:17.541Z",
18      "configuration": {
19        "type": "http_in",
20        "attributes": {
21          "http_method": "post",
22          "url": "https://example.com/sms",
23          "query_parameters": null,
24          "headers": {
25            "X-Source": "didww"
26          },
27          "follow_redirect": false,
28          "validate_https_certificate": true,
29          "body_type": "json",
30          "body": "{\"text\":\"{SMS_TEXT}\",\"from\":\"{SMS_SRC_ADDR}\",\"to\":\"{SMS_DST_ADDR}\"}"
31        }
32      }
33    },
34    "relationships": {
35      "outgoing_dids": {
36        "links": {
37          "self": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/relationships/outgoing_dids",
38          "related": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/outgoing_dids"
39        }
40      },
41      "incoming_dids": {
42        "links": {
43          "self": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/relationships/incoming_dids",
44          "related": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/incoming_dids"
45        }
46      },
47      "sms_trunk_group": {
48        "links": {
49          "self": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/relationships/sms_trunk_group",
50          "related": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/sms_trunk_group"
51        }
52      },
53      "sender_id_verifications": {
54        "links": {
55          "self": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/relationships/sender_id_verifications",
56          "related": "https://api.didww.com/v3/sms_trunks/3c7e9a1d-2b4f-4e6a-8d5c-1f9b0a7e3c24/sender_id_verifications"
57        }
58      }
59    }
60  },
61  "meta": {
62    "api_version": "2026-11-19"
63  }
64}
```

[[DIDWW-API-EXAMPLE-END]]

## Other Responses

| Code | Success | Description |
| --- | --- | --- |
| 404 | No | [Not Found](../../../specification/errors/index.html#api-not-found) |
| 422 | No | [Validation Error Object](../../../specification/errors/index.html#api-validation-error-object) |
| 400 | No | [Bad Request](../../../specification/errors/index.html#api-bad-request) |
| 401 | No | [Unauthorized](../../authentication.html#authentication-v35) |
| 403 | No | The access token carries the `read` scope, which does not cover this method (title `Insufficient scope`). The response carries `WWW-Authenticate: Bearer error="insufficient_scope"`. See [Scopes](../../authentication.html#authentication-scopes-v35). |
| 429 | No | The request budget of the account for the current window is spent (`too_many_requests`). `Retry-After` gives the number of seconds to wait. |
