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
PATCH
request can be used to update one or more attribute values. When using aPATCH
request, 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
PUT
request 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.manage
trunk_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:
acls
allow_forward
allow_transfer
asn_mode
call_type
codec
endpoint_sid
in_capacity
in_identity_format
in_identity_mode
in_rfc_4694_mode
location_sid
name
out_capacity
out_identity_mode
out_rfc_4694_mode
priority
relay_sip_headers
transformations
weight
Refer to this table to view all fields that appear in the Trunk object.