Update Prefix
This request updates a prefix, targeted by secure ID.
| patch | /phonenumber/prefixes/{prefix_sid} |
| put | /phonenumber/prefixes/{prefix_sid} |
Sample
A sample PATCH request to update the Prefix object, targeted by secure ID, with the values in the request body:
curl -X PATCH \
'https://api.carrierx.com/core/v2/phonenumber/prefixes/cc367acb-94c8-418f-b247-85dce5806ef4' \
-H 'Content-Type: application/json' \
--data-binary '{"name":"main prefix"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
Response
200 status code with a serialized copy of the updated Prefix object:
{
"active_capabilities": 4,
"attributes": {},
"callback_url": null,
"name": "main prefix",
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"prefix": "51625",
"prefix_sid": "cc367acb-94c8-418f-b247-85dce5806ef4",
"source_trunk_group_sid": null,
"string_key_1": null,
"string_key_2": null,
"transformations": [],
"trunk_group_sid": "df9bd225-8966-4f04-a2e3-1a317683afd5"
}
A Prefix object can be updated using either a PATCH or PUT request.
-
A
PATCHrequest can be used to update one or more attribute values. When using aPATCHrequest, only the attributes specified in the request payload will be updated, all other attributes and values will remain the same. The prefix secure ID is passed in the query URL, and the values to be modified are passed in the request body.The Prefix object also contains nested Attributes and Transformations objects. Refer to this section to learn how nested objects can be updated using the
PATCHrequest. -
A
PUTrequest can be used to update an entire Prefix object. The prefix secure ID is passed in the query URL, and the entire Prefix object is passed in the request body.
Note, while all 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 Prefix object, the partner must have one of the following scopes enabled:
phonenumber.managephonenumber.update
Path Arguments
| Parameter | Data Type | Description |
|---|---|---|
| prefix_sid required | string | The prefix secure ID. |
Body Arguments
JSON representation of the fields and values to be updated. Updating the prefix field changes the sequence of alphanumeric characters, or *, used to match outbound calls for routing.
Fields that can be modified are:
attributesnameprefixsource_trunk_group_sidstring_key_1string_key_2transformationstrunk_group_sid
Refer to this table to view all fields that appear in the Prefix object.