Custom Destination
The Custom Destination object is supported by the MiRTA PBX OpenAPI endpoint. This object is normally tenant-scoped. With a global API key, use global=1 to manage the shared/global record set. Tenant writes still require tenant=CANISTRACCI.
Object Summary
| Property | Value |
|---|---|
| Object | customdestination |
| Primary path | /customdestinations |
| ID field | cu_id |
| Label field | cu_name |
| Primary source table | cu_customs |
| Required on create | cu_name, cu_ct_id |
| Path aliases | /custom, /customs, /customdestinations, /custom_destinations, /custom_destination |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/customdestinations?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/customdestinations?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | cu_name |
type_id | cu_ct_id |
custom_type_id | cu_ct_id |
Destination Fields
Destination fields accept one destination string or an array of destination strings such as EXT-100, VOICEMAIL-100, or another supported destination type and ID pair.
| Destination type | Accepted aliases |
|---|---|
PRIVACY-DONTCALL | privacy_dontcall, dontcall |
PRIVACY-TORTURE | privacy_torture, torture |
CTONANSWER | onanswer |
CALLBACK-CONNECTED | callback_connected |
CTONCALLERHANGUP | caller_hangup |
SPLITCHANNELACTION-CALLER | split_caller |
SPLITCHANNELACTION-CALLED | split_called |
RANDOMDESTINATION | randomdestination, random_destination |
RANDOMDESTINATION1 | randomdestination1, random_destination1 |
RANDOMDESTINATION2 | randomdestination2, random_destination2 |
RANDOMDESTINATION3 | randomdestination3, random_destination3 |
RANDOMDESTINATION4 | randomdestination4, random_destination4 |
RANDOMDESTINATION5 | randomdestination5, random_destination5 |
RANDOMDESTINATION6 | randomdestination6, random_destination6 |
RANDOMDESTINATION7 | randomdestination7, random_destination7 |
RANDOMDESTINATION8 | randomdestination8, random_destination8 |
RANDOMDESTINATION9 | randomdestination9, random_destination9 |
RANDOMDESTINATION10 | randomdestination10, random_destination10 |
RANDOMDESTINATION11 | randomdestination11, random_destination11 |
RANDOMDESTINATION12 | randomdestination12, random_destination12 |
RANDOMDESTINATION13 | randomdestination13, random_destination13 |
RANDOMDESTINATION14 | randomdestination14, random_destination14 |
RANDOMDESTINATION15 | randomdestination15, random_destination15 |
RANDOMDESTINATION16 | randomdestination16, random_destination16 |
RANDOMDESTINATION17 | randomdestination17, random_destination17 |
RANDOMDESTINATION18 | randomdestination18, random_destination18 |
RANDOMDESTINATION19 | randomdestination19, random_destination19 |
RANDOMDESTINATION20 | randomdestination20, random_destination20 |
Examples
List Custom Destinations
Returns the custom destinations visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/customdestinations?tenant=CANISTRACCI"
Get Custom Destination
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Create Custom Destination
Creates a new object. Use the short aliases shown above or the source field names.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Custom Destination",
"type_id": 1
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations?tenant=CANISTRACCI"
Edit Custom Destination
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Custom Destination Updated"
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Delete Custom Destination
Deletes the object. Check references before deleting configuration used by routing or reporting.
curl -X DELETE \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
List Global Custom Destinations
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/customdestinations?global=1"
Custom Destination DONTCALL Destination
Updates the PRIVACY-DONTCALL destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"privacy_dontcall": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination TORTURE Destination
Updates the PRIVACY-TORTURE destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"privacy_torture": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination Destination
Updates the CTONANSWER destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"onanswer": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination CONNECTED Destination
Updates the CALLBACK-CONNECTED destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"callback_connected": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination Destination
Updates the CTONCALLERHANGUP destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"caller_hangup": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination CALLER Destination
Updates the SPLITCHANNELACTION-CALLER destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"split_caller": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination CALLED Destination
Updates the SPLITCHANNELACTION-CALLED destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"split_called": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination Destination
Updates the RANDOMDESTINATION destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 1 Destination
Updates the RANDOMDESTINATION1 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination1": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 2 Destination
Updates the RANDOMDESTINATION2 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination2": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 3 Destination
Updates the RANDOMDESTINATION3 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination3": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 4 Destination
Updates the RANDOMDESTINATION4 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination4": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 5 Destination
Updates the RANDOMDESTINATION5 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination5": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 6 Destination
Updates the RANDOMDESTINATION6 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination6": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 7 Destination
Updates the RANDOMDESTINATION7 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination7": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 8 Destination
Updates the RANDOMDESTINATION8 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination8": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 9 Destination
Updates the RANDOMDESTINATION9 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination9": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 10 Destination
Updates the RANDOMDESTINATION10 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination10": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 11 Destination
Updates the RANDOMDESTINATION11 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination11": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 12 Destination
Updates the RANDOMDESTINATION12 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination12": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 13 Destination
Updates the RANDOMDESTINATION13 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination13": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 14 Destination
Updates the RANDOMDESTINATION14 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination14": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 15 Destination
Updates the RANDOMDESTINATION15 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination15": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 16 Destination
Updates the RANDOMDESTINATION16 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination16": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 17 Destination
Updates the RANDOMDESTINATION17 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination17": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 18 Destination
Updates the RANDOMDESTINATION18 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination18": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 19 Destination
Updates the RANDOMDESTINATION19 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination19": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination 20 Destination
Updates the RANDOMDESTINATION20 destination. The same value can also be sent inside a destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"randomdestination20": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Custom Destination Extended Data
Adds or replaces custom destination extended rows when the custom type uses extra parameters.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"extended_infos": [
{
"ce_name": "DOCS_VARIABLE",
"ce_value": "example"
}
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Common Errors
| Error | Meaning |
|---|---|
missing_api_key | No API key was supplied in the query string, X-API-Key, or bearer token. |
invalid_api_key | The supplied key does not match the tenant or global API key. |
tenant_required | A tenant code is required for tenant-scoped writes or tenant-key reads. |
read_only_api_key | The key can read data but cannot create, update, or delete objects. |
missing_required_field | A required create field is missing. |