Create Trunk
This request creates a trunk with or without trunks.
post | /trunk_groups/{trunk_group_sid}/trunks |
Sample
A sample POST request to create a trunk:
curl -X POST \
'https://api.carrierx.com/core/v2/trunk_groups/138ed522-6633-405b-b58d-55eb0d262e32/trunks' \
-H 'Content-Type: application/json' \
--data-binary '{"name": "trunk01", "endpoint_sid": null}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
Response
200
status code with a serialized copy of the 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": "trunk01",
"out_capacity": 0,
"out_identity_mode": "passthrough",
"out_rfc_4694_mode": "cut_all",
"priority": 0,
"relay_sip_headers": [],
"transformations": [],
"trunk_sid": "4c51c85c-5355-4a91-bf1e-f33d731bcfa9",
"weight": 0
}
Required Scopes
To create a Trunk object, the partner must have one of the following scopes enabled:
trunk_groups.trunks.manage
trunk_groups.trunks.create
Path Arguments
Parameter | Data Type | Description |
---|---|---|
trunk_group_sid required | string | The trunk group secure ID. |
Body Arguments
JSON representation of the fields and values of the Trunk object to be created.
No fields are required to create a trunk, an empty object can be passed.
Refer to this table to view all fields that appear in the Trunk object.