Update Trunk
This request updates a trunk, targeted by trunk and trunk group secure ID.
| patch | /trunk_groups/{trunk_group_sid}/trunks/{trunk_sid} |
| put | /trunk_groups/{trunk_group_sid}/trunks/{trunk_sid} |
Sample
A sample PATCH request to update request to update the trunk, targeted by secure ID:
curl -X PATCH \
curl -X PATCH \
'https://api.carrierx.com/core/v2/trunk_groups/138ed522-6633-405b-b58d-55eb0d262e32/trunks/aed1c137-8cbf-417c-8c41-e181f425826b' \
-H 'Content-Type: application/json' \
--data-binary '{"name": "trunk_new_name", "endpoint_sid": null}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
Response
200 status code with a serialized copy of the updated Trunk object:
{
"acls": []
"allow_forward": "disabled",
"allow_transfer": false,
"asn_mode": "disable",
"call_type": "regular",
"codec": null,
"endpoint_sid": null,
"in_capacity": 0,
"in_identity_format": "passthrough",
"in_identity_mode": "passthrough",
"in_rfc_4694_mode": "cut_all",
"location_sid": null,
"name": "trunk_new_name",
"out_capacity": 0,
"out_identity_mode": "passthrough",
"out_rfc_4694_mode": "cut_all",
"priority": 0,
"relay_sip_headers": [],
"transformations": [],
"trunk_sid": "aed1c137-8cbf-417c-8c41-e181f425826b",
"weight": 0
}
A Trunk 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 trunk secure ID is passed in the query URL, and the values to be modified are passed in the request body. -
A
PUTrequest can be used to update an entire Trunk object. The trunk secure ID is passed in the query URL, and the entire Trunk object is passed in the request body.
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 Trunk object, the partner must have one of the following scopes enabled:
trunk_groups.trunks.managetrunk_groups.trunks.update
To modify the allow_forward field of a trunk, the partner must additionally have the trunk_groups.trunks.allow_trunk_allow_forward_update scope enabled.
Path Arguments
| Parameter | Data Type | Description |
|---|---|---|
| trunk_group_sid required | string | The trunk group secure ID. |
| trunk_sid required | string | The trunk secure ID. |
Body Arguments
JSON representation of the fields and values to be updated.
Fields that can be modified are:
aclsallow_forwardallow_transferasn_modecall_typecodecendpoint_sidin_capacityin_identity_formatin_identity_modein_rfc_4694_modelocation_sidnameout_capacityout_identity_modeout_rfc_4694_modepriorityrelay_sip_headerstransformationsweight
Refer to this table to view all fields that appear in the Trunk object.