Skip to main content

Update External DID

These requests update an external DID, targeted by secure ID.

patch /phonenumber/external_dids/{external_did_sid}
put /phonenumber/external_dids/{external_did_sid}
note

The capabilities field cannot be updated after the External DID is created. If you need to change the capabilities of an existing external DID, you would need to delete it and register a new one with the desired capabilities and the same phone number.

Sample

A sample PATCH request to update an External DID object, targeted by secure ID, with the values in the request body:

curl -X PATCH \
'https://api.carrierx.com/core/v2/phonenumber/external_dids/e8df62d5-07a3-4189-a67e-87585067c5fe' \
-H 'Content-Type: application/json' \
--data-binary '{"attributes":{"name":"marketing sms"}}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

200 status code with a serialized copy of the updated ExternalDID object:

{
"active_capabilities": 3,
"attributes": {
"name": "marketing sms"
},

"callback_url": "https://example.com/sms-callback",
"capabilities": 3,
"external_did_sid": "e8df62d5-07a3-4189-a67e-87585067c5fe",
"name": "SE External DID",
"phonenumber": "+46700987654",
"status": "assigned",
"string_key_1": null,
"string_key_2": null
"underlying_carrier_sid": "40a8c9cf-8b08-4c21-a3e3-952c65ee892d",
}

An External DID object can be updated using either a PATCH or PUT request.

  • A PATCH request can be used to update one or more attribute values. When using a PATCH request, only the attributes specified in the request payload will be updated, all other attributes and values will remain the same. The external DID secure ID is passed in the query URL, and the values to be modified are passed in the request body.

    The External DID object also contains nested Attributes and Transformations objects. Refer to this section to learn how nested objects can be updated using the PATCH request.

  • A PUT request can be used to update an entire External DID object. The external DID secure ID is passed in the query URL, and the entire External DID object is passed in the request body.

note

Note, while all the fields must be present in a PUT request, not all the attribute values may be modified after the initial creation, because when created, some of them become read-only.

Required Scopes

To update an External DID object, the partner must have one of the following scopes enabled:

  • phonenumber.manage
  • phonenumber.update

Path Arguments

ParameterData TypeDescription
external_did_sid requiredstringThe secure ID of the external DID.

Query Arguments

ParameterData TypeDescription
nested_objectsstringDetermines if the nested objects fields and values should be replaced. Value accepted in this field is replace.

Body Arguments

JSON representation of the fields and values to be updated.

Fields that can be modified are:

  • attributes
  • callback_url
  • name
  • string_key_1
  • string_key_2

Refer to this table to view all fields that appear in the External DID object.