Create Trunk Group
This request creates a trunk group with or without trunks.
post | /trunk_groups |
Sample
A sample POST request to create a trunk group:
curl -X POST \
'https://api.carrierx.com/core/v2/trunk_groups?with_trunks=true' \
-H 'Content-Type: application/json' \
--data-binary '{"name":"New Trunk Group", "trunks":[{"name": "Trunk1", "endpoint_sid": ""}]}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
Response
200
status code with a serialized copy of the Trunk Group object:
{
"acls": [],
"hard_failure_codes": "408;",
"hard_failure_cooldown": 120,
"hard_failure_interval": 60,
"hard_failure_last_resort": "first",
"hard_failure_threshold": 3,
"name": "New Trunk Group",
"partner_sid": "ypdm9zW2d-f3rH.mljbilExkNXL2Zi5x",
"routing_data": null,
"routing_type": "failover",
"sip_options_locations": [],
"sip_options_threshold": 3,
"soft_failure_codes": "408;",
"transformations": [],
"trunk_group_sid": "503167ea-b8a5-4a5d-97e3-d684884da1d8",
"trunks": [
{
"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": "Trunk1",
"out_capacity": 0,
"out_identity_mode": "passthrough",
"out_rfc_4694_mode": "cut_all",
"priority": 0,
"relay_sip_headers": [],
"transformations": [],
"trunk_sid": "fd97153a-e466-4de6-9484-c3d4dde72b85",
"weight": 0
}
]
}
Required Scopes
To create a Trunk Group object, the partner must have one of the following scopes enabled:
trunk_groups.manage
trunk_groups.create
To create a trunk group with trunks, the partner must additionally have either the trunk_groups.trunks.manage
or trunk_groups.trunks.create
scope enabled.
Query Arguments
Parameter | Data Type | Description |
---|---|---|
with_trunks | boolean | Determines whether or not to create a trunk group with one or more trunks. |
Body Arguments
JSON representation of the fields and values of the Trunk Group object to be created.
No fields are required to create a trunk group, an empty object can be passed.
Refer to this table to view all fields that appear in the Trunk Group object.