Skip to main content

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

PropertyValue
Objectivr
Primary path/ivrs
ID fieldiv_id
Label fieldiv_name
Primary source tableiv_ivrs
Required on createiv_name
Path aliases/ivrs

Endpoint Patterns

ActionExample pattern
ListGET https://pbx.example.com/pbx/openapi.php/ivrs?tenant=CANISTRACCI
Get by IDGET https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI
CreatePOST https://pbx.example.com/pbx/openapi.php/ivrs?tenant=CANISTRACCI
UpdatePATCH https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI
DeleteDELETE https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI

Accepted Field Aliases

Request fieldSource field
nameiv_name
mediafile_idiv_me_id
timeoutiv_timeout
digit_timeoutiv_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 typeAccepted aliases
IVR_1ivr_1, key_1, 1
IVR_2ivr_2, key_2, 2
IVR_3ivr_3, key_3, 3
IVR_4ivr_4, key_4, 4
IVR_5ivr_5, key_5, 5
IVR_6ivr_6, key_6, 6
IVR_7ivr_7, key_7, 7
IVR_8ivr_8, key_8, 8
IVR_9ivr_9, key_9, 9
IVR_0ivr_0, key_0, 0
IVR_STARivr_star, key_star, star
IVR_SHARPivr_sharp, key_sharp, sharp
IVR_WRONGivr_wrong, wrong
IVR_TIMEOUTivr_timeout, timeout
IVR_HANGUPivr_hangup, hangup
IVR_FEATUREivr_feature, feature
IVR_EXTENSIONivr_extension, extension
IVR_MEDIAFILEivr_mediafile, mediafile
IVR_OPTIONSMEDIAFILEivr_optionsmediafile, optionsmediafile
CUSTOMIVR_SUPPORTcustomivr_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

ErrorMeaning
missing_api_keyNo API key was supplied in the query string, X-API-Key, or bearer token.
invalid_api_keyThe supplied key does not match the tenant or global API key.
tenant_requiredA tenant code is required for tenant-scoped writes or tenant-key reads.
read_only_api_keyThe key can read data but cannot create, update, or delete objects.
missing_required_fieldA required create field is missing.