IVR
The IVR object is supported by the MiRTA PBX OpenAPI endpoint. This object is tenant-scoped. Tenant API keys must include tenant=CANISTRACCI; writes require a writable API key.
Object Summary
| Property | Value |
|---|---|
| Object | ivr |
| Primary path | /ivrs |
| ID field | iv_id |
| Label field | iv_name |
| Primary source table | iv_ivrs |
| Required on create | iv_name |
| Path aliases | /ivrs |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/ivrs?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/ivrs?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | iv_name |
mediafile_id | iv_me_id |
timeout | iv_timeout |
digit_timeout | iv_digittimeout |
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 |
|---|---|
IVR_1 | ivr_1, key_1, 1 |
IVR_2 | ivr_2, key_2, 2 |
IVR_3 | ivr_3, key_3, 3 |
IVR_4 | ivr_4, key_4, 4 |
IVR_5 | ivr_5, key_5, 5 |
IVR_6 | ivr_6, key_6, 6 |
IVR_7 | ivr_7, key_7, 7 |
IVR_8 | ivr_8, key_8, 8 |
IVR_9 | ivr_9, key_9, 9 |
IVR_0 | ivr_0, key_0, 0 |
IVR_STAR | ivr_star, key_star, star |
IVR_SHARP | ivr_sharp, key_sharp, sharp |
IVR_WRONG | ivr_wrong, wrong |
IVR_TIMEOUT | ivr_timeout, timeout |
IVR_HANGUP | ivr_hangup, hangup |
IVR_FEATURE | ivr_feature, feature |
IVR_EXTENSION | ivr_extension, extension |
IVR_MEDIAFILE | ivr_mediafile, mediafile |
IVR_OPTIONSMEDIAFILE | ivr_optionsmediafile, optionsmediafile |
CUSTOMIVR_SUPPORT | customivr_support |
Important Notes
- Custom IVR destination names matching CUSTOMIVR_* are also accepted.
Examples
List IVRs
Returns the ivrs visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/ivrs?tenant=CANISTRACCI"
Get IVR
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
Create IVR
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 IVR",
"mediafile_id": 22,
"timeout": 5,
"digit_timeout": 3
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs?tenant=CANISTRACCI"
Edit IVR
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timeout": 8,
"digit_timeout": 4
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
Delete IVR
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/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 1 Destination
Updates the IVR_1 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 '{
"ivr_1": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 2 Destination
Updates the IVR_2 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 '{
"ivr_2": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 3 Destination
Updates the IVR_3 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 '{
"ivr_3": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 4 Destination
Updates the IVR_4 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 '{
"ivr_4": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 5 Destination
Updates the IVR_5 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 '{
"ivr_5": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 6 Destination
Updates the IVR_6 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 '{
"ivr_6": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 7 Destination
Updates the IVR_7 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 '{
"ivr_7": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 8 Destination
Updates the IVR_8 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 '{
"ivr_8": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 9 Destination
Updates the IVR_9 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 '{
"ivr_9": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR 0 Destination
Updates the IVR_0 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 '{
"ivr_0": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR STAR Destination
Updates the IVR_STAR 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 '{
"ivr_star": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR SHARP Destination
Updates the IVR_SHARP 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 '{
"ivr_sharp": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR WRONG Destination
Updates the IVR_WRONG 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 '{
"ivr_wrong": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR TIMEOUT Destination
Updates the IVR_TIMEOUT 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 '{
"ivr_timeout": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR HANGUP Destination
Updates the IVR_HANGUP 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 '{
"ivr_hangup": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR FEATURE Destination
Updates the IVR_FEATURE 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 '{
"ivr_feature": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR EXTENSION Destination
Updates the IVR_EXTENSION 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 '{
"ivr_extension": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR MEDIAFILE Destination
Updates the IVR_MEDIAFILE 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 '{
"ivr_mediafile": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR OPTIONSMEDIAFILE Destination
Updates the IVR_OPTIONSMEDIAFILE 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 '{
"ivr_optionsmediafile": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"
IVR SUPPORT Destination
Updates the CUSTOMIVR_SUPPORT 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 '{
"customivr_support": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/ivrs/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. |
No comments to display
No comments to display