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.

Request Body Object Relationships#

Name

Type

Description

outgoing_dids

To many

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

The SMS Trunk Group 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 instead.

Examples#

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}

Other Responses#

Code

Success

Description

404

No

Not Found

422

No

Validation Error Object

400

No

Bad Request

401

No

Unauthorized

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.

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.