Skip to main content

Update DID

These requests update a DID, targeted by secure ID.

patch /phonenumber/dids/{did_sid}
put /phonenumber/dids/{did_sid}

Sample

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

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

Response

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

{
"active_capabilities": 4,
"attributes": {
"name": "main line"
},
"callback_url": null,
"campaign_sid": null,
"capabilities": 7,
"classification_sid": "17f4d954-d635-4cda-912b-c2a2fa3a6860",
"country_code": "USA",
"did_group_sid": null,
"did_sid": "e8df62d5-07a3-4189-a67e-87585067c5fe",
"in_country_format": "(516) 206-5574",
"international_format": "+1 516-206-5574",
"lata": null,
"locality": "NEW YORK",
"lrn_sid": null,
"name": "N/A",
"ocn": "251F",
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"phonenumber": "15162065574",
"porting_pin": null,
"price": "0.6",
"state": "NY",
"status": "assigned",
"string_key_1": null,
"string_key_2": null,
"transformations": [],
"trunk_group_sid": null
}

A 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 DID secure ID is passed in the query URL, and the values to be modified are passed in the request body.

    The 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 DID object. The DID secure ID is passed in the query URL, and the entire DID(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 a DID object, the partner must have one of the following scopes enabled:

  • phonenumber.manage
  • phonenumber.update

Path Arguments

ParameterData TypeDescription
did_sid requiredstringThe secure ID of the 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
  • did_group_sid
  • name
  • string_key_1
  • string_key_2
  • transformations
  • trunk_group_sid

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