OpenAPI
OpenAPI JSON endpoint reference and examples.
- Overview and Examples
- Extension State
- Auth Token
- Dial
- Live Call Transfer
- CDR
- Simple CDR
- Extension
- Tenant
- User
- User Profile
- Routing Profile
- Provider
- Voicemail
- IVR
- Custom Destination
- Condition
- Hunt List
- DID
- Queue
- Queue Agent Actions
- Setting
- Media File
- Music On Hold
- Paging Group
- Conference Room
- Flow
- Tenant Variable
- DISA
- Caller ID Blacklist
- Campaign
- Campaign Number
- Cron Job
- Feature Code
- Short Number
- Phone Book
- Phone Book Entry
- Provisioning Phone
- AI Analysis
- AI Logs
- Additional Configuration Operations
- SMS and MMS
- Faxes
- Queue Logs
- Peer Counts
- Translations
- Firewall
- User Activity
- PBX Nodes
- Extension States
Overview and Examples
The MiRTA PBX OpenAPI endpoint exposes configuration and reporting APIs as an OpenAPI 3.0.3 JSON specification. OpenAPI describes the available paths, methods, authentication schemes, request bodies, and response schemas in a machine-readable format.
Using the OpenAPI specification makes integrations easier to test and maintain: developers can generate client code, import the API into tools such as Postman or Swagger UI, validate request shapes, and keep documentation aligned with the endpoint implementation.
Base URL
https://pbx.example.com/pbx/openapi.php
https://pbx.example.com/pbx/openapi.php?spec=1
https://pbx.example.com/pbx/openapi.php/openapi.json
https://pbx.example.com/pbx/openapi.php/swagger.json
The global administrator controls access to the specification in Admin / Settings / API Interface / OpenAPI documentation:
- Public (default): opening
openapi.phpor requesting the specification explicitly returns the full catalog. - Protected by API key: opening
openapi.phpwithout a specification selector returns HTTP 404. Request the specification explicitly with a global or tenant API key. Global keys see the full catalog; tenant keys must include their tenant code or name and see the tenant operations. Read-only and full keys see the same documentation for their scope. The key's IP filter and the tenant's OpenAPI access setting apply. Extension Dial API Keys cannot retrieve the protected specification. - Hidden: every specification request returns HTTP 404, including requests with a global key.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php?spec=1&tenant=CANISTRACCI"
The protected specification looks up the tenant by exact code first, then by exact name. All three modes support the existing REST and query-style API calls.
Authentication
Send the API key as a key query parameter, an X-API-Key header, or an Authorization: Bearer token. Tenant API keys require a tenant parameter. Global keys can access global administration objects and can list tenant-scoped objects across tenants when no tenant parameter is supplied.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI"
curl -H "Authorization: Bearer TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions/number/100?tenant=CANISTRACCI"
curl "https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI&key=TENANT_API_KEY"
Endpoint Patterns
| Action | Pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI |
| Get extension by number | GET https://pbx.example.com/pbx/openapi.php/extensions/number/100?tenant=CANISTRACCI |
| Get live extension state | GET https://pbx.example.com/pbx/openapi.php/extensions/state?tenant=CANISTRACCI&number=100 |
| Count peers | GET https://pbx.example.com/pbx/openapi.php/countpeers?tenant=CANISTRACCI |
| Outbound caller IDs | GET https://pbx.example.com/pbx/openapi.php/outbounddids?tenant=CANISTRACCI |
| Resync a registered phone | POST https://pbx.example.com/pbx/openapi.php/phones/resync?tenant=CANISTRACCI |
| List tenants by code or name | GET /tenants |
| Tenant server placement | GET|POST https://pbx.example.com/pbx/openapi.php/tenants/TENANT_ID/placement |
| Download call recording | GET https://pbx.example.com/pbx/openapi.php/recordings/UNIQUEID?tenant=CANISTRACCI |
| Translations | GET https://pbx.example.com/pbx/openapi.php/translations?language=it-IT |
| Dial | POST https://pbx.example.com/pbx/openapi.php/dial?tenant=CANISTRACCI |
| Transfer live call | POST https://pbx.example.com/pbx/openapi.php/calls/transfer?tenant=CANISTRACCI |
| Queue agent action | POST https://pbx.example.com/pbx/openapi.php/queues/QUEUE_ID/agents/EXTENSION_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI |
| Queue agent action by queue number | POST https://pbx.example.com/pbx/openapi.php/queues/by-number/QUEUE_NUMBER/agents/EXTENSION_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI |
| External queue agent action | POST https://pbx.example.com/pbx/openapi.php/queues/QUEUE_ID/external-agents/EXTERNAL_AGENT_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI |
| External queue agent by queue number | POST https://pbx.example.com/pbx/openapi.php/queues/by-number/QUEUE_NUMBER/external-agents/EXTERNAL_AGENT_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI |
| All-queues extension action | POST https://pbx.example.com/pbx/openapi.php/queues/all/agents/EXTENSION_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI |
| All-queues external agent action | POST https://pbx.example.com/pbx/openapi.php/queues/all/external-agents/EXTERNAL_AGENT_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI |
| Queue History | GET https://pbx.example.com/pbx/openapi.php/queuelogs/history?tenant=CANISTRACCI |
| Raw queue logs | GET https://pbx.example.com/pbx/openapi.php/queuelogs/raw?tenant=CANISTRACCI |
| Queue log CSV download | GET https://pbx.example.com/pbx/openapi.php/queuelogs/raw/download?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI |
| Modify | PATCH https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI |
| Read firewall | GET https://pbx.example.com/pbx/openapi.php/firewall |
| Read user activity | GET https://pbx.example.com/pbx/openapi.php/useractivity |
| Read PBX nodes | GET https://pbx.example.com/pbx/openapi.php/nodes?live=false |
| List all extension states | GET https://pbx.example.com/pbx/openapi.php/extensions/states?tenant=CANISTRACCI |
Request bodies
For JSON writes, send Content-Type: application/json and a JSON body, for example with curl --data-binary. Use JSON booleans (true/false) for boolean options. A valid raw JSON body takes precedence over form fields, including when a client sends it with a form content type. Do not mix a JSON body with form fields. Ordinary form submissions and the legacy jsondata parameter remain supported; form-based clients can use jsondata to retain JSON types. Malformed JSON returns invalid_json.
Supported Objects
Each supported object has its own page in this chapter. Most configuration objects support CRUD operations. CDR, Simple CDR, AI Analysis, AI Logs, Queue Logs, Peer Counts and Translations are read-only endpoints. The examples use fictional IDs, numbers, names, and keys; replace them with values from the target PBX.
| Object | Primary path | Authentication scope | Operations or required fields |
|---|---|---|---|
| Auth Token | /auth/token | Global full API key | POST generate, DELETE reset |
| Dial | /dial | Tenant full API key | POST only; requires source and dest |
| Live Call Transfer | /calls/transfer | Writable full tenant or global API key; exact tenant required | POST blind or attended transfer of an active tenant-owned channel |
| CDR | /cdrs | Tenant API key or global key; GET only | GET only |
| Simple CDR | /simplecdrs | Tenant API key or global key; GET only | GET only |
| AI Analysis | /aianalysis | Tenant API key or global key; GET only | GET only; requires uniqueid |
| AI Logs | /ailogs | Tenant full or read-only API key, or global key; GET only | GET only; JSON or CSV; defaults to the current day |
| SMS and MMS | /sms, /mms | Concrete tenant required, including global keys. Full key for sending and attachment downloads; full or read-only key for history. | POST queue messages; GET filtered history, individual messages and MMS attachments. See SMS and MMS. |
| Faxes | /faxes, /faxes/{id}/download | Concrete tenant required, including global keys. Full key for sending/downloading; full or read-only key for metadata. | POST PDF/TIFF for delivery; GET history, status, attempts and PDF documents. See Faxes. |
| Peer Counts | /countpeers | Full or read-only tenant/global key; tenant required for tenant keys | GET counts per node and total; SIP monitored online peers plus PJSIP contacts. See Peer Counts. |
| Translations | /translations | Full or read-only global key | GET interface texts of one language with stable ID and version; /translations/languages lists the languages. See Translations. |
| Extension | /extensions | Tenant API key | number or ex_number; GET /extensions/state for live state |
| Tenant | /tenants | Global API key | te_name, te_code |
| User | /users | Global API key | us_username |
| User Profile | /userprofiles | Global API key | up_name |
| Routing Profile | /routingprofiles | Global API key | rp_name |
| Provider | /providers | Global API key | pr_name |
| Voicemail | /voicemails | Tenant API key | mailbox |
| IVR | /ivrs | Tenant API key | iv_name |
| Custom Destination | /customdestinations | Tenant API key or global key with global=1 | cu_name, cu_ct_id |
| Condition | /conditions | Tenant API key | co_type |
| Hunt List | /huntlists | Tenant API key | hu_name |
| DID | /dids | Tenant API key | di_number |
| Queue | /queues | Tenant API key; agent actions require a writable full key and an exact tenant | CRUD; GET /queues/{id}/state for live state; POST /queues/{queueId}/agents/{agentId}/{login|logout|pause|unpause} for agent actions; use POST /queues/by-number/{queueNumber}/agents/{agentId}/{login|logout|pause|unpause} to select a dialable queue number. See Queue Agent Actions. External agents use /queues/{queueId}/external-agents/{externalAgentId}/{login|logout|pause|unpause} or the /queues/by-number/{queueNumber}/external-agents/{externalAgentId}/{login|logout|pause|unpause} variant. Use ea_id; login accepts optional JSON integer penalty and booleans confirm and monitor_state. Both extension and external-agent login accept penalty 0 to 2147483647, default 0; repeated login preserves the current penalty. See Login with a Penalty. See External Agents. Use /queues/all/agents/{agentId}/{login|logout|pause|unpause} or /queues/all/external-agents/{externalAgentId}/{login|logout|pause|unpause} for bulk actions. Login targets every queue in the tenant; other actions target existing memberships only. HTTP 200 can contain per-queue failures; inspect success, summary, and results. See All-Queues Actions |
| Queue Logs | /queuelogs, /queuelogs/raw | Tenant or global full/read-only API key; one exact tenant is required | GET only; historical Queue History aggregation or raw events; JSON and paginated CSV downloads |
| Setting | /settings | Tenant API key or global key with global=1 | se_code |
| Media File | /mediafiles; /mediafiles/{id}/download | Tenant or global key for metadata; full key required to download audio | me_name; binary download examples |
| Music On Hold | /musiconholds | Tenant API key or global key with global=1 | mu_name |
| Paging Group | /paginggroups | Tenant API key | pa_name, pa_number |
| Conference Room | /conferencerooms | Tenant API key | cr_name, cr_number |
| Flow | /flows | Tenant API key | fl_name |
| Tenant Variable | /tenantvariables | Tenant API key | tv_al_id |
| DISA | /disas | Tenant API key | ds_name |
| Caller ID Blacklist | /calleridblacklists | Tenant API key or global key with global=1 | bl_callerid |
| Campaign | /campaigns | Tenant API key | ca_name |
| Campaign Number | /campaignnumbers | Tenant API key | cn_ca_id, cn_number |
| Cron Job | /cronjobs | Tenant API key or global key with global=1 | cr_name |
| Feature Code | /featurecodes | Tenant API key or global key with global=1 | fe_code |
| Short Number | /shortnumbers | Tenant API key or global key with global=1 | sn_number |
| Phone Book | /phonebooks | Tenant API key | pb_name |
| Phone Book Entry | /phonebookentries | Tenant API key | phonebook_id, at least one value |
| Provisioning Phone | /provisioningphones | Tenant API key | ph_name, ph_mac |
| Firewall | /firewall | Global key only; writes require a full global key | Read or change GeoIP/Fail2Ban options and allowed countries; read cached node status. See Firewall. |
| User Activity | /useractivity | Global full or read-only key; GET only | Read and search administrative user activity, with tenant and metadata filters, literal text search and pagination. See User Activity. |
| PBX Nodes | /nodes, /nodes/{id} | Full or read-only global key; omit tenant | Read node health, cron/devstate checks, services, OS updates, processing backlogs and optional live Asterisk/ODBC readings. See PBX Nodes. |
| Extension States | /extensions/states | Full or read-only tenant/global key; advanced keys require getExtensionStates and the selected tenant | All extension states in one array, including offline extensions, DND and active channel counts. Optional live=false. See Extension States. |
Errors
Errors are returned as JSON with an error code and message. Common errors include missing_api_key, invalid_api_key, tenant_not_found, invalid_json, missing_required_field, read_only_api_key, method_not_allowed, and not_found.
Phone book collection operations
The /phonebooks/{id}/entries endpoint supports downloading all stored contacts (GET), adding 1–500 contacts in an atomic batch (POST), and clearing only the selected phone book (DELETE). A tenant must be selected. Read-only keys can download; writes require a full key. See Phone Book for examples.
Configuration API additions (1.2.0)
Thirty additional resources cover Configuration/Settings and child records, with full create/read/update/delete operations. Extension technology conversion and voicemail messages/greetings now have dedicated endpoints. The generated internal directory is read-only; its source configuration objects remain editable.
See Additional Configuration Operations for complete request fields, scope rules and examples.
For a shared outbound caller ID selector with per-extension BLF, see the Flow example and PJSIP enrollment.
Scheduled calls and text-to-speech
POST /scheduledcalls?tenant=TENANT_CODE queues an outbound message call using prerecorded WAV audio or text with tts: true. TTS uses the tenant/global speech engine and default voice; text is limited to 5,000 UTF-8 bytes. A full API key is required. Set notbefore to schedule a future call, or omit it for the current time when no New Item Default overrides it. See Scheduled calls: text-to-speech, curl examples, regeneration and errors. Send "dispatch": true on creation, or use POST /scheduledcalls/{id}/dispatch, to start the call immediately instead of waiting for the once-a-minute worker; see Dispatch a call immediately.
Media File Downloads
GET /mediafiles/{id}/download?tenant=TENANTCODE returns the original audio file as a binary attachment. It requires a full tenant or global API key; read-only keys cannot download audio. Tenant scoping is enforced. Global full keys can use global=yes for shared media. List/detail media endpoints return metadata only, and download errors remain JSON. See Media File: Download a Media File for curl examples, response headers, storage support and errors.
SMS and MMS
POST /sms and POST /mms queue outgoing messages using the existing tenant SMS routing. HTTP 202 confirms queuing, not delivery. GET /sms and GET /mms list stored history with exact-match filters and cursor pagination; append /{id} for one message. MMS details list attachment IDs for GET /mms/{id}/attachments/{attachment_id}/download. Every request requires a concrete tenant. Sending and attachment downloads require a full API key; read-only keys can retrieve history text and attachment metadata. See SMS and MMS for request fields, curl examples, scheduling, limits, stored-status behavior and errors.
Fax Sending and Retrieval
POST /faxes converts an uploaded PDF/TIFF and queues it for the existing fax worker. HTTP 202 confirms queuing; GET /faxes/{id} returns status and recent delivery attempts. GET /faxes provides tenant-scoped history with filters and cursor pagination. GET /faxes/{id}/download returns the document as PDF from database or S3 storage. Sending/downloading require a full key, and every request requires a concrete tenant. See Faxes for complete request fields, uuencode/curl examples, scheduling, storage, limits and errors.
Media Generation, Uploads and DID Assignment
| Task | Documentation |
|---|---|
| Generate or replace saved audio | Media File: TTS, WAV/MP3 uploads and audio replacement. Use tts: true for generation or POST /mediafiles/{id}/upload for uploads. |
| Assign, transfer or release numbers | DID assignment: POST /dids/{id}/assign, owner checks, tenant permissions and pool behavior. |
| Update hold music | Music On Hold: ordered media selection, automatic playlist rebuilding and reload warnings. |
| Create or convert extensions | Extension availability, defaults and caller ID rules. |
Extension State
The Extension State endpoint returns live call-state information for one extension. It is a read-only OpenAPI endpoint and supports GET only.
This endpoint checks the extension registration server and queries Asterisk manager for the active channel, matching the purpose of proxyapi.php?reqtype=info&info=extstate. The regular extension GET endpoint still returns the cached st_states value.
Endpoint
GET https://pbx.example.com/pbx/openapi.php/extensions/state?tenant=CANISTRACCI&number=100
| Parameter | Required | Description |
|---|---|---|
tenant | Yes | Tenant code or tenant name. |
number | Yes, unless ext is used | Extension number to check. |
ext | Yes, unless number is used | Compatibility alias for number. |
key | No, if using headers | API key. The key can also be sent with X-API-Key or Authorization: Bearer. |
Examples
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions/state?tenant=CANISTRACCI&number=100"
curl -H "Authorization: Bearer TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions/state?tenant=CANISTRACCI&ext=100"
Response
When an active matching channel is found, the endpoint returns the live channel fields used to identify the call and the other party.
{
"UniqueID": "1717240000.42",
"LinkedID": "1717240000.42",
"Connected Line ID": "39055123456",
"Connected Line ID Name": "Customer",
"Context": "authenticated",
"Extension": "39055123456",
"Direction": "IN",
"OtherParty": "39055123456"
}
When the extension exists but no registration server is available, the endpoint returns:
{
"UniqueID": "KO",
"LinkedID": "Extension not registered",
"Connected Line ID": "",
"Connected Line ID Name": "",
"Context": "",
"Extension": "",
"Direction": "",
"OtherParty": ""
}
Notes
- The endpoint requires a tenant context, even when using a global API key.
- If the extension is registered but has no active channel, the live fields are returned empty.
- The response is always JSON.
All extension states
For the states of every extension in a tenant, use GET /extensions/states?tenant=CANISTRACCI. This aggregate endpoint returns an array with device state, DND and active channel count; the single-extension endpoint above keeps its existing call-detail object. Advanced Open API Keys require the dedicated getExtensionStates operation and access to the tenant. See Extension States for authentication, examples, response fields and snapshot limitations.
Auth Token
The Auth Token endpoint generates or resets temporary login tokens for web users and extension web identities. The generated token can be used in place of the user password on the MiRTA PBX login page.
Authentication Scope
This endpoint always requires the global full API key. Tenant API keys and read-only API keys are rejected. The token is returned only once when it is generated, so store it securely in the calling system if it needs to be delivered to the user.
| Operation | Path | API key |
|---|---|---|
| Generate token | POST https://pbx.example.com/pbx/openapi.php/auth/token | GLOBAL_API_KEY |
| Reset token | DELETE https://pbx.example.com/pbx/openapi.php/auth/token | GLOBAL_API_KEY |
Supported Identities
The user value is resolved in the same order as the legacy ProxyAPI token feature: MiRTA PBX web users first, then extension web users, then SIP extension usernames, then PJSIP endpoint IDs when the extension does not have a separate web user.
| Identity type | Matched field |
|---|---|
| Web user | us_users.us_username |
| Extension web user | ex_extensions.ex_webuser |
| SIP extension username | sipfriends.name when ex_webuser is empty |
| PJSIP endpoint ID | ps_endpoints.id when ex_webuser is empty |
Generate Token
Use validity set to ONCE for a single-use token, or provide a date/time string to make the token valid until that time.
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user":"100","validity":"ONCE"}' \
"https://pbx.example.com/pbx/openapi.php/auth/token"
Successful response:
{
"token": "generated-token-value",
"user": "100",
"target_type": "WEBPASSWORD"
}
Generate Expiring Token
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user":"api.operator","validity":"2026-06-30 23:59:59"}' \
"https://pbx.example.com/pbx/openapi.php/auth/token"
Reset Token
Resetting a token clears the stored token hash and validity for the resolved user identity.
curl -X DELETE \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user":"100"}' \
"https://pbx.example.com/pbx/openapi.php/auth/token"
Successful response:
{
"reset": true,
"user": "100",
"target_type": "WEBPASSWORD"
}
Important Notes
- Only the generated token value is returned. MiRTA PBX stores a SHA-256 hash of the token.
- A single-use token is cleared after a successful login.
- Generating a new token replaces any previous token for that user identity.
- This endpoint manages login tokens only. It does not create or rotate OpenAPI API keys.
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 a valid API key. |
admin_required | A global API key is required. |
read_only_api_key | The supplied key is read-only and cannot generate or reset tokens. |
missing_user | The request body did not include a user value. |
invalid_validity | The validity value was not ONCE and could not be parsed as a date/time. |
user_not_found | No supported web user or extension identity matched the requested user value. |
Dial
The Dial endpoint originates a call between a source extension and a destination number. It is the OpenAPI equivalent of proxyapi.php?reqtype=DIAL and uses the same PBX dialplan contexts.
The endpoint requires a tenant context and a full API key. Read-only API keys cannot originate calls.
Endpoint
POST https://pbx.example.com/pbx/openapi.php/dial?tenant=CANISTRACCI
| Parameter | Required | Description |
|---|---|---|
tenant | Yes | Tenant code or tenant name. |
key | No, if using headers | Full API key. The key can also be sent with X-API-Key or Authorization: Bearer. |
Request Body
| Field | Required | Description |
|---|---|---|
source | Yes | Source extension. Compatibility aliases are exten and ?exten. |
dest | Yes | Destination number. Compatibility alias is phone. |
dialtimeout | No | Originate timeout in seconds. Defaults to 30. |
timeout | No | Sets the dialplan variable SETTIMEOUT. |
sourceclid | No | Sets SETSOURCECLID. |
destclid | No | Sets SETDESTCLID. |
logqueueoutbound | No | Sets SETLOGQUEUEOUTBOUND. |
recording | No | Sets SETRECORDING. |
autoanswer | No | Sets AUTOANSWER. |
nofollow | No | Sets SETNOFOLLOWEXTENSION. |
account | No | Peer account name to set as SETPEERNAME. Use SOURCE to resolve it from the source extension. |
server | No | PBX node peer name to use when the source or destination registration server cannot be found. |
var | No | Comma-separated custom variables, for example campaign=summer,lead=42. |
vars | No | Custom variables as a JSON object. Variables are tenant-prefixed and listed in VARLIST. |
Example
curl -X POST "https://pbx.example.com/pbx/openapi.php/dial?tenant=CANISTRACCI" \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": "100",
"dest": "39055123456",
"dialtimeout": 30,
"sourceclid": "100",
"recording": "yes",
"vars": {
"campaign": "summer",
"lead": "42"
}
}'
Response
The response includes the Asterisk manager originate result, the generated originate ID, and the selected PBX node.
{
"Response": "Success",
"Message": "Originate successfully queued",
"ID": "6867c1c5.12345678",
"source": "100",
"dest": "39055123456",
"server": "pbx-node-1",
"node": "PBX Node 1"
}
Extension Dial API Key
Besides a tenant or global full API key, POST /dial accepts a Dial API Key configured on a SIP/PJSIP, Custom or Virtual extension. Enter a strong unique value in the extension's Dial API Key field and save the extension. The tenant and extension are inferred from the key, so tenant can be omitted. The key can originate calls and read the caller ID choices of its own tenant with GET /outbounddids; it cannot access any other object. Read-only API keys cannot originate calls.
One call leg is always the extension associated with the key, and the tenant and peer account are derived from that extension. A Dial API Key therefore cannot connect two unrelated numbers or select another extension's account. Use a different key on each extension: authentication is rejected as ambiguous if several extensions match the key.
| Field | Description |
|---|---|
external | External number to call. Aliases: dest, phone, destination and number. |
dialfirst | extension (default) dials the key's extension first and then the external number; external dials the external number first. Aliases: dial_order and order. |
Existing integrations can still send both source and dest; their order is honored when exactly one of them is the key's extension.
curl -X POST \
-H "X-API-Key: EXTENSION_DIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"external":"15551234567","dialfirst":"extension"}' \
"https://pbx.example.com/pbx/openapi.php/dial"
Outbound Caller IDs
GET /outbounddids lists the caller IDs a click-to-call client can offer. Full and read-only keys must supply one exact tenant code or name; a global key receives 409 ambiguous_tenant when the value matches several tenants. An extension Dial API Key uses its own tenant when tenant is omitted.
curl -H "X-API-Key: TENANT_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/outbounddids?tenant=CANISTRACCI"
[
{"number":"+12025550123","description":"Reception","can_receive_sms":true},
{"number":"0012345","description":"Sales","can_receive_sms":false}
]
Tenant DIDs follow the GUI caller ID format settings; verified outbound DIDs appear as entered. Each distinct number is returned once, including leading zeros or plus sign. A tenant without choices returns an empty array.
can_receive_sms is true when a DID of the tenant with inbound SMS configured matches the number, using the PBX prefixes. Spaces and hyphens are significant. The outbound DID option Allow SMS permits the number as an SMS sender and does not establish inbound capability.
Compatibility Notes
source=ACCOUNTresolves the source extension number from theaccountpeer name.account=SOURCEresolves the peer name from the source extension and setsSETPEERNAME.- If a source or destination registration server is found, that node is used. If no registration server is found, pass
serverwith the node peer name. - The endpoint returns JSON only.
Live Call Transfer
The Live Call Transfer endpoint transfers an active Asterisk channel. It supports blind transfer through the Asterisk Manager Redirect action and attended transfer through Atxfer.
Endpoint
POST https://pbx.example.com/pbx/openapi.php/calls/transfer?tenant=CANISTRACCI
A writable tenant or global full API key is required. The tenant query parameter must exactly match the tenant code or tenant name; wildcards and read-only keys are rejected. Before sending the manager action, the API verifies that the selected live channel has the selected tenant's account code.
Request Body
| Field | Required | Description |
|---|---|---|
channel | One of channel or uniqueid | Exact active Asterisk channel name, for example PJSIP/101-00000042. |
uniqueid | One of channel or uniqueid | Asterisk channel UniqueID. If both identifiers are supplied, they must resolve to the same live channel. |
destination | Yes | Destination run at priority 1 in the authenticated dialplan context. |
type | No | blind or attended. Defaults to blind. |
extra_channel | No | Optional second channel sent with a blind Redirect. It must be a different channel on the same PBX node and belong to the same tenant. It is not accepted for an attended transfer. |
server | No | PBX node peer name. Use it to limit channel discovery or disambiguate an identical channel name found on more than one node. |
The UniqueID returned by the Extension State endpoint can be supplied as uniqueid. Queue State also returns the live channel name for waiting callers.
Blind Transfer
A blind transfer immediately redirects the selected channel to the destination. This is the default type.
curl -X POST "https://pbx.example.com/pbx/openapi.php/calls/transfer?tenant=CANISTRACCI" \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"uniqueid": "1783680000.25",
"destination": "200",
"type": "blind"
}'
When a dual-channel redirect is required, include the other active channel in extra_channel. Both channels are checked on the same node and against the same tenant before Asterisk receives the request.
Attended Transfer
An attended transfer starts Asterisk's attended-transfer process on the selected channel. The person controlling that channel conducts the consultation and completes or cancels it using the normal Asterisk transfer behavior.
curl -X POST "https://pbx.example.com/pbx/openapi.php/calls/transfer?tenant=CANISTRACCI" \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "PJSIP/101-00000042",
"destination": "200",
"type": "attended"
}'
Response
{
"object": "call_transfer",
"status": "accepted",
"type": "blind",
"channel": "PJSIP/101-00000042",
"uniqueid": "1783680000.25",
"extra_channel": "",
"destination": "200",
"context": "authenticated",
"priority": 1,
"server": {
"id": 1,
"name": "PBX 01",
"peername": "pbx01"
},
"asterisk": {
"response": "Success",
"message": "Redirect successful",
"actionid": "openapi-transfer-..."
}
}
status=accepted means Asterisk accepted the manager action. It does not confirm that the destination answered or that the transfer completed successfully.
Channel Selection and Safety
- Channel discovery reads current state directly from the configured PBX nodes.
- Only channels whose Asterisk account code exactly matches the selected tenant can be transferred.
- If the same channel identifier exists on more than one node, the request returns an ambiguity error. Supply
serverto choose the intended node. - The channel and optional extra channel are checked again immediately before the transfer action to detect a call that ended or changed during the request.
- The dialplan context and priority are fixed to
authenticated,1and cannot be overridden by the request.
Relevant Errors
| HTTP status | Code | Description |
|---|---|---|
| 400 | exact_tenant_required | The tenant is missing, uses a wildcard, or does not exactly match the authenticated tenant. |
| 400 | missing_call_identifier | Neither channel nor uniqueid was supplied. |
| 400 | invalid_transfer_type | type is not blind or attended. |
| 400 | extra_channel_not_allowed | An extra channel was supplied for an attended transfer. |
| 404 | channel_not_found | No active channel matches the identifier and tenant. |
| 404 | extra_channel_not_found | The extra channel is not active on the selected node for the same tenant. |
| 409 | ambiguous_channel | More than one PBX node has a matching channel; supply server. |
| 409 | call_state_changed | The call changed between discovery and execution; obtain current channel information and retry. |
| 502 | channel_state_unavailable | Live channel state could not be read from the selected PBX nodes. |
| 502 | transfer_rejected | Asterisk rejected the Redirect or Atxfer action. |
| 502 | transfer_unconfirmed | The manager response was empty or incomplete. Asterisk may already have transferred the call; inspect the live call before retrying. |
CDR
The CDR endpoint is a read-only reporting endpoint. It supports GET only; create, update, and delete methods return method_not_allowed. Tenant API keys must include tenant=CANISTRACCI. Global API keys can query one tenant by code or name, or use SQL-style % wildcards in the tenant parameter.
Object Summary
| Property | Value |
|---|---|
| Object | cdr |
| Primary path | /cdrs |
| Path aliases | /cdr, /cdrs, /call, /calls |
| Supported method | GET |
| Default format | json |
| Compatibility formats | template, xml |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List records | GET https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI |
| Filter by date range | GET https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59 |
| Filter by ID from the path | GET https://pbx.example.com/pbx/openapi.php/cdrs/RECORD_ID?tenant=CANISTRACCI |
| Template/XML compatibility output | GET https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&format=template&template=Docs%20Export |
Query Parameters
| Parameter | Description |
|---|---|
tenant | Tenant code or tenant name. Global API keys can use % wildcards; tenant API keys are restricted to their tenant. |
start | Start date and time. Defaults to today at 00:00:00. |
end | End date and time. Defaults to today at 23:59:59. |
id | Comma-separated CDR ID values. A path value such as /cdrs/123 also maps to this filter. |
uniqueid | Comma-separated Asterisk unique ID values. |
linkedid | Comma-separated linked ID values used to group call legs. |
src | Comma-separated source values. |
firstdst | Comma-separated first destination values. |
disposition | Comma-separated disposition values such as ANSWERED, NO ANSWER, BUSY, or FAILED. |
direction | Direction filter based on the CDR userfield mapping. Accepted values are IN, OUT, IN,OUT, and OUT,IN. |
phone | Comma-separated phone values searched across src, dst, firstdst, lastdst, realsrc, and wherelanded. |
format | Response format. Defaults to json. Use template or xml for template-based compatibility output. |
template | Template name from the tenant XML templates. Used only with format=template or format=xml. |
contenttype | Optional Content-Type header for rendered template output. |
Response Fields
| Field | Description |
|---|---|
accountcode | Tenant code stored on the CDR. |
ID | Internal CDR row ID. |
start | Call start timestamp. |
answer | Answer timestamp when the call was answered. |
end | Call end timestamp. |
clid | Full caller ID string. |
realsrc | Normalized or real source value. |
firstdst | First dialed destination tracked by MiRTA PBX. |
duration | Total call duration in seconds. |
billsec | Answered talk time in seconds. |
disposition | Asterisk call disposition. |
cc_cost | Calculated tenant-side call cost when available. |
dcontext | Asterisk destination context. |
dstchannel | Destination channel. |
userfield | MiRTA PBX call marker, commonly including inbound or outbound direction information. |
uniqueid | Asterisk unique ID for the CDR leg. |
prevuniqueid | Previous unique ID for linked call-leg processing. |
lastdst | Last destination reached by the call. |
wherelanded | Final PBX object or destination where the call landed. |
src | Asterisk source value. |
dst | Asterisk destination value. |
lastapp | Last Asterisk application executed. |
srcCallID | Source SIP Call-ID when available. |
linkedid | Asterisk linked ID used to group related CDR legs. |
peeraccount | Asterisk peer account value. |
originateid | Origination tracking ID when available. |
cc_country | Rated country when rating data is available. |
cc_network | Rated network when rating data is available. |
pincode | PIN code associated with the call when present. |
cc_buy | Calculated buy-side cost when available. |
Important Notes
- When neither id nor uniqueid is supplied, the endpoint applies the start/end date range.
- When neither id nor linkedid is supplied, the endpoint also applies the start/end date range.
- Template and XML compatibility output require the request to resolve to exactly one tenant.
- The endpoint may repair attended-transfer and where-landed CDR metadata while preparing results.
- The list includes blind-transfer legs, as the Call History page does.
- The tenant number privacy settings apply: trailing digits of inbound caller numbers and outbound destination numbers are masked in JSON and template output. The
src,firstdstandphonefilters match the stored numbers before masking.
Attended transfer records
When GET /cdrs repairs a pending attended transfer, it follows linked CDRs within the tenant to find the original destination. The transfer retains its own billable duration. The destination selects the applicable rate from the tenant's client rate, with the most specific matching prefix used first.
For example, if a pending transfer links through a previous transfer to a call placed to 771, the pending leg uses the original call's destination and its own billable duration. Existing charges on the previous transfer are left as recorded. A self-linked leg uses its own destination. A missing reference or a cycle involving multiple records leaves the transfer pending. A transfer with a resolved destination and no matching rate can be normalized without adding a charge.
If a database error prevents the repair from completing, the API returns HTTP 500 with error code database_error. A later request retries legs that remain pending.
Results use the usual tenant privacy settings and CDR filters. OpenAPI uses its existing userfield normalization when it copies a note from the original leg. Web and scheduled repairs retain the original note text.
The firstdst and phone filters match the stored number and ignore the same Unicode formatting marks as MiRTA's existing number normalization. The returned CDR retains the stored number.
If several CDRs in the tenant share a call identifier and sequence, a stored charge is shown against the lowest visible CDR ID for that call and sequence. A missing CDR sequence matches a ledger sequence of zero. Filtering out the owning row does not move its charge to another row. For example, if rows 10 and 11 are both visible and match one charge of 0.34, row 10 shows 0.34 and row 11 has no share of that charge. Both call legs remain available in the report.
Examples
List Today CDRs
Returns CDR rows for the selected tenant using today as the default date range.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI"
CDR Date Range
Limits results to an explicit date and time window.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59"
CDR by Path ID
Uses the path segment after /cdrs as a CDR ID filter.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs/123456?tenant=CANISTRACCI"
CDR by ID and Unique ID
Filters by one or more CDR row IDs and one or more Asterisk unique IDs.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&id=123456%2C123457&uniqueid=1717240000.42"
CDR by Linked ID
Returns all matching CDR legs associated with one linked call.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&linkedid=1717240000.42"
CDR Source Destination and Disposition
Combines source, first destination, and disposition filters.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&src=100&firstdst=15551234567&disposition=ANSWERED"
CDR Direction
Filters by outbound calls using the MiRTA PBX CDR userfield mapping.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&direction=OUT"
CDR Phone Search
Searches phone values across the main CDR source and destination columns.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&phone=100%2C15551234567"
CDR Global Tenant Wildcard
Uses a global key and a tenant wildcard to query matching tenants.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CAN%25&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59"
CDR Template Output
Renders rows through a tenant XML/template definition. This requires exactly one tenant.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&format=template&template=Docs%20CDR%20Export&contenttype=text%2Fcsv"
Call Recording Download
GET /recordings/UNIQUEID downloads the recording of a call of the selected tenant, preferring an exact uniqueid match. The compatibility form is GET /recording?uniqueid=UNIQUEID. The response is the audio file, with its name in Content-Disposition.
curl -H "X-API-Key: TENANT_API_KEY" -OJ \
"https://pbx.example.com/pbx/openapi.php/recordings/1763712345.1234?tenant=CANISTRACCI"
When no audio is available, HTTP 404 returns recording_not_found or recording_unavailable, with error.recording_status and a boolean error.retryable:
recording_status | Meaning |
|---|---|
pending_upload | Recording started or a local file was found; the upload is still expected. |
not_recorded | All the call channels have closed without a recording. |
upload_failed | The upload failed. retryable tells whether recovery is expected. |
unavailable | The recording was catalogued but cannot be retrieved, or was discarded. |
unknown | Not enough information, for example for older calls. |
When retryable is true, wait the number of seconds in the Retry-After header before repeating the request: normally 30 seconds while an upload is pending, 15 minutes after a failed upload. A call that ended in the last five minutes can return unknown with retryable=true. Retries are no longer suggested after 24 hours without recording activity. not_recorded requires complete CEL data in Asterisk.
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 or tenant name is required when using a tenant API key. |
single_tenant_required | Template output requires the request to resolve to exactly one tenant. |
template_not_found | The selected XML/template output template does not exist for the tenant. |
database_error (HTTP 500) | Attended-transfer repair could not finish. Retry the request to process the remaining transfers. |
method_not_allowed | The endpoint is read-only and only supports GET. |
Simple CDR
The Simple CDR endpoint is a read-only reporting endpoint. It supports GET only; create, update, and delete methods return method_not_allowed. Tenant API keys must include tenant=CANISTRACCI. Global API keys can query one tenant by code or name, or use SQL-style % wildcards in the tenant parameter.
Object Summary
| Property | Value |
|---|---|
| Object | simplecdr |
| Primary path | /simplecdrs |
| Path aliases | /simplecdr, /simplecdrs, /simple_cdr, /simple_cdrs |
| Supported method | GET |
| Default format | json |
| Compatibility formats | template, xml |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List records | GET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI |
| Filter by date range | GET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59 |
| Filter by ID from the path | GET https://pbx.example.com/pbx/openapi.php/simplecdrs/RECORD_ID?tenant=CANISTRACCI |
| Template/XML compatibility output | GET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&format=template&template=Docs%20Export |
Query Parameters
| Parameter | Description |
|---|---|
tenant | Tenant code or tenant name. Global API keys can use % wildcards; tenant API keys are restricted to their tenant. |
start | Start date and time. Defaults to today at 00:00:00. |
end | End date and time. Defaults to today at 23:59:59. |
id | Comma-separated simple CDR ID values. A path value such as /simplecdrs/123 also maps to this filter. |
uniqueid | Comma-separated Asterisk unique ID values. |
calleridnum | Comma-separated caller ID number values. |
calleridname | Comma-separated caller ID name values. |
disposition | Comma-separated disposition values such as ANSWERED, NO ANSWER, BUSY, or FAILED. |
direction | Comma-separated simple CDR directions, such as IN, OUT, or LOCAL. |
dialednum | Comma-separated dialed number values. |
whoanswered | Comma-separated values for the extension, user, or object that answered. |
phone | Comma-separated phone values searched across sc_whoanswered, sc_calleridnum, and sc_dialednum. |
minduration | Minimum total call duration in seconds, exclusive. |
mintalktime | Minimum answered talk time in seconds, exclusive. |
format | Response format. Defaults to json. Use template or xml for template-based compatibility output. |
template | Template name from the tenant XML templates. Used only with format=template or format=xml. |
contenttype | Optional Content-Type header for rendered template output. |
Response Fields
| Field | Description |
|---|---|
sc_te_id | Internal tenant ID. |
tenantcode | Tenant code. |
sc_start | Simple CDR start timestamp. |
sc_direction | Simple direction value, such as IN, OUT, or LOCAL. |
sc_calleridnum | Caller ID number. |
sc_calleridname | Caller ID name. |
sc_dialednum | Dialed number. |
sc_disposition | Call disposition. |
sc_duration | Total call duration in seconds. |
sc_billsec | Answered talk time in seconds. |
sc_uniqueid | Asterisk unique ID represented by the simple CDR row. |
sc_whoanswered | Extension, user, or object that answered the call. |
Template Variables
When format=template or format=xml is used, variables inside the {row_loop} section are replaced for each returned row.
| Variable | Description |
|---|---|
{$end} | Computed end timestamp from sc_start plus sc_duration seconds. |
{$clid} | CDR-style caller ID formatted as "sc_calleridname" <sc_calleridnum>. |
{$callerid_number} | Alias for sc_calleridnum. |
{$callerid_name} | Alias for sc_calleridname. |
{$firstdst} | Alias for sc_dialednum. |
{$talk_time} | Alias for sc_billsec. |
{$who_answered} | Alias for sc_whoanswered. |
Important Notes
- When neither id nor uniqueid is supplied, the endpoint applies the start/end date range.
- The mintalktime filter uses the stored simple CDR billsec/talk-time value.
- The tenant number privacy settings apply: trailing digits of the caller number on inbound calls and of the dialed number on outbound calls are masked in JSON and template output. The
calleridnum,dialednumandphonefilters match the stored numbers before masking. - Template and XML compatibility output require the request to resolve to exactly one tenant.
Examples
List Today Simple CDRs
Returns simplified call history rows for the selected tenant using today as the default date range.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI"
Simple CDR Date Range
Limits simple CDR results to an explicit date and time window.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59"
Simple CDR by Path ID
Uses the path segment after /simplecdrs as a simple CDR ID filter.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs/98765?tenant=CANISTRACCI"
Simple CDR by ID and Unique ID
Filters by one or more simple CDR row IDs and unique IDs.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&id=98765%2C98766&uniqueid=1717240000.42"
Simple CDR Caller and Dialed Number
Combines caller number, caller name, and dialed number filters.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&calleridnum=15551234567&calleridname=Docs%20Caller&dialednum=100"
Simple CDR Direction and Disposition
Filters by simple direction values and disposition.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&direction=IN%2COUT&disposition=ANSWERED"
Simple CDR Who Answered
Filters by the extension or object that answered the call.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&whoanswered=100"
Simple CDR Phone Search
Searches across caller ID number, dialed number, and who answered.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&phone=100%2C15551234567"
Simple CDR Minimum Durations
Returns calls longer than the supplied total duration and talk-time thresholds.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&minduration=30&mintalktime=10"
Simple CDR Global Tenant Wildcard
Uses a global key and a tenant wildcard to query matching tenants.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CAN%25&start=2026-06-01%2000%3A00%3A00&end=2026-06-01%2023%3A59%3A59"
Simple CDR Template Output
Renders simple CDR rows through a tenant XML/template definition. This requires exactly one tenant.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&format=template&template=Docs%20Simple%20CDR%20Export&contenttype=text%2Fcsv"
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 or tenant name is required when using a tenant API key. |
single_tenant_required | Template output requires the request to resolve to exactly one tenant. |
template_not_found | The selected XML/template output template does not exist for the tenant. |
method_not_allowed | The endpoint is read-only and only supports GET. |
Extension
The Extension 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 | extension |
| Primary path | /extensions |
| ID field | ex_id |
| Label field | ex_number |
| Primary source table | ex_extensions |
| Required on create | number or ex_number |
| Path aliases | /extensions |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
number | ex_number |
name | ex_name |
tech | ex_tech |
sipusername | username |
mailbox | ex_mailbox |
email | ex_email |
password | technology secret/password |
callgroups | ex_callgroup |
pickupgroups | ex_pickupgroup |
realextensions | virtual_items |
Emergency Location Assignment
Use ex_el_id to assign or clear the emergency location of an extension. The location must already exist in the same tenant under Configuration > Settings > Emergency Locations. Use a writable API key and the normal tenant scope.
| Field | Type | Meaning |
|---|---|---|
ex_el_id | Integer, 0 to 2147483647 | A positive value assigns an existing location from the extension's tenant. 0 clears the assignment (None). Omitting the field when updating preserves the current assignment. |
The field is accepted at the top level or inside an extension or ex_extensions object. It is available for SIP, PJSIP, custom and virtual extensions. It can also be included when creating an extension; omission on create uses the normal creation defaults.
Assign an Emergency Location
Replace 7 with an existing emergency location ID from the selected tenant.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ex_el_id": 7}' \
"https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI"
Clear the Emergency Location
Send this body to the same update endpoint:
{
"ex_el_id": 0
}
Nested Request Form
{
"ex_extensions": {
"ex_el_id": 7
}
}
The single-extension response includes ex_el_id as an integer, with 0 meaning no assigned location.
Validation
Missing or foreign-tenant location IDs return HTTP 400 with error code invalid_emergency_location. Negative values, booleans, arrays, null, empty strings and values outside the supported integer range are also rejected. Decimal integer strings such as "7" or "0" are accepted. Validation occurs before other extension or protocol fields are written, so an invalid assignment does not partially apply accompanying edits. Read-only API keys remain unable to modify extensions.
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 |
|---|---|
EXT-UNCONDITIONAL | unconditional |
EXT-NOANSWER | onnoanswer, noanswer, no_answer |
EXT-BUSY | onbusy, busy |
EXT-OFFLINE | onoffline, offline |
EXT-ONCONDITION | oncondition, condition |
EXT-DIALBYNAME | dialbyname, dial_by_name |
EXT-ONLYALLOWCALL | onlyallowcall, only_allow_call |
EXT-DONOTCALL | donotcall, do_not_call |
Important Notes
- Supported technologies are SIP, PJSIP, CUSTOM, and VIRTUAL.
- When username is not supplied, the API generates number-tenantcode, for example 100-CANISTRACCI.
- Nested technology data can be supplied with sipfriends, ps_endpoints, ps_aors, ps_auths, ce_customextensions, or ve_virtualextensions.
Availability, Defaults and Caller ID
New SIP and PJSIP extensions start with state and st_state set to UNAVAILABLE until registration or reachability is reported by the PBX. A registration during creation may already be reflected in the response. Ordinary updates preserve runtime state. Converting to SIP or PJSIP also initializes the new peer as unavailable. Use the matching device-state receiver update (version 87) for stale peer-state reconciliation on registration.
Creation applies global and tenant New Item Defaults before validation. Explicit request fields override defaults, including supplied empty, zero or null values where the field allows them. Empty defaults for nullable SIP/PJSIP ENUM fields represent inherited system settings rather than an invalid empty ENUM value.
Caller ID must be valid UTF-8 and fit the installed SIP/PJSIP caller ID column character limit. Invalid values return invalid_callerid or callerid_too_long with HTTP 400 before dependent extension records or mailboxes are created. A generated caller ID includes the extension name and number, so a long name can exceed the limit.
SIP-to-PJSIP and PJSIP-to-SIP conversion preserve the existing caller ID, including explicit empty or null values. If conversion reports an overlong caller ID, shorten the existing caller ID in a separate update before retrying. For conversion from a custom or virtual extension, shorten its name in a separate request if the generated caller ID is too long.
Caller ID Selector Enrollment
The caller ID selector is opt-in. The endpoint must be PJSIP, must allow subscriptions, must use the standard authenticated call context, and must belong to a non-trunk extension with a unique number of 1–16 digits in its tenant. Update all PBX nodes before enrolling endpoints.
In the web endpoint editor enable Caller ID selector BLF. Through the API, use the protected tenant subscription context. For tenant ID 42 and extension resource ID 11, send PATCH /extensions/11?tenant=OFFICE with the following body.
{
"subscribe_context": "mirta-cid-42"
}
Keep an endpoint's custom subscription context if it is needed for other monitoring. See Flow for the selector and dial codes.
Examples
List Extensions
Returns extension ID, number, name, and technology for the tenant.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI"
Get Extension
Reads one extension by internal ID and includes related technology data.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Get Extension by Number
Reads an extension by PBX number. Keep the tenant parameter when the same number may exist in multiple tenants.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions/number/100?tenant=CANISTRACCI"
Create PJSIP Extension
Creates a PJSIP extension and optional endpoint/AOR details.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"number": "100",
"name": "Ada Rivera",
"tech": "PJSIP",
"password": "change-this-secret",
"email": "ada.rivera@example.com",
"ps_endpoints": {
"transport": "transport-udp",
"direct_media": "no"
},
"ps_aors": {
"max_contacts": 1,
"remove_existing": "yes"
}
}' \
"https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI"
Create SIP Extension
Creates a chan_sip extension and optional SIP peer fields.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"number": "101",
"name": "Bruno Long",
"tech": "SIP",
"password": "change-this-secret",
"sipfriends": {
"host": "dynamic",
"nat": "force_rport,comedia"
}
}' \
"https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI"
Create Custom Extension
Creates an extension that points to a custom dial string or custom endpoint behavior.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"number": "102",
"name": "Custom Doorphone",
"tech": "CUSTOM",
"ce_customextensions": {
"ce_peername": "doorphone-main",
"ce_destination": "Local/100@from-internal"
}
}' \
"https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI"
Create Virtual Extension
Creates a virtual extension and maps it to real extension IDs.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"number": "103",
"name": "After Hours Virtual",
"tech": "VIRTUAL",
"realextensions": [
100,
101
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI"
Edit Extension
Updates only the supplied extension fields. To switch between SIP and PJSIP, use the dedicated extension technology conversion endpoint, or a technology-only PATCH. Send other extension edits separately.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Ada Rivera - Desk",
"email": "ada.desk@example.com",
"callgroups": [
1
],
"pickupgroups": [
1
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Delete Extension
Deletes the extension, its technology row, and extension destinations.
curl -X DELETE \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension Unconditional Destination
Sets the EXT-UNCONDITIONAL destination using the unconditional alias.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"unconditional": [
"EXT-101"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension No Answer Destination
Sets the EXT-NOANSWER destination using the onnoanswer alias.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"onnoanswer": [
"EXT-101"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension Busy Destination
Sets the EXT-BUSY destination using the onbusy alias.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"onbusy": [
"EXT-101"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension Offline Destination
Sets the EXT-OFFLINE destination using the onoffline alias.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"onoffline": [
"EXT-101"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension On Condition Destination
Sets the EXT-ONCONDITION destination using the oncondition alias.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"oncondition": [
"EXT-101"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension Dial by Name Destination
Sets the EXT-DIALBYNAME destination using the dialbyname alias.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dialbyname": [
"EXT-101"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension Only Allow Call Destination
Sets the EXT-ONLYALLOWCALL destination using the onlyallowcall alias.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"onlyallowcall": [
"EXT-101"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension Do Not Call Destination
Sets the EXT-DONOTCALL destination using the donotcall alias.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"donotcall": [
"EXT-101"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension Destinations Object Form
The destination aliases are convenient, but integrations can also send the database destination type names inside the destinations object.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destinations": {
"EXT-BUSY": [
"EXT-101"
],
"EXT-NOANSWER": [
"VOICEMAIL-100"
]
}
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI"
Extension UNCONDITIONAL Destination
Updates the EXT-UNCONDITIONAL 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 '{
"unconditional": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI"
Extension NOANSWER Destination
Updates the EXT-NOANSWER 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 '{
"onnoanswer": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI"
Extension BUSY Destination
Updates the EXT-BUSY 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 '{
"onbusy": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI"
Extension OFFLINE Destination
Updates the EXT-OFFLINE 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 '{
"onoffline": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI"
Extension ONCONDITION Destination
Updates the EXT-ONCONDITION 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 '{
"oncondition": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI"
Extension DIALBYNAME Destination
Updates the EXT-DIALBYNAME 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 '{
"dialbyname": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI"
Extension ONLYALLOWCALL Destination
Updates the EXT-ONLYALLOWCALL 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 '{
"onlyallowcall": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/OBJECT_ID?tenant=CANISTRACCI"
Extension DONOTCALL Destination
Updates the EXT-DONOTCALL 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 '{
"donotcall": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/extensions/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. |
Extension technology conversion
The endpoint requires a full API key and the appropriate tenant scope. The {id} is the extension database ID, not its dialled number. Use {"technology":"PJSIP"} for SIP-to-PJSIP conversion, or {"technology":"SIP"} to change back. Send other extension edits separately.
POST /extensions/{id}/technology changes an extension between SIP, PJSIP, CUSTOM and VIRTUAL in one transaction. The extension ID, number, peer name, routing and queue memberships are preserved. SIP/PJSIP conversions retain the password and codec list unless replacements are supplied. Other technology fields are initialized from the target technology’s new-item defaults. Review target-specific settings after conversion; settings without an equivalent in the new technology are not migrated.
curl -X POST -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"technology":"PJSIP"}' \
'https://pbx.example.com/pbx/openapi.php/extensions/8/technology?tenant=TENANT_CODE'
Optional fields: secret (or password), allow (codec string), custom, virtual, providers (CUSTOM provider IDs), and items (VIRTUAL member extension IDs). The custom object accepts ce_dialoption, ce_auth_type, ce_auth_parameter, ce_usecid, ce_custom_param1. The virtual object accepts supported columns among ve_callerid, ve_mailbox, ve_timeout, ve_strategy; unavailable installation columns are rejected. Send other extension edits in a separate request.
A technology-only PATCH to /extensions/{id} with {"tech":"PJSIP"} also converts. Query routing: POST ?object=extension&action=technology&id=8&tenant=TENANT_CODE. Shared/custom PJSIP authentication or AOR links block conversion until normalized. An extension already used inside another virtual extension cannot become virtual. The response identifies the previous and new technology; a live PBX refresh failure returns a warning after the database change has committed. A database failure rolls the conversion back.
See Additional Configuration Operations for complete request fields, scope rules and examples.
All extension states
To retrieve all extension states in one request, use GET /extensions/states?tenant=CANISTRACCI. It includes offline extensions and reports device state, DND and active channel counts. Add live=false for cached states only. The basic GET /extensions list remains unchanged. Advanced Open API Keys require the dedicated getExtensionStates operation and access to the tenant. See Extension States for authentication, examples, response fields and snapshot limitations.
Tenant
The Tenant object is supported by the MiRTA PBX OpenAPI endpoint. This object is managed at system scope and requires a global API key.
Object Summary
| Property | Value |
|---|---|
| Object | tenant |
| Primary path | /tenants |
| ID field | te_id |
| Label field | te_name |
| Primary source table | te_tenants |
| Required on create | te_name, te_code |
| Path aliases | /tenants |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/tenants |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID |
| Create | POST https://pbx.example.com/pbx/openapi.php/tenants |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | te_name |
code | te_code |
billingcode | te_billingcode |
billing_code | te_billingcode |
timezone | te_timezone |
routing_profile_id | te_rp_id |
campaign_routing_profile_id | te_campaign_rp_id |
fax_routing_profile_id | te_fax_rp_id |
Examples
List Tenants
Returns the tenants visible to the key and scope.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/tenants"
To filter the list with a full or read-only legacy global key, pass tenant as a tenant code or name. The selector uses SQL LIKE. Use % for any sequence of characters or _ for a single character. Omit tenant to list all tenants available to the key.
curl --get 'https://pbx.example.com/pbx/openapi.php/tenants' \
-H 'X-API-Key: GLOBAL_API_KEY' \
--data-urlencode 'tenant=%Example%'
An advanced key needs global permission and access to listTenants. Supply one exact code or name within its allowed scope, or omit tenant to list that scope.
| HTTP status | Meaning |
|---|---|
| 400 | invalid_tenant when the selector is supplied in a form other than a string. |
| 404 | tenant_not_found when the selector has no match. |
| 409 | ambiguous_tenant when the exact selector for an advanced key is ambiguous. |
| 500 | database_error when the legacy tenant lookup or the tenant list query fails. |
| 503 | api_key_unavailable when the advanced key policy or exact tenant lookup is unavailable. |
Get Tenant
Reads one object by its internal ID.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID"
Create Tenant
Creates a new object. Use the short aliases shown above or the source field names.
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Tenant",
"code": "DOCSAPI",
"timezone": "Europe/Rome"
}' \
"https://pbx.example.com/pbx/openapi.php/tenants"
Edit Tenant
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"routing_profile_id": 3,
"te_payment_type": "Post Paid"
}' \
"https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID"
Delete Tenant
Deletes the object. Check references before deleting configuration used by routing or reporting.
curl -X DELETE \
-H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID"
Tenant Initialization
POST /tenants requires a full global API key. It creates the tenant and its related records in one transaction.
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme",
"code": "ACME",
"parking": {"start": 700, "end": 720, "hosted": ""},
"user_ids": [12],
"usergroup_ids": [3]
}' \
"https://pbx.example.com/pbx/openapi.php/tenants"
- Global new-item defaults for tenants and parking apply first; explicit request values override them. Tenant settings are copied from the global new-item defaults.
APIKEYandREADONLYAPIKEYdefaults set toRANDOM16become generated 16-character keys. EmptyPARKTIMEOUT,MAXCALLDURATIONandDIALTIMEOUTreceive 120, 7200 and 60. - One parking lot named after the tenant code is created, by default 700–720 on an automatic server. Use the
parkingobject, orpk_start/pk_end/pk_hosted. Asterisk is not reloaded and no server placement is performed. user_idsandusergroup_idsgive existing users and groups access to the tenant. The default custom destination restriction mode is applied;ctselected, an array of custom type IDs, overrides the configured exceptions.- Codes need at least two characters without spaces. Duplicate codes return 409 and the tenant license limit is checked before saving.
- The response includes an
initializationsummary. Errors includerolled_back:trueconfirms that nothing was saved. HTTP503 tenant_commit_unknownreturns thetenant_id; inspect that tenant before retrying.
These inputs apply only to creation. To change an existing tenant, use the tenant, settings, parking, user and user-group operations.
Tenant Server Placement
GET /tenants/TENANT_ID/placement shows which cluster servers a tenant uses, with a full or read-only global key. POST changes it and requires a full global key. Tenant keys cannot inspect or change placement. Use the numeric tenant ID in the path and omit tenant.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/tenants/42/placement"
curl -X POST -H "X-API-Key: GLOBAL_API_KEY" -H "Content-Type: application/json" \
-d '{"settings":{"preferred_queue_node_id":2},"assignments":{"queues":2}}' \
"https://pbx.example.com/pbx/openapi.php/tenants/42/placement"
GET returns the placement settings, the raw stored preferences, the resolved defaults, the current assignment of each service and the server inventory with eligibility and diagnostics. Eligible means registered with a usable peer name; it does not prove that the server is healthy.
| Body object | Meaning |
|---|---|
settings | Defaults and preferences for new objects: cronjob_node_id, campaign_node_id, fax_node_id, preferred_queue_node_id, preferred_parking_node_id. Existing objects are not moved. |
assignments | Moves every current object of a service in the tenant: queues, parkinglots, conferences, campaigns, cronjobs. System jobs and UPLOADRECORDING jobs are excluded. |
- Values are server IDs, not peer names. Supply at least one field; omitted fields are preserved.
0clears a preference or explicit host so the object inherits the default or automatic placement again. - Changing
campaign_node_idalso updates the tenantDEFAULTCAMPAIGNSERVERsetting. - Stop running campaigns before changing their placement. A running or pending cron job returns
409 placement_busy; database lock conflicts also return 409, so reload and retry later. - Queue changes are notified to every registered server after saving;
queue_refreshreports which servers accepted the notification. Parking modules are not reloaded, so moving parking lots may need a scheduled restart, as in the web editor. - The save is a single transaction. Errors include
rolled_back;503 placement_commit_unknownmeans the outcome is unknown, so inspect GET before retrying.
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. |
User
The User object is supported by the MiRTA PBX OpenAPI endpoint. This object is managed at system scope and requires a global API key.
Object Summary
| Property | Value |
|---|---|
| Object | user |
| Primary path | /users |
| ID field | us_id |
| Label field | us_username |
| Primary source table | us_users |
| Required on create | us_username |
| Path aliases | /user, /users, /nuser, /nusers, /us_user, /us_users |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/users |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID |
| Create | POST https://pbx.example.com/pbx/openapi.php/users |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID |
Accepted Field Aliases
| Request field | Source field |
|---|---|
username | us_username |
name | us_username |
description | us_description |
email | us_email |
profile_id | us_up_id |
userprofile_id | us_up_id |
password | us_password |
use_ldap | us_useldap |
ip_filter | us_ipfilter |
two_factor_type | us_2fatype |
never_expire | us_neverexpire |
dynamic_ip | us_dynamicip |
Examples
List Users
Returns the users visible to the key and scope.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/users"
Get User
Reads one object by its internal ID.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID"
Create User
Creates a new object. Use the short aliases shown above or the source field names.
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "docs-api-user",
"description": "Documentation API user",
"email": "docs-api-user@example.com",
"profile_id": 2,
"password": "change-this-password",
"tenant_ids": [
1
]
}' \
"https://pbx.example.com/pbx/openapi.php/users"
Edit User
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "docs-api-user-updated@example.com",
"force_change": true
}' \
"https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID"
Delete User
Deletes the object. Check references before deleting configuration used by routing or reporting.
curl -X DELETE \
-H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID"
User Tenant and Routing Profile Relations
Replaces the user tenant, routing profile, and allowed profile relations with the supplied IDs.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tenant_ids": [
1
],
"routingprofile_ids": [
3
],
"allowed_userprofile_ids": [
2
]
}' \
"https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID"
User Object Restrictions
Restricts the user to specific queues, extensions, or providers.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"queue_restrictions": [
12
],
"extension_restrictions": [
45
],
"provider_restrictions": [
7
]
}' \
"https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID"
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. |
User Profile
The User Profile object is supported by the MiRTA PBX OpenAPI endpoint. This object is managed at system scope and requires a global API key.
Object Summary
| Property | Value |
|---|---|
| Object | userprofile |
| Primary path | /userprofiles |
| ID field | up_id |
| Label field | up_name |
| Primary source table | up_userprofiles |
| Required on create | up_name |
| Path aliases | /userprofile, /userprofiles, /user_profile, /user_profiles |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/userprofiles |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID |
| Create | POST https://pbx.example.com/pbx/openapi.php/userprofiles |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | up_name |
description | up_description |
reserved | up_reserved |
userpanel | up_userpanel |
user_panel | up_userpanel |
extension_user_profile | up_userpanel |
Examples
List User Profiles
Returns the user profiles visible to the key and scope.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/userprofiles"
Get User Profile
Reads one object by its internal ID.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID"
Create User Profile
Creates a new object. Use the short aliases shown above or the source field names.
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Profile",
"description": "Documentation profile",
"user_panel": "yes"
}' \
"https://pbx.example.com/pbx/openapi.php/userprofiles"
Edit User Profile
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated documentation profile"
}' \
"https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID"
Delete User Profile
Deletes the object. Check references before deleting configuration used by routing or reporting.
curl -X DELETE \
-H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID"
User Profile Privileges
Replaces the profile privilege list. Privilege IDs must exist in the system privilege table.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"privileges": [
{
"id": 1,
"param1": "read"
},
{
"id": 2,
"param1": "write"
}
]
}' \
"https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID"
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. |
Routing Profile
The Routing Profile object is supported by the MiRTA PBX OpenAPI endpoint. This object is managed at system scope and requires a global API key.
Object Summary
| Property | Value |
|---|---|
| Object | routingprofile |
| Primary path | /routingprofiles |
| ID field | rp_id |
| Label field | rp_name |
| Primary source table | rp_routingprofiles |
| Required on create | rp_name |
| Path aliases | /routingprofiles, /routing_profiles, /routing_profile |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/routingprofiles |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID |
| Create | POST https://pbx.example.com/pbx/openapi.php/routingprofiles |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | rp_name |
description | rp_description |
type | rp_type |
Examples
List Routing Profiles
Returns the routing profiles visible to the key and scope.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/routingprofiles"
Get Routing Profile
Reads one object by its internal ID.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID"
Create Routing Profile
Creates a new object. Use the short aliases shown above or the source field names.
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Voice Routing",
"description": "Documentation outbound routing",
"type": "VOICE"
}' \
"https://pbx.example.com/pbx/openapi.php/routingprofiles"
Edit Routing Profile
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated documentation routing profile"
}' \
"https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID"
Delete Routing Profile
Deletes the object. Check references before deleting configuration used by routing or reporting.
curl -X DELETE \
-H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID"
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. |
Provider
The Provider object is supported by the MiRTA PBX OpenAPI endpoint. This object is managed at system scope and requires a global API key.
Object Summary
| Property | Value |
|---|---|
| Object | provider |
| Primary path | /providers |
| ID field | pr_id |
| Label field | pr_name |
| Primary source table | pr_providers |
| Required on create | pr_name |
| Path aliases | /provider, /providers |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/providers |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID |
| Create | POST https://pbx.example.com/pbx/openapi.php/providers |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | pr_name |
peername | pr_peername |
peer_name | pr_peername |
tech | pr_tech |
host | pr_host |
disabled | pr_disabled |
penalty | pr_penalty |
realtime | pr_userealtime |
use_realtime | pr_userealtime |
calleridmod_id | pr_ca_id |
callerid | pr_callerid |
caller_id | pr_callerid |
callerid_number | pr_callerid |
caller_id_number | pr_callerid |
calleridname | pr_calleridname |
callerid_name | pr_calleridname |
caller_id_name | pr_calleridname |
did_mod_id | pr_did_ca_id |
max_out_channels | pr_maxoutchannels |
ignore_sip_cause | pr_ignoresipcause |
ignore_busy | pr_ignorebusy |
sms_protocol | pr_smsprotocol |
sms_url | pr_smsurl |
sms_user | pr_smsuser |
sms_password | pr_smspassword |
canreinvite | sipfriends.canreinvite for chan_sip direct media |
direct_media | ps_endpoints.direct_media for PJSIP direct media |
Important Notes
- Providers are global system objects and always require a global API key.
- Readonly global API keys can list and read providers, but create, update, and delete require the full global API key.
- SIP providers manage the related sipfriends realtime row when realtime is enabled.
- PJSIP providers manage the related ps_endpoints, ps_aors, ps_auths, and ps_endpoint_id_ips rows when realtime is enabled.
- When a provider changes technology, the API removes old realtime rows before creating rows for the new technology.
- Provider callerid and callerid_name values are optional. When set, calls routed through the provider use those caller ID values instead of extension-derived caller ID.
- Use canreinvite for chan_sip direct media values. Use direct_media for PJSIP direct media values.
Examples
List Providers
Returns the providers visible to the key and scope.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/providers"
Get Provider
Reads one object by its internal ID.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID"
Create Provider
Creates a new object. Use the short aliases shown above or the source field names.
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API PJSIP Provider",
"peername": "docs-pjsip-provider",
"tech": "PJSIP",
"realtime": "on",
"host": "198.51.100.20",
"username": "docs-trunk",
"password": "change-this-secret",
"transport": "UDP",
"codecs": [
"ulaw",
"alaw"
],
"qualify": "yes",
"qualifyfreq": 60,
"direct_media": "no",
"callerid": "+15551230000",
"callerid_name": "Docs API Provider"
}' \
"https://pbx.example.com/pbx/openapi.php/providers"
Edit Provider
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"disabled": "",
"penalty": 10,
"max_out_channels": 25,
"callerid": "+15551230001",
"callerid_name": "Docs API Main"
}' \
"https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID"
Delete Provider
Deletes the object. Check references before deleting configuration used by routing or reporting.
curl -X DELETE \
-H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID"
Create SIP Provider
Creates a chan_sip provider and the related sipfriends realtime peer.
curl -X POST \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API SIP Provider",
"peername": "docs-sip-provider",
"tech": "SIP",
"realtime": "on",
"host": "198.51.100.10",
"username": "docs-sip-trunk",
"password": "change-this-secret",
"transport": "UDP",
"nat": "force_rport,comedia",
"codecs": [
"ulaw",
"alaw"
],
"canreinvite": "no"
}' \
"https://pbx.example.com/pbx/openapi.php/providers"
Edit PJSIP Realtime Settings
Updates provider fields and related PJSIP endpoint, AOR, auth, and endpoint identification rows.
curl -X PATCH \
-H "X-API-Key: GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"host": "198.51.100.21",
"password": "new-secret",
"direct_media": "no",
"sendrpid": "pai",
"codecs": [
"ulaw",
"alaw",
"opus"
]
}' \
"https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID"
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. |
Voicemail
The Voicemail 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 | voicemail |
| Primary path | /voicemails |
| ID field | uniqueid |
| Label field | mailbox |
| Primary source table | voicemail |
| Required on create | mailbox |
| Path aliases | /voicemails |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/voicemails?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/voicemails/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/voicemails?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/voicemails/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/voicemails/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | fullname |
number | mailbox |
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 |
|---|---|
VOICEMAIL-OPERATOR | operator, voicemail_operator |
VOICEMAIL-FOLLOW | follow, voicemail_follow |
VOICEMAIL-BROADCAST | broadcast, voicemail_broadcast |
Examples
List Voicemails
Returns the voicemails visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/voicemails?tenant=CANISTRACCI"
Get Voicemail
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/voicemails/OBJECT_ID?tenant=CANISTRACCI"
Create Voicemail
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 '{
"number": "240",
"name": "Docs API Mailbox",
"email": "voicemail@example.com",
"password": "1234"
}' \
"https://pbx.example.com/pbx/openapi.php/voicemails?tenant=CANISTRACCI"
Edit Voicemail
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Mailbox Updated",
"email": "voicemail-updated@example.com"
}' \
"https://pbx.example.com/pbx/openapi.php/voicemails/OBJECT_ID?tenant=CANISTRACCI"
Delete Voicemail
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/voicemails/OBJECT_ID?tenant=CANISTRACCI"
Voicemail OPERATOR Destination
Updates the VOICEMAIL-OPERATOR 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 '{
"operator": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/voicemails/OBJECT_ID?tenant=CANISTRACCI"
Voicemail FOLLOW Destination
Updates the VOICEMAIL-FOLLOW 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 '{
"follow": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/voicemails/OBJECT_ID?tenant=CANISTRACCI"
Voicemail BROADCAST Destination
Updates the VOICEMAIL-BROADCAST 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 '{
"broadcast": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/voicemails/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. |
Voicemail messages and greetings
| Resource | Supported methods |
|---|---|
| /voicemails/{id}/messages | GET list, POST create |
| /voicemails/{id}/messages/{messageId} | GET, PUT, PATCH, DELETE |
| /voicemails/{id}/greetings | GET list, POST create |
| /voicemails/{id}/greetings/{name} | GET, PUT, PATCH, DELETE |
The voicemail ID is the mailbox configuration ID, and messageId is the recording’s database ID, not its position number. Greeting names: busy, unavail, greet, temp. Every operation checks both tenant and mailbox ownership. Use limit and offset for lists (100 by default, maximum 1000).
POST requires data_base64; greeting POST also requires name. Audio must be PCM WAV, mono, 8000 Hz, 16 bit, at most 16 MiB decoded, and the installation’s VOICEMAILFORMAT must be wav. Full-key detail GET returns data_base64; list responses and read-only keys omit audio. An existing greeting is replaced with PUT/PATCH, not another POST.
Message fields: folder (INBOX by default; also Old, Work, Family, Friends, Cust1–Cust5), callerid, flag (empty, Urgent or PRIORITY), category, origtime (Unix timestamp), and data_base64. PATCH folder moves the message within that mailbox. Storage paths, mailbox identity, message positions and analysis fields are generated/read-only. Replacing audio clears stale transcripts and summaries.
curl -H "X-API-Key: TENANT_API_KEY" \
'https://pbx.example.com/pbx/openapi.php/voicemails/8/messages?tenant=TENANT_CODE'
curl -X PATCH -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"folder":"Old"}' \
'https://pbx.example.com/pbx/openapi.php/voicemails/8/messages/42?tenant=TENANT_CODE'
curl -X PUT -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"data_base64":"BASE64_ENCODED_WAV"}' \
'https://pbx.example.com/pbx/openapi.php/voicemails/8/greetings/busy?tenant=TENANT_CODE'
Query routing is supported using object=voicemail&action=messages&id=8&item=42 or action=greetings&id=8&item=busy. Omit item for collection requests. DELETE requires one item and does not clear the entire mailbox.
See Additional Configuration Operations for complete request fields, scope rules and examples.
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. |
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_param1": "DOCS_VARIABLE",
"ce_param2": "example"
}
]
}' \
"https://pbx.example.com/pbx/openapi.php/customdestinations/OBJECT_ID?tenant=CANISTRACCI"
Credential Fields
Parameters holding credentials are write-only: they are omitted from API responses and masked in the activity log. They are cu_param2 of TALKWITHAI, MEETMEWITHPIN and SENDSNMPTRAP (the SNMP community), cu_param4 of CALLBACK, and every CURL option value except the non-secret options (timeouts, redirects, header, SSL verification, proxyport, failurecodes, useragent, hashcompat). For an unknown type, all parameters are hidden.
- Omitting a credential in an update keeps the stored value.
- Changing the destination type, or the name of a CURL option, clears the previous credential unless a new value is supplied in the same request.
- If the destination changed concurrently, the request returns
409 custom_destination_changed; reload and retry.
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. |
Individual extended rows and binary files
Use CRUD on /customdestinationinfos and /customdestinationfiles. Each row is scoped by customdestination_id. Extended rows use param1, param2, param3; binary files use name and data_base64 (maximum 16 MiB decoded). List with ?customdestination_id=8&tenant=TENANT_CODE; full-key detail GET downloads binary content.
See Additional Configuration Operations for complete request fields, scope rules and examples.
Condition
The Condition 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 | condition |
| Primary path | /conditions |
| ID field | co_id |
| Label field | co_name |
| Primary source table | co_conditions |
| Required on create | co_type |
| Path aliases | /conditions |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | co_name |
type | co_type |
timezone | co_timezone |
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 |
|---|---|
CONDITION | condition, true, yes, destination |
NOTCONDITION | notcondition, false, no, notdestination |
CONDITION1 | condition1, destination1, destinationmvv1 |
CONDITION2 | condition2, destination2, destinationmvv2 |
CONDITION3 | condition3, destination3, destinationmvv3 |
CONDITION4 | condition4, destination4, destinationmvv4 |
CONDITION5 | condition5, destination5, destinationmvv5 |
CONDITION6 | condition6, destination6, destinationmvv6 |
CONDITION7 | condition7, destination7, destinationmvv7 |
CONDITION8 | condition8, destination8, destinationmvv8 |
CONDITION9 | condition9, destination9, destinationmvv9 |
CONDITION10 | condition10, destination10, destinationmvv10 |
CONDITION11 | condition11, destination11, destinationmvv11 |
CONDITION12 | condition12, destination12, destinationmvv12 |
CONDITION13 | condition13, destination13, destinationmvv13 |
CONDITION14 | condition14, destination14, destinationmvv14 |
CONDITION15 | condition15, destination15, destinationmvv15 |
CONDITION16 | condition16, destination16, destinationmvv16 |
CONDITION17 | condition17, destination17, destinationmvv17 |
CONDITION18 | condition18, destination18, destinationmvv18 |
CONDITION19 | condition19, destination19, destinationmvv19 |
CONDITION20 | condition20, destination20, destinationmvv20 |
Examples
List Conditions
Returns the conditions visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI"
Get Condition
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Create Condition
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 Office Hours",
"type": "WEEKTIME",
"timezone": "Europe/Rome"
}' \
"https://pbx.example.com/pbx/openapi.php/conditions?tenant=CANISTRACCI"
Edit Condition
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timezone": "UTC"
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Delete Condition
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/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition Destination
Updates the CONDITION 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 '{
"condition": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition Destination
Updates the NOTCONDITION 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 '{
"notcondition": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 1 Destination
Updates the CONDITION1 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 '{
"condition1": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 2 Destination
Updates the CONDITION2 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 '{
"condition2": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 3 Destination
Updates the CONDITION3 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 '{
"condition3": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 4 Destination
Updates the CONDITION4 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 '{
"condition4": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 5 Destination
Updates the CONDITION5 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 '{
"condition5": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 6 Destination
Updates the CONDITION6 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 '{
"condition6": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 7 Destination
Updates the CONDITION7 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 '{
"condition7": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 8 Destination
Updates the CONDITION8 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 '{
"condition8": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 9 Destination
Updates the CONDITION9 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 '{
"condition9": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 10 Destination
Updates the CONDITION10 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 '{
"condition10": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 11 Destination
Updates the CONDITION11 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 '{
"condition11": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 12 Destination
Updates the CONDITION12 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 '{
"condition12": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 13 Destination
Updates the CONDITION13 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 '{
"condition13": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 14 Destination
Updates the CONDITION14 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 '{
"condition14": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 15 Destination
Updates the CONDITION15 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 '{
"condition15": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 16 Destination
Updates the CONDITION16 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 '{
"condition16": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 17 Destination
Updates the CONDITION17 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 '{
"condition17": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 18 Destination
Updates the CONDITION18 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 '{
"condition18": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 19 Destination
Updates the CONDITION19 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 '{
"condition19": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition 20 Destination
Updates the CONDITION20 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 '{
"condition20": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/OBJECT_ID?tenant=CANISTRACCI"
Condition Extended Rows
Supplies the extended rows used by condition types that require additional values.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"extended_infos": [
{
"ce_type": "weekday",
"ce_value": "mon-fri"
},
{
"ce_type": "hours",
"ce_value": "09:00-18:00"
}
]
}' \
"https://pbx.example.com/pbx/openapi.php/conditions/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. |
Hunt List
The Hunt List 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 | huntlist |
| Primary path | /huntlists |
| ID field | hu_id |
| Label field | hu_name |
| Primary source table | hu_huntlists |
| Required on create | hu_name |
| Path aliases | /huntlists |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/huntlists?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/huntlists/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/huntlists?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/huntlists/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/huntlists/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | hu_name |
number | hu_number |
type | hu_type |
ringtime | hu_ringtime |
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 |
|---|---|
HUNTLIST | extensions, members, huntlist |
HUNTLIST-TIMEOUT | timeout, huntlist_timeout |
Examples
List Hunt Lists
Returns the hunt lists visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/huntlists?tenant=CANISTRACCI"
Get Hunt List
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/huntlists/OBJECT_ID?tenant=CANISTRACCI"
Create Hunt List
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 Hunt List",
"number": "820",
"type": "RINGALL",
"ringtime": 20
}' \
"https://pbx.example.com/pbx/openapi.php/huntlists?tenant=CANISTRACCI"
Edit Hunt List
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ringtime": 25
}' \
"https://pbx.example.com/pbx/openapi.php/huntlists/OBJECT_ID?tenant=CANISTRACCI"
Delete Hunt List
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/huntlists/OBJECT_ID?tenant=CANISTRACCI"
Hunt List Destination
Updates the HUNTLIST 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 '{
"extensions": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/huntlists/OBJECT_ID?tenant=CANISTRACCI"
Hunt List TIMEOUT Destination
Updates the HUNTLIST-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 '{
"timeout": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/huntlists/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. |
DID
The DID 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 | did |
| Primary path | /dids |
| ID field | di_id |
| Label field | di_number |
| Primary source table | di_dids |
| Required on create | di_number |
| Path aliases | /dids |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/dids?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/dids?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
number | di_number |
country | di_country |
area | di_area |
comment | di_comment |
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 |
|---|---|
DID | destination, did |
DID-UNCONDITIONAL | unconditional |
DID-SMS | sms |
DID-FAXSUCCESS | faxsuccess, fax_success |
Examples
List DIDs
Returns the dids visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/dids?tenant=CANISTRACCI"
Get DID
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI"
Create DID
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 '{
"number": "+15551234567",
"country": "US",
"area": "212",
"comment": "Docs API inbound DID"
}' \
"https://pbx.example.com/pbx/openapi.php/dids?tenant=CANISTRACCI"
Edit DID
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"comment": "Docs API DID updated"
}' \
"https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI"
Delete DID
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/dids/OBJECT_ID?tenant=CANISTRACCI"
DID Destination
Updates the DID 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 '{
"destination": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI"
DID UNCONDITIONAL Destination
Updates the DID-UNCONDITIONAL 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 '{
"unconditional": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI"
DID SMS Destination
Updates the DID-SMS 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 '{
"sms": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI"
DID FAXSUCCESS Destination
Updates the DID-FAXSUCCESS 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 '{
"faxsuccess": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/dids/OBJECT_ID?tenant=CANISTRACCI"
DID Validation and Storage Rules
DID create, update and delete follow the web interface. Country, area and number together, ignoring leading zeros, must be unique across all tenants and unassigned DIDs. Creation respects the tenant DID limit. New destinations must reference objects the tenant may use, including available shared objects; use internal IDs such as EXT-123, or SAMENUMBERVM.
Updates replace only the destination lists explicitly supplied; omit a list to preserve it or send an empty array to clear it. An unconditional forward is reset if it has no destinations. Tenant keys may select only a fax routing profile already in use by that tenant. With a global key, global=yes manages unassigned DIDs, which cannot have destinations.
When DID storage selection (DIDSSTORAGE) is enabled, deleting a tenant DID returns its number to the unassigned pool with the same ID and cleared routing/settings. Otherwise deletion removes it. Check references before deleting.
List Filters
GET /dids and the available pool (available=yes, also true, 1 or on) accept exact filters: number (alias di_number), country and area. Filters are combined with AND, compare the stored value exactly, keep leading zeros, and an empty value matches an empty field. Values are at most 255 UTF-8 bytes without control characters. Ordinary lists need a tenant, or global=yes with a global key, when filtering.
curl --fail --show-error \
--header "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/dids?tenant=CANISTRACCI&country=39&number=0612345678"
Unknown parameters return 400 unknown_filter. Invalid values, repeated parameters, or number and di_number with different values return 400 invalid_did_filter.
Assign, Transfer or Release a DID
Use POST /dids/{id}/assign with a full API key. to_tenant accepts a tenant code, name or ID; "pool" or 0 releases the DID. Optional from_tenant checks the expected current owner and prevents acting on a number that has moved. The equivalent query form is POST /dids?action=assign&id={id}.
| Operation | Permissions and result |
|---|---|
| Pool to tenant | A global full key can assign a number. A tenant full key can claim a pool number only for its own tenant with DID storage enabled. The ID and number are preserved; tenant defaults and default destinations are applied. |
| Tenant to another tenant | Requires a global full key. Old destinations are removed and the target tenant defaults are applied. The new DID has a new ID; the response includes previous_id. |
| Tenant to pool | Requires a global full key. Use to_tenant: "pool". The ID is retained, routes are cleared and stored settings are reset. Do not include other DID fields or destinations. |
| Same owner | Returns unchanged: true without resetting or editing the DID. Use the ordinary update endpoint for edits. |
Responses include previous_tenant_id. For assignment to a tenant, supported DID fields and destination lists can accompany the request. A pool claim cannot change the number. If to_tenant is omitted, the selected tenant is used; with a global key that tenant parameter must identify one tenant exactly.
List Available Pool Numbers
curl --fail --show-error --request GET \
--header "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/dids?available=yes&tenant=CANISTRACCI"
Tenant keys need DID storage enabled. The available list contains the ID and number fields without administrator comments or provider details.
Claim a Pool Number
curl --fail --show-error --request POST \
--header "X-API-Key: TENANT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"to_tenant": "CANISTRACCI",
"from_tenant": "pool",
"destination": [
"EXT-201"
]
}' \
"https://pbx.example.com/pbx/openapi.php/dids/123/assign?tenant=CANISTRACCI"
Transfer Between Tenants
curl --fail --show-error --request POST \
--header "X-API-Key: GLOBAL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"to_tenant": "TARGET_TENANT",
"from_tenant": "CANISTRACCI"
}' \
"https://pbx.example.com/pbx/openapi.php/dids/123/assign?tenant=CANISTRACCI"
Release a Number
curl --fail --show-error --request POST \
--header "X-API-Key: GLOBAL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"to_tenant": "pool",
"from_tenant": "CANISTRACCI"
}' \
"https://pbx.example.com/pbx/openapi.php/dids/123/assign?tenant=CANISTRACCI"
The transfer/release examples require a global key. Replace sample IDs and tenant codes with real values. Assignment checks permissions, destination availability and target limits before committing. did_owner_changed and did_number_exists return 409; disabled DID storage returns did_storage_disabled. Inspect any returned warnings after a successful save.
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. |
Queue
The Queue 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 | queue |
| Primary path | /queues |
| ID field | qu_id |
| Label field | qu_name |
| Primary source table | qu_queues |
| Path aliases | /queues |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/queues?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/queues?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | qu_name |
number | qu_number |
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 |
|---|---|
QUEUE-FULL | full |
QUEUE-TIMEOUT | timeout_destination, timeout |
QUEUE-EXITKEY | exitkey |
QUEUE-ONCALLBACK | oncallback |
QUEUE-NOBODYHOME | nobodyhome |
QUEUE-NOFREEMEMBER | nofreemember |
QUEUE-PERIODICANNOUNCE | periodicannounce |
QUEUE-BEFORERINGING | beforeringing |
QUEUE-ONAUTOPAUSE | onautopause |
QUEUE-ONABANDONEDCALL | onabandonedcall |
Examples
List Queues
Returns the queues visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues?tenant=CANISTRACCI"
Get Queue
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Create Queue
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 Accounting Queue",
"number": "700"
}' \
"https://pbx.example.com/pbx/openapi.php/queues?tenant=CANISTRACCI"
Edit Queue
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Accounting Queue Updated"
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Delete Queue
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/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue FULL Destination
Updates the QUEUE-FULL 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 '{
"full": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue TIMEOUT Destination
Updates the QUEUE-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 '{
"timeout_destination": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue EXITKEY Destination
Updates the QUEUE-EXITKEY 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 '{
"exitkey": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue ONCALLBACK Destination
Updates the QUEUE-ONCALLBACK 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 '{
"oncallback": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue NOBODYHOME Destination
Updates the QUEUE-NOBODYHOME 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 '{
"nobodyhome": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue NOFREEMEMBER Destination
Updates the QUEUE-NOFREEMEMBER 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 '{
"nofreemember": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue PERIODICANNOUNCE Destination
Updates the QUEUE-PERIODICANNOUNCE 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 '{
"periodicannounce": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue BEFORERINGING Destination
Updates the QUEUE-BEFORERINGING 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 '{
"beforeringing": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue ONAUTOPAUSE Destination
Updates the QUEUE-ONAUTOPAUSE 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 '{
"onautopause": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue ONABANDONEDCALL Destination
Updates the QUEUE-ONABANDONEDCALL 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 '{
"onabandonedcall": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue Members
Replaces queue members. Use extension IDs and optional member fields such as penalty when needed.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"members": [
{
"extension_id": 45,
"penalty": 0
},
{
"extension_id": 46,
"penalty": 1
}
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/OBJECT_ID?tenant=CANISTRACCI"
Queue Allowed Members
Controls which extensions are allowed to be used as queue members.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"allowed_members": [
45,
46,
47
]
}' \
"https://pbx.example.com/pbx/openapi.php/queues/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. |
Queue Agent Actions
The Queue Agent Actions endpoints log an extension or external agent into or out of one queue or across tenant queues, pause it with or without a reason, and unpause it. Each request changes only the selected agent's memberships; it does not replace or rebuild the other queue members.
Endpoints
| Action | Endpoint |
|---|---|
| Login | POST /queues/{queueId}/agents/{agentId}/login |
| Logout | POST /queues/{queueId}/agents/{agentId}/logout |
| Pause | POST /queues/{queueId}/agents/{agentId}/pause |
| Unpause | POST /queues/{queueId}/agents/{agentId}/unpause |
Use the Queue Number
Use these routes to select a queue by its dialable number (qu_number) within the tenant:
| Action | Endpoint |
|---|---|
| Login | POST /queues/by-number/{queueNumber}/agents/{agentId}/login |
| Logout | POST /queues/by-number/{queueNumber}/agents/{agentId}/logout |
| Pause | POST /queues/by-number/{queueNumber}/agents/{agentId}/pause |
| Unpause | POST /queues/by-number/{queueNumber}/agents/{agentId}/unpause |
Queue numbers are strings: 00700 and 700 are different numbers. A number must contain 1 to 40 characters without spaces, control characters, or slashes. URL-encode reserved characters; for example, send *70# as %2A70%23. These routes always look up qu_number; they never interpret it as an internal queue ID. The existing ID routes remain available.
The exact tenant is required even with a global key. A missing queue number in that tenant returns HTTP 404 (queue_not_found). Multiple matching queues in the same tenant return HTTP 409 (queue_number_ambiguous); use the internal ID route to select one. Neither error changes queue membership. On the /agents routes, the agent is selected by its internal extension ID (ex_id). Use the /external-agents routes below for external agent IDs.
Authentication and Identifiers
These endpoints require a writable full tenant or global API key. Read-only keys are rejected. The tenant query parameter is required and must exactly match the tenant code or tenant name; wildcard tenant selection is not accepted.
| Value | Required | Description |
|---|---|---|
queueId | For ID routes | The queue's internal ID (qu_id), not its dialable queue number. |
queueNumber | For by-number routes | The dialable queue number (qu_number) in the selected tenant. Leading zeros are preserved. |
agentId | For extension routes | The extension's internal ID (ex_id), not its extension number. |
externalAgentId | For external-agent routes | The external agent's internal ID (ea_externalagents.ea_id). Select an existing external agent belonging to the tenant. |
tenant | Yes | Exact tenant code or tenant name. |
key | No, if using headers | The API key can be sent with X-API-Key, Authorization: Bearer, or the key query parameter. |
Request Body
Login accepts an optional JSON body with penalty for extensions and external agents. External-agent login also accepts the options described below. Logout and unpause do not need a request body. A pause request accepts an optional JSON body:
{
"reason": "Lunch"
}
The reason can contain up to 80 characters. Omit the body, send an empty object, or use an empty reason to pause without a reason. pausereason is accepted as a compatibility alias for reason; if both names are supplied, their values must match. A pause reason cannot be sent to the other actions.
Login with a Penalty
All extension and external-agent login routes accept an optional penalty. Send a JSON integer from 0 to 2147483647. Omit it to use 0 for a new membership. Negative values, quoted numbers, booleans, null, fractions, and values above the limit return HTTP 400 (invalid_penalty).
The requested penalty applies only when adding the agent. Repeating login preserves an existing membership's penalty, pause state, and other options and returns changed=false. To change the penalty through these endpoints, log the agent out and log it in again with the desired value. A penalty field on pause, unpause, or logout returns HTTP 400 (penalty_not_allowed).
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"penalty":5}' \
"https://pbx.example.com/pbx/openapi.php/queues/by-number/700/agents/101/login?tenant=DEVEL"
This example logs extension internal ID 101 into queue number 700 with penalty 5. For an external agent use /queues/by-number/700/external-agents/42/login, where 42 is its ea_id. The same JSON field is supported when selecting the queue by internal ID.
The response reports the applied or existing penalty in members[].penalty. Queue event logging, audit entries, and PBX refresh behavior remain the same.
Examples
Log In
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/25/agents/101/login?tenant=CANISTRACCI"
Log In by Queue Number
Log extension ID 101 into queue number 700 in tenant DEVEL. No request body is required:
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/by-number/700/agents/101/login?tenant=DEVEL"
Replace the final login with logout, pause, or unpause for the other actions. To pause with a reason:
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason":"Lunch"}' \
"https://pbx.example.com/pbx/openapi.php/queues/by-number/700/agents/101/pause?tenant=DEVEL"
The response returns both the resolved internal queue.id and dialable queue.number. Login and logout remain idempotent, and the response retains the existing changed, pbx_refresh, and warnings fields.
Pause Without a Reason
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/25/agents/101/pause?tenant=CANISTRACCI"
Pause With a Reason
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason":"Lunch"}' \
"https://pbx.example.com/pbx/openapi.php/queues/25/agents/101/pause?tenant=CANISTRACCI"
Unpause and Log Out
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/25/agents/101/unpause?tenant=CANISTRACCI"
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/25/agents/101/logout?tenant=CANISTRACCI"
External Agents
These routes act on an existing external agent from ea_externalagents. Use its internal ea_id as externalAgentId. The configured ea_number supplies the destination number; requests cannot override that number. External agent IDs and extension IDs are separate identifiers. The routes select only the matching external agent, including when another agent shares its telephone number or an extension has the same numeric ID.
| Action | Queue by internal ID | Queue by dialable number |
|---|---|---|
| Login | POST /queues/{queueId}/external-agents/{externalAgentId}/login | POST /queues/by-number/{queueNumber}/external-agents/{externalAgentId}/login |
| Logout | POST /queues/{queueId}/external-agents/{externalAgentId}/logout | POST /queues/by-number/{queueNumber}/external-agents/{externalAgentId}/logout |
| Pause | POST /queues/{queueId}/external-agents/{externalAgentId}/pause | POST /queues/by-number/{queueNumber}/external-agents/{externalAgentId}/pause |
| Unpause | POST /queues/{queueId}/external-agents/{externalAgentId}/unpause | POST /queues/by-number/{queueNumber}/external-agents/{externalAgentId}/unpause |
A writable full tenant or global API key and an exact tenant code or name are required. Both the queue and the external agent must belong to that tenant. Read-only and dial-only keys cannot perform these actions. The queue number route preserves leading zeros and uses the same missing/ambiguous queue rules as the extension routes.
Login Options
Login accepts optional penalty, confirm, and monitor_state. With no body it uses penalty=0, confirm=false, and monitor_state=true. Send an integer for penalty and actual JSON booleans for the other options, not quoted strings.
| Option | Default | Behavior |
|---|---|---|
penalty | 0 | JSON integer from 0 to 2147483647 for a new membership. An existing membership retains its penalty on repeated login. |
confirm | false | Set to true to require the external agent to confirm answering a queue call. |
monitor_state | true | Monitor the configured external number using its Custom device state. Set to false for the queue page's no-state-monitoring mode. The queue's Ring Offline setting disables the state interface even when this option is true. |
Options apply when creating a membership. Repeating login preserves an existing membership's mode, pause state, and penalty, and returns changed=false. Log out and log in again to change penalty, confirmation, or monitoring. New memberships use the queue's Agent Identification and Allow Call Optimization settings, start unpaused, and use the requested penalty (default 0).
New logins honor the tenant's EXTERNALAGENTS setting, matching the queue page: an unset/empty value or EA allows external agents; another selection such as CU returns HTTP 409 (external_agents_disabled). Existing memberships can still be paused, unpaused, or logged out after the setting changes.
Log In an External Agent
Log external agent ID 42 into queue number 700 in tenant DEVEL, with penalty 5, confirmation enabled, and state monitoring disabled:
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"penalty":5,"confirm":true,"monitor_state":false}' \
"https://pbx.example.com/pbx/openapi.php/queues/by-number/700/external-agents/42/login?tenant=DEVEL"
For default login behavior, omit the body and its Content-Type header. To select queue internal ID 25 instead, use /queues/25/external-agents/42/login.
Pause, Unpause, and Log Out
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason":"Lunch"}' \
"https://pbx.example.com/pbx/openapi.php/queues/by-number/700/external-agents/42/pause?tenant=DEVEL"
curl -X POST -H "X-API-Key: YOUR_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/by-number/700/external-agents/42/unpause?tenant=DEVEL"
curl -X POST -H "X-API-Key: YOUR_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/by-number/700/external-agents/42/logout?tenant=DEVEL"
Pause accepts an optional reason (or pausereason) of up to 80 characters. Omit the body to pause without a reason. Unpause clears the reason. Pause and unpause return HTTP 409 (agent_not_logged_in) when the external agent has no membership in the selected queue. Login options are accepted only by login; unsupported fields return HTTP 400 (invalid_external_agent_option).
Response
The response uses the same queue_agent_action object and includes changed, the resolved queue.id and queue.number, members, pbx_refresh, and warnings. Its agent object identifies the external agent:
"agent": {
"type": "external",
"id": 42,
"number": "+14155550100",
"name": "External Agent",
"peer": "+14155550100"
}
Changed actions write the corresponding queue event and activity audit entry and request a live PBX queue refresh. Login and logout are idempotent; repeated requests still request a refresh. A failed refresh returns the saved database state with pbx_refresh=failed and a warning, so the request can be retried.
All-Queues Actions
Use all in place of a queue ID to apply an action for one agent across queues in one tenant. A full writable key and an exact tenant code or name are required. Use the extension's ex_id on the /agents routes or the external agent's ea_id on /external-agents. The queue number route /queues/by-number/all/... continues to look up a queue whose number is literally all; it is not a bulk route.
| Action | Extension | External agent |
|---|---|---|
| Login | POST /queues/all/agents/{agentId}/login | POST /queues/all/external-agents/{externalAgentId}/login |
| Logout | POST /queues/all/agents/{agentId}/logout | POST /queues/all/external-agents/{externalAgentId}/logout |
| Pause | POST /queues/all/agents/{agentId}/pause | POST /queues/all/external-agents/{externalAgentId}/pause |
| Unpause | POST /queues/all/agents/{agentId}/unpause | POST /queues/all/external-agents/{externalAgentId}/unpause |
Which Queues Are Affected?
- Login targets every queue in the selected tenant. The allowed-agent list does not limit this route. It adds only missing memberships, using each queue's naming, call-optimization, and Ring Offline settings. Existing memberships retain their penalty, pause state, and mode.
- Logout removes the selected agent from every queue in this tenant where it is currently logged in.
- Pause and unpause change only the agent's existing memberships in this tenant. They do not add memberships.
- Other tenants, other agents, allowed-agent lists, and extension/external-agent records are unaffected. External agent matching uses its object type and ID, independently of agents sharing a phone number or an extension with the same ID.
- No matching queues returns HTTP 200 with
success=true, zero totals, and an emptyresultsarray. Login also returns this empty result when the tenant has no queues. The agent must still exist in the selected tenant.
Request Options
Login accepts the same optional body as the single-queue route: penalty is an integer from 0 to 2147483647, default 0. External-agent login also accepts JSON booleans confirm (default false) and monitor_state (default true). These values apply to new memberships only. External-agent login honors the tenant's EXTERNALAGENTS setting for each new membership.
Pause accepts an optional reason or pausereason of up to 80 characters and applies it to every matched membership. Omit the body to pause without a reason. Unpause clears the reason. Logout and unpause require no body. Supplying penalty to an action other than login returns HTTP 400 (penalty_not_allowed).
Authentication, exact tenant, agent identity, and request options are checked before queue changes begin. Invalid requests return the usual HTTP error response. The queue list is then collected and processed in internal ID order, including queues hosted on different PBX nodes.
Examples
Log extension ID 101 into every queue in tenant DEVEL with penalty 5:
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"penalty":5}' \
"https://pbx.example.com/pbx/openapi.php/queues/all/agents/101/login?tenant=DEVEL"
Log external agent ID 42 into every queue with confirmation enabled, state monitoring disabled, and penalty 5:
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"penalty":5,"confirm":true,"monitor_state":false}' \
"https://pbx.example.com/pbx/openapi.php/queues/all/external-agents/42/login?tenant=DEVEL"
Pause the extension in all its current tenant queue memberships, then unpause or log out:
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason":"Lunch"}' \
"https://pbx.example.com/pbx/openapi.php/queues/all/agents/101/pause?tenant=DEVEL"
curl -X POST -H "X-API-Key: YOUR_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/all/agents/101/unpause?tenant=DEVEL"
curl -X POST -H "X-API-Key: YOUR_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/queues/all/agents/101/logout?tenant=DEVEL"
For the same pause, unpause, or logout actions on an external agent, use /queues/all/external-agents/42/ followed by the action.
Bulk Response and Partial Failures
A valid bulk request returns HTTP 200 with a queue_agent_bulk_action response even when individual queue actions fail. Inspect success, summary, and every entry in results. Each queue is handled independently: a failure is reported for that queue and processing continues. Successful actions are not rolled back. If a membership is removed concurrently, pause/unpause can report agent_not_logged_in for that queue.
| Field | Meaning |
|---|---|
success | True when there are no per-queue action failures. PBX refresh failures are reported separately. |
changed | True when at least one successful queue action changed membership or pause state. |
summary.total | Number of queues selected at the start of the operation. |
summary.changed | Number of successful queue actions that changed state. |
summary.unchanged | Number of successful queue actions whose requested state was already in effect. |
summary.failed | Number of failed queue actions. Their results include error.status, error.code, and error.message. |
summary.pbx_refresh_failed | Successful database actions whose live PBX refresh could not be confirmed. Their results retain the saved state, pbx_refresh=failed, and warnings. |
Each successful queue result contains the ordinary queue_agent_action response plus success=true. Each failed result contains success=false, the queue ID/number/name, and an error. Results are ordered by internal queue ID. Changed states write the usual per-queue event and audit entry, and successful actions request a refresh on the queue's hosting node. Retrying the same request is idempotent; memberships and saved states may already have changed before a later error occurs.
Example partial result for a pause request:
{
"object": "queue_agent_bulk_action",
"action": "pause",
"agent": {
"id": 101,
"number": "103",
"name": "Reception",
"peer": "101"
},
"success": false,
"changed": true,
"summary": {
"total": 2,
"changed": 1,
"unchanged": 0,
"failed": 1,
"pbx_refresh_failed": 0
},
"results": [
{
"object": "queue_agent_action",
"action": "pause",
"status": "paused",
"changed": true,
"queue": {
"id": 25,
"number": "700",
"name": "Support"
},
"agent": {
"id": 101,
"number": "103",
"name": "Reception",
"peer": "101"
},
"members": [
{
"membername": "103",
"interface": "Local/AG-000-NF-101@fromotherpbx/n",
"state_interface": "Custom:101",
"member_device": "101",
"penalty": 5,
"paused": true,
"pause_reason": "Lunch"
}
],
"pbx_refresh": "confirmed",
"warnings": [],
"success": true
},
{
"success": false,
"queue": {
"id": 27,
"number": "701",
"name": "Sales"
},
"error": {
"status": 409,
"code": "agent_not_logged_in",
"message": "The agent is not logged into this queue."
}
}
],
"warnings": [
"Some queue actions failed. Inspect results before retrying."
]
}
Response
{
"object": "queue_agent_action",
"action": "pause",
"status": "paused",
"changed": true,
"queue": {
"id": 25,
"number": "700",
"name": "Support"
},
"agent": {
"id": 101,
"number": "100",
"name": "Reception",
"peer": "101"
},
"members": [
{
"membername": "100",
"interface": "Local/AG-000-NF-101@fromotherpbx/n",
"state_interface": "Custom:101",
"member_device": "101",
"penalty": 0,
"paused": true,
"pause_reason": "Lunch"
}
],
"pbx_refresh": "confirmed",
"warnings": []
}
changed is false when the requested state was already active. Login and logout are idempotent. Pause and unpause are also idempotent after the agent is logged in; attempting either operation for an extension that is not a member of the queue returns HTTP 409.
pbx_refresh reports whether the live Asterisk refresh was confirmed. If the database action succeeds but the refresh cannot be confirmed, the request still returns the saved state with pbx_refresh set to failed and an explanation in warnings. Retrying the same action is safe and requests another refresh.
Behavior
- Login uses the queue's Agent Identification, Allow Call Optimization, and Ring Offline settings when constructing the member.
- A changed state writes the matching
LOGIN,LOGOUT,PAUSE, orUNPAUSEqueue log event and an activity audit entry. - Unpause clears the stored pause reason.
- The final database state is checked before a successful response is returned.
Relevant Errors
| HTTP status | Code | Description |
|---|---|---|
| 400 | exact_tenant_required | The tenant was omitted, does not exactly match the authenticated tenant, or uses a wildcard. |
| 400 | invalid_pause_reason | The pause reason is invalid or longer than 80 characters. |
| 400 | conflicting_pause_reason | reason and pausereason contain different values. |
| 400 | pause_reason_not_allowed | A reason was sent to login, logout, or unpause. |
| 400 | invalid_queue_number | The by-number value is invalid or exceeds 40 characters. |
| 400 | invalid_penalty | Penalty is not a JSON integer from 0 to 2147483647. |
| 400 | penalty_not_allowed | Penalty was supplied to an action other than login. |
| 400 | invalid_external_agent_option | An external-agent request contains an unsupported field or a login option is not a JSON boolean. |
| 404 | external_agent_not_found | The external agent does not exist in the selected tenant. |
| 404 | queue_not_found | The queue does not exist in the selected tenant. |
| 409 | queue_number_ambiguous | More than one queue in the selected tenant has this number. Use the internal ID route. |
| 409 | external_agents_disabled | The tenant EXTERNALAGENTS setting does not allow a new external-agent membership. |
| 409 | agent_not_logged_in | Pause or unpause was requested before the extension was logged into the queue. |
| 409 | agent_peer_unavailable | The extension does not have a valid queue member device, or the external agent has no valid configured destination number. |
| 409 | queue_agent_state_changed | A concurrent change prevented the requested final state from being confirmed; retry the request. |
| 500 | queue_agent_update_failed | The membership database operation failed. |
Setting
The Setting 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 | setting |
| Primary path | /settings |
| ID field | se_id |
| Label field | se_code |
| Primary source table | se_settings |
| Required on create | se_code |
| Path aliases | /settings |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/settings?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/settings/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/settings?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/settings/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/settings/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
code | se_code |
value | se_value |
Examples
List Settings
Returns the settings visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/settings?tenant=CANISTRACCI"
Get Setting
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/settings/OBJECT_ID?tenant=CANISTRACCI"
Create Setting
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 '{
"code": "API_DOCS_EXAMPLE",
"value": "enabled"
}' \
"https://pbx.example.com/pbx/openapi.php/settings?tenant=CANISTRACCI"
Edit Setting
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "disabled"
}' \
"https://pbx.example.com/pbx/openapi.php/settings/OBJECT_ID?tenant=CANISTRACCI"
Delete Setting
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/settings/OBJECT_ID?tenant=CANISTRACCI"
List Global Settings
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/settings?global=1"
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. |
Configuration/Settings objects
Manager users, pickup group names, internal routing, parking, privacy rules, autoanswers, Dial By Name directories/entries, digital faxes, alarm bindings, Mail to Fax/Call, scheduled calls, dashboards, line monitors, XML templates, cause codes, CNAM cache and extension dialing exceptions now have dedicated CRUD resources. User-owned quick shortcuts require a global API key.
See Additional Configuration Operations for complete request fields, scope rules and examples.
Media File
The Media File 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 | mediafile |
| Primary path | /mediafiles |
| ID field | me_id |
| Label field | me_name |
| Primary source table | me_mediafiles |
| Required on create | me_name |
| Path aliases | /mediafiles, /media_files, /media_file |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/mediafiles?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID?tenant=CANISTRACCI |
| Download file | GET https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID/download?tenant=CANISTRACCI (full API key) |
| Create | POST https://pbx.example.com/pbx/openapi.php/mediafiles?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | me_name |
description | me_description |
format | me_format |
type | me_type |
text | me_text |
engine | me_engine |
language | me_language |
data_base64 | me_data |
Examples
List Media Files
Returns the media files visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/mediafiles?tenant=CANISTRACCI"
Get Media File
Reads metadata by its internal ID. List and detail responses omit me_data and do not contain audio, even when using a global full API key. Use the download endpoint to retrieve the file.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID?tenant=CANISTRACCI"
Create Media File
To generate and save audio immediately, send the JSON boolean tts: true. Use type: STATIC, or omit type for a new static media file. Text without tts: true does not trigger speech generation.
curl --fail --show-error --request POST \
--header "X-API-Key: TENANT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"name": "Documentation welcome prompt",
"type": "STATIC",
"tts": true,
"text": "Welcome. Press 1 for sales or 2 for support.",
"format": "wav"
}' \
"https://pbx.example.com/pbx/openapi.php/mediafiles?tenant=CANISTRACCI"
Edit Media File
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated generated prompt"
}' \
"https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID?tenant=CANISTRACCI"
Delete Media File
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/mediafiles/OBJECT_ID?tenant=CANISTRACCI"
List Global Media Files
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/mediafiles?global=1"
Media File Binary Upload
Use multipart WAV/MP3 or JSON data_base64 as shown in Upload and Replace WAV or MP3 Audio. Encode the complete file; abbreviated base64 is not a valid upload.
Download a Media File
GET /mediafiles/{id}/download?tenant=TENANTCODE returns the original stored file as an attachment. Use the positive me_id returned by the media list. The audio is returned as binary bytes, without base64 encoding or transcoding.
A full API key is required. Tenant full keys can download only their own tenant's media files and must supply tenant. Read-only keys receive HTTP 403, with error code full_api_key_required. A global full key can select a tenant or omit tenant to download a media file by ID across tenants. For shared/global media, use global=yes with a global full key.
Download Tenant Media
curl --fail --show-error \
-H 'X-API-Key: TENANT_API_KEY' \
--output /tmp/media.wav \
'https://pbx.example.com/pbx/openapi.php/mediafiles/123/download?tenant=CANISTRACCI'
Replace 123 with the media file ID. The example writes WAV bytes to /tmp/media.wav; choose a filename matching the stored format when downloading MP3, GSM or another format. The server does not convert the audio based on the output filename.
Download Global Media
curl --fail --show-error \
-H 'X-API-Key: GLOBAL_API_KEY' \
--output /tmp/global-media.wav \
'https://pbx.example.com/pbx/openapi.php/mediafiles/123/download?global=yes'
Download Response and Storage
Content-Disposition: attachmentsupplies a filename derived from the media name and stored extension.Content-Typereflects the stored format, such asaudio/wav,audio/mpegoraudio/gsm. Other formats may useapplication/octet-stream.Content-Lengthreports the actual file size. Successful responses contain file bytes; failures remain JSON.- Database, filesystem, FTP, SSL-FTP, SFTP and S3 storage are supported. The storage lookup uses the media file's actual tenant owner and the system media-storage settings when inherited.
The singular alias /mediafile/123/download is also accepted. The equivalent query form is openapi.php?object=mediafile&action=download&id=123&tenant=CANISTRACCI. Downloads support GET only.
| HTTP status | Meaning |
|---|---|
| 400 | Invalid or missing media ID. |
| 401 / 403 | Missing/invalid key, read-only key, denied IP address or insufficient scope. |
| 404 | Media record is outside the selected scope, does not exist, or has no stored audio. |
| 405 | A method other than GET was used. |
| 409 | The stored media format is unavailable. |
| 500 / 502 / 503 | Database, storage retrieval or configuration failure. Errors are JSON; no file download starts. |
Generate or Regenerate Speech
Creation uses POST /mediafiles; PUT or PATCH /mediafiles/{id} with tts: true regenerate existing audio. Updates can use supplied text or the stored text. Updating text alone preserves existing audio. To replace a dynamic recording with saved audio, explicitly set type: STATIC.
Text must be nonempty UTF-8, at most 5,000 bytes, without control characters. The configured tenant speech engine and voice are used, with global settings as fallback. If overriding engine, use its full configured name: Google Cloud Text to Speech, IBM Watson TTS, Microsoft Azure Cognitive Services, or Amazon AWS Polly. language selects the engine-specific voice, rather than a generic language code.
curl --fail --show-error --request PATCH \
--header "X-API-Key: TENANT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"tts": true,
"text": "Thank you for calling. Please hold.",
"format": "wav",
"volume": 1
}' \
"https://pbx.example.com/pbx/openapi.php/mediafiles/123?tenant=CANISTRACCI"
Upload and Replace WAV or MP3 Audio
Create with POST /mediafiles. Replace audio with POST /mediafiles/{id}/upload, using a multipart file or JSON data_base64. The multipart field is file; filename is an alias. JSON uploads are also accepted by the ordinary create/update endpoints. Multipart uploads require POST; use the dedicated upload endpoint for replacement.
curl --fail --show-error --request POST \
--header "X-API-Key: TENANT_API_KEY" \
--form "name=Documentation uploaded prompt" \
--form "format=wav" \
--form "file=@/tmp/prompt.wav" \
"https://pbx.example.com/pbx/openapi.php/mediafiles?tenant=CANISTRACCI"
curl --fail --show-error --request POST \
--header "X-API-Key: TENANT_API_KEY" \
--form "file=@/tmp/replacement.mp3" \
"https://pbx.example.com/pbx/openapi.php/mediafiles/123/upload?tenant=CANISTRACCI"
For a JSON upload, encode the complete local WAV or MP3 and pass the JSON through standard input. The example requires base64 and jq. Replace 123 with the existing media ID.
base64 < /tmp/prompt.wav | tr -d "\r\n" | \
jq -Rs '{data_base64: ., format: "wav"}' | \
curl --fail --show-error --request POST \
--header "X-API-Key: TENANT_API_KEY" \
--header "Content-Type: application/json" \
--data-binary @- \
"https://pbx.example.com/pbx/openapi.php/mediafiles/123/upload?tenant=CANISTRACCI"
| Option | Behavior |
|---|---|
| Audio source | Supply exactly one source: multipart file or JSON audio. Do not combine uploaded audio with tts: true. |
| Size | Maximum uploaded or generated source audio is 16 MiB. PHP upload/memory limits and database packet/column limits can reduce the usable upload size. |
| Conversion | Supported target formats: wav, wav16, sln, sln16, mp3, automatic, leaveasis. Volume ranges from 0 to 10. Conversion requires SoX; MP3 handling also depends on installed codec support. |
| Replacement defaults | Omitted format and volume retain the existing media values. Metadata-only edits preserve stored audio. |
| Permissions | A full API key and tenant write scope are required. Shared/global media require a global full key and global=yes. |
| Storage and references | Uses the configured media storage and updates associated playback references together. Music-on-hold selections and extension/hunt prompts are refreshed; reload warnings can accompany a successful save. |
| Failures | Failed saves preserve previous audio when rollback succeeds. For media_commit_unknown or storage-recovery failures with rolled_back: false, inspect the media record before retrying. |
Success returns media metadata: HTTP 201 for creation and 200 for replacement. Retrieve audio with the existing download endpoint. Invalid audio or conflicting sources return 400, oversized uploads 413, and configuration, generation, conversion or storage failures return the relevant 409/5xx JSON error.
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. |
Music On Hold
The Music On Hold 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 | musiconhold |
| Primary path | /musiconholds |
| ID field | mu_id |
| Label field | mu_name |
| Primary source table | mu_musiconholds |
| Required on create | mu_name |
| Path aliases | /moh, /music, /musiconholds, /music_on_hold, /music_on_holds |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/musiconholds?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/musiconholds/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/musiconholds?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/musiconholds/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/musiconholds/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | mu_name |
custom | mu_custom |
volume | mu_volume |
randomizeorder | mu_randomizeorder |
streamengine | mu_streamengine |
format | format |
application | application |
mode | mode |
Destination Fields
Use mediafile, mediafiles, or destination for an ordered list of positive media IDs or MEDIAFILE-ID references. Each recording must belong to this tenant or be shared/global media. Generic extension or voicemail destinations do not apply to music-on-hold selections.
| Operation | Meaning |
|---|---|
| Omit the selection | Preserve the existing selection on update. |
Send mediafile: [] | Clear the selected recordings. |
| Send a nonempty list | Replace the selection in the requested order; up to 1,000 recordings are supported. |
Examples
List Music On Hold Classes
Returns the music on hold classes visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/musiconholds?tenant=CANISTRACCI"
Get Music On Hold
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/musiconholds/OBJECT_ID?tenant=CANISTRACCI"
Create Music On Hold
Select recordings by media file ID. Replace the sample IDs with existing media visible to the tenant. custom is a stream/application string; it is not a yes/no switch.
curl --fail --show-error --request POST \
--header "X-API-Key: TENANT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"name": "Documentation hold music",
"mediafile": [
22,
23
],
"mode": "playlist",
"format": "slin"
}' \
"https://pbx.example.com/pbx/openapi.php/musiconholds?tenant=CANISTRACCI"
Edit Music On Hold
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"volume": -3
}' \
"https://pbx.example.com/pbx/openapi.php/musiconholds/OBJECT_ID?tenant=CANISTRACCI"
Delete Music On Hold
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/musiconholds/OBJECT_ID?tenant=CANISTRACCI"
List Global Music On Hold Classes
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/musiconholds?global=1"
Music On Hold Destination
Updates the MUSICONHOLD 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 '{
"mediafile": [
22
]
}' \
"https://pbx.example.com/pbx/openapi.php/musiconholds/OBJECT_ID?tenant=CANISTRACCI"
Music On Hold Entries and Default
For stored media, use mediafile with an ordered list of media IDs. Mark the class as the default with default: true.
curl --fail --show-error --request PATCH \
--header "X-API-Key: TENANT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"mediafile": [
22,
23
],
"default": true
}' \
"https://pbx.example.com/pbx/openapi.php/musiconholds/123?tenant=CANISTRACCI"
The separate entries input accepts literal playlist strings or objects with entry (alias value) and optional position. Positions must be unique positive integers. Objects containing me_id and order are not valid entries. For ordinary media selection, use media IDs rather than manually constructing storage paths.
Playlist Rebuilding and Reloads
Create and update keep the station, selected media, realtime configuration and generated playlist consistent in one transaction. Changes to selected media, ordering, custom stream or volume rebuild the related playback configuration. When Reload MOH on media change is enabled and the playlist changes, the PBX music-on-hold module is reloaded on the configured nodes.
A successful response may include warnings if activity logging failed or the live PBX reload could not be confirmed. The station is already saved; inspect the warning and verify playback before repeating the write. An uncertain commit returns moh_commit_unknown with rolled_back: false; inspect the saved station before retrying.
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. |
Paging Group
The Paging Group 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 | paginggroup |
| Primary path | /paginggroups |
| ID field | pa_id |
| Label field | pa_name |
| Primary source table | pa_paginggroups |
| Required on create | pa_name, pa_number |
| Path aliases | /paging, /pagings, /paginggroup, /paginggroups, /intercom, /intercoms |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/paginggroups?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/paginggroups/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/paginggroups?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/paginggroups/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/paginggroups/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | pa_name |
number | pa_number |
pin | pa_pin |
bidirectional | pa_bidirectional |
checkinuse | pa_checkinuse |
mediafile_id | pa_me_id |
manualheader | pa_manualheader |
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 |
|---|---|
PAGING | extensions, peers, members, destination |
Examples
List Paging Groups
Returns the paging groups visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/paginggroups?tenant=CANISTRACCI"
Get Paging Group
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/paginggroups/OBJECT_ID?tenant=CANISTRACCI"
Create Paging Group
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 Paging Group",
"number": "830",
"pin": "1234",
"bidirectional": "no"
}' \
"https://pbx.example.com/pbx/openapi.php/paginggroups?tenant=CANISTRACCI"
Edit Paging Group
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"bidirectional": "yes"
}' \
"https://pbx.example.com/pbx/openapi.php/paginggroups/OBJECT_ID?tenant=CANISTRACCI"
Delete Paging Group
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/paginggroups/OBJECT_ID?tenant=CANISTRACCI"
Paging Group Destination
Updates the PAGING 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 '{
"extensions": [
100,
101
]
}' \
"https://pbx.example.com/pbx/openapi.php/paginggroups/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. |
Conference Room
The Conference Room 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 | conferenceroom |
| Primary path | /conferencerooms |
| ID field | cr_id |
| Label field | cr_name |
| Primary source table | cr_conferencerooms |
| Required on create | cr_name, cr_number |
| Path aliases | /conference, /conferences, /conferencerooms, /conference_rooms, /conference_room |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/conferencerooms?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/conferencerooms/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/conferencerooms?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/conferencerooms/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/conferencerooms/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | cr_name |
number | cr_number |
hosted | cr_hosted |
rate_id | cr_rrid |
startdate | starttime |
enddate | endtime |
request_pin_mediafile_id | cr_requestpinmeid |
Important Notes
- The API creates and updates the related meetme row. If confno is not supplied, the conference number is combined with the tenant code.
Examples
List Conference Rooms
Returns the conference rooms visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/conferencerooms?tenant=CANISTRACCI"
Get Conference Room
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/conferencerooms/OBJECT_ID?tenant=CANISTRACCI"
Create Conference Room
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 Conference",
"number": "840",
"hosted": "yes",
"meetme": {
"pin": "1234",
"adminpin": "4321",
"opts": "T",
"adminopts": "AaT"
}
}' \
"https://pbx.example.com/pbx/openapi.php/conferencerooms?tenant=CANISTRACCI"
Edit Conference Room
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"meetme": {
"pin": "2468",
"adminpin": "8642"
}
}' \
"https://pbx.example.com/pbx/openapi.php/conferencerooms/OBJECT_ID?tenant=CANISTRACCI"
Delete Conference Room
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/conferencerooms/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. |
Flow
The Flow 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 | flow |
| Primary path | /flows |
| ID field | fl_id |
| Label field | fl_name |
| Primary source table | fl_flows |
| Required on create | fl_name |
| Path aliases | /flow, /flows |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/flows?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/flows/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/flows?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/flows/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/flows/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | fl_name |
comment | fl_comment |
number | fl_number |
value | fl_value |
variable_name | fl_variable_name |
monitor_type | fl_monitor_type |
monitor_type_id | fl_monitor_type_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 |
|---|---|
FLOW | destination, destinations |
Outbound Caller ID Selector
Use the EXT-CALLERID monitor to give each enrolled PJSIP extension its own choice of outbound voice caller ID. Create one flow per selectable caller ID. Use *[EXT]* followed by four digits as the flow number, and use a DID owned by the tenant or a verified outbound DID in value_for_inuse.
Send POST /flows?tenant=OFFICE with the following body.
{
"name": "Client A caller ID",
"number": "*[EXT]*9990",
"monitor_type": "EXT-CALLERID",
"value_for_inuse": "+12025550120"
}
Extension 201 dials and monitors *201*9990. When it chooses another number, the new selection becomes active and the previous selection clears on that extension. The PBX uses the authenticated PJSIP endpoint to identify the extension and checks it against the dialled code. Converting an existing flow to this monitor deletes its manual destinations. The PBX publishes the BLF state for each extension.
Resolve any existing routes that claim the same codes. Use spare suffixes for a trial while existing flow numbers are in use. Outbound routing rules can still override the caller ID on a call. When replacing per-extension flows, retire the rules used solely for the legacy caller ID selection. After changing a selection, make a call and check the number received. SMS uses the sender configured for the extension or its fallback.
See Extension for PJSIP enrollment.
Examples
List Flows
Returns the flows visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/flows?tenant=CANISTRACCI"
Get Flow
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/flows/OBJECT_ID?tenant=CANISTRACCI"
Create Flow
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 Flow",
"number": "850",
"variable_name": "DOCS_FLOW_STATE",
"value": "open"
}' \
"https://pbx.example.com/pbx/openapi.php/flows?tenant=CANISTRACCI"
Edit Flow
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "closed"
}' \
"https://pbx.example.com/pbx/openapi.php/flows/OBJECT_ID?tenant=CANISTRACCI"
Delete Flow
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/flows/OBJECT_ID?tenant=CANISTRACCI"
Flow Destination
Updates the FLOW destination of an ordinary flow. 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 '{
"destination": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/flows/OBJECT_ID?tenant=CANISTRACCI"
Flow State Change
Sets the state of an ordinary flow using status, state, or st_state.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "open"
}' \
"https://pbx.example.com/pbx/openapi.php/flows/OBJECT_ID?tenant=CANISTRACCI"
The state cannot contain spaces, control characters or colons (400 invalid_flow_state). As with the Flow editor, the new state is sent to every PBX node.
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. |
Tenant Variable
The Tenant Variable 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 | tenantvariable |
| Primary path | /tenantvariables |
| ID field | tv_id |
| Label field | tv_value |
| Primary source table | tv_tenantvariables |
| Required on create | tv_al_id |
| Path aliases | /variable, /variables, /tenantvariable, /tenantvariables, /tenant_variable, /tenant_variables |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/tenantvariables?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/tenantvariables/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/tenantvariables?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/tenantvariables/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/tenantvariables/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
variable_id | tv_al_id |
value | tv_value |
comment | tv_comment |
locked | tv_locked |
Examples
List Tenant Variables
Returns the tenant variables visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/tenantvariables?tenant=CANISTRACCI"
Get Tenant Variable
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/tenantvariables/OBJECT_ID?tenant=CANISTRACCI"
Create Tenant Variable
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 '{
"variable_id": 1,
"value": "docs-value",
"comment": "Docs API variable value"
}' \
"https://pbx.example.com/pbx/openapi.php/tenantvariables?tenant=CANISTRACCI"
Edit Tenant Variable
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "docs-updated-value"
}' \
"https://pbx.example.com/pbx/openapi.php/tenantvariables/OBJECT_ID?tenant=CANISTRACCI"
Delete Tenant Variable
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/tenantvariables/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. |
DISA
The DISA 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 | disa |
| Primary path | /disas |
| ID field | ds_id |
| Label field | ds_name |
| Primary source table | ds_disas |
| Required on create | ds_name |
| Path aliases | /disa, /disas |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/disas?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/disas/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/disas?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/disas/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/disas/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | ds_name |
mediafile_id | ds_me_id |
pin | ds_pin |
outbound | ds_outbound |
blockcid | ds_blockcid |
calleridnum | ds_calleridnum |
calleridname | ds_calleridname |
digitstimeout | ds_digitstimeout |
responsetimeout | ds_responsetimeout |
looponattempt | ds_looponattempt |
Examples
List DISAs
Returns the disas visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/disas?tenant=CANISTRACCI"
Get DISA
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/disas/OBJECT_ID?tenant=CANISTRACCI"
Create DISA
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 DISA",
"mediafile_id": 22,
"pin": "2468",
"outbound": "yes"
}' \
"https://pbx.example.com/pbx/openapi.php/disas?tenant=CANISTRACCI"
Edit DISA
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pin": "1357"
}' \
"https://pbx.example.com/pbx/openapi.php/disas/OBJECT_ID?tenant=CANISTRACCI"
Delete DISA
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/disas/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. |
Caller ID Blacklist
The Caller ID Blacklist 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 | calleridblacklist |
| Primary path | /calleridblacklists |
| ID field | bl_id |
| Label field | bl_callerid |
| Primary source table | bl_blacklists |
| Required on create | bl_callerid |
| Path aliases | /calleridblacklist, /calleridblacklists, /callerid_blacklist, /callerid_blacklists, /blacklist, /blacklists |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/calleridblacklists?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/calleridblacklists/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/calleridblacklists?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/calleridblacklists/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/calleridblacklists/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
callerid | bl_callerid |
reason | bl_reason |
inserted | bl_inserted |
Examples
List Caller ID Blacklists
Returns the caller id blacklists visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/calleridblacklists?tenant=CANISTRACCI"
Get Caller ID Blacklist
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/calleridblacklists/OBJECT_ID?tenant=CANISTRACCI"
Create Caller ID Blacklist
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 '{
"callerid": "+15559990000",
"reason": "Docs API blocked caller"
}' \
"https://pbx.example.com/pbx/openapi.php/calleridblacklists?tenant=CANISTRACCI"
Edit Caller ID Blacklist
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Updated documentation example"
}' \
"https://pbx.example.com/pbx/openapi.php/calleridblacklists/OBJECT_ID?tenant=CANISTRACCI"
Delete Caller ID Blacklist
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/calleridblacklists/OBJECT_ID?tenant=CANISTRACCI"
List Global Caller ID Blacklists
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/calleridblacklists?global=1"
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. |
Campaign
The Campaign 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 | campaign |
| Primary path | /campaigns |
| ID field | ca_id |
| Label field | ca_name |
| Primary source table | ca_campaigns |
| Required on create | ca_name |
| Path aliases | /campaign, /campaigns |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/campaigns?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/campaigns/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/campaigns?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/campaigns/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/campaigns/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | ca_name |
type | ca_type |
tech | ca_tech |
datestart | ca_datestart |
dateend | ca_dateend |
condition_id | ca_co_id |
callerid | ca_callerid |
calleridname | ca_calleridname |
state | ca_state |
queue_id | ca_qu_id |
message | ca_message |
confirmmessage_id | ca_confirmmessage_me_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 |
|---|---|
CAMPAIGN-ONCONNECT | onconnect, on_connect |
CAMPAIGN-DONOTCALL | donotcall, do_not_call |
Examples
List Campaigns
Returns the campaigns visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/campaigns?tenant=CANISTRACCI"
Get Campaign
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/campaigns/OBJECT_ID?tenant=CANISTRACCI"
Create Campaign
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 Campaign",
"type": "VOICE",
"tech": "PJSIP",
"callerid": "+15551234567",
"state": "PAUSED"
}' \
"https://pbx.example.com/pbx/openapi.php/campaigns?tenant=CANISTRACCI"
Edit Campaign
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": "ACTIVE"
}' \
"https://pbx.example.com/pbx/openapi.php/campaigns/OBJECT_ID?tenant=CANISTRACCI"
Delete Campaign
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/campaigns/OBJECT_ID?tenant=CANISTRACCI"
Campaign ONCONNECT Destination
Updates the CAMPAIGN-ONCONNECT 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 '{
"onconnect": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/campaigns/OBJECT_ID?tenant=CANISTRACCI"
Campaign DONOTCALL Destination
Updates the CAMPAIGN-DONOTCALL 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 '{
"donotcall": [
22
]
}' \
"https://pbx.example.com/pbx/openapi.php/campaigns/OBJECT_ID?tenant=CANISTRACCI"
Campaign Binary File References
Adds binary or fax-related files to the campaign. Use complete base64 data in production integrations.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"binary_files": [
{
"name": "docs-script.txt",
"data_base64": "VGhpcyBpcyBhIGRvY3VtZW50YXRpb24gZXhhbXBsZS4="
}
]
}' \
"https://pbx.example.com/pbx/openapi.php/campaigns/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. |
Campaign Number
The Campaign Number 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 | campaignnumber |
| Primary path | /campaignnumbers |
| ID field | cn_id |
| Label field | cn_number |
| Primary source table | cn_campaignnumbers |
| Required on create | cn_ca_id, cn_number |
| Path aliases | /campaignnumber, /campaignnumbers, /campaign_number, /campaign_numbers |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/campaignnumbers?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/campaignnumbers/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/campaignnumbers?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/campaignnumbers/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/campaignnumbers/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
campaign_id | cn_ca_id |
number | cn_number |
description | cn_description |
disposition | cn_disposition |
attempts | cn_attempts |
lastattempt | cn_lastattempt |
billsec | cn_billsec |
Examples
List Campaign Numbers
Returns the campaign numbers visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/campaignnumbers?tenant=CANISTRACCI"
Get Campaign Number
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/campaignnumbers/OBJECT_ID?tenant=CANISTRACCI"
Create Campaign Number
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 '{
"campaign_id": 44,
"number": "+15557654321",
"description": "Docs API campaign target"
}' \
"https://pbx.example.com/pbx/openapi.php/campaignnumbers?tenant=CANISTRACCI"
Edit Campaign Number
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"disposition": "CALLBACK",
"attempts": 1
}' \
"https://pbx.example.com/pbx/openapi.php/campaignnumbers/OBJECT_ID?tenant=CANISTRACCI"
Delete Campaign Number
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/campaignnumbers/OBJECT_ID?tenant=CANISTRACCI"
List Campaign Numbers for One Campaign
Filters the list by the parent campaign ID. The aliases caid and cn_ca_id are also accepted.
curl -X GET \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/campaignnumbers?tenant=CANISTRACCI&campaign_id=44"
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. |
Cron Job
The Cron Job 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 | cronjob |
| Primary path | /cronjobs |
| ID field | cr_id |
| Label field | cr_name |
| Primary source table | cr_cronjobs |
| Required on create | cr_name |
| Path aliases | /cronjob, /cronjobs, /cron_job, /cron_jobs |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/cronjobs?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/cronjobs/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/cronjobs?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/cronjobs/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/cronjobs/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | cr_name |
type | cr_type |
node_id | cr_no_id |
active | cr_active |
once | cr_once |
minute | cr_minute |
hour | cr_hour |
day | cr_day |
month | cr_month |
year | cr_year |
weekday | cr_weekday |
timezone | cr_timezone |
run | cr_run |
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 |
|---|---|
CRONJOB | destination, destinations |
Examples
List Cron Jobs
Returns the cron jobs visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cronjobs?tenant=CANISTRACCI"
Get Cron Job
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cronjobs/OBJECT_ID?tenant=CANISTRACCI"
Create Cron Job
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 Nightly Job",
"type": "CALL",
"active": "yes",
"minute": "0",
"hour": "2",
"timezone": "Europe/Rome"
}' \
"https://pbx.example.com/pbx/openapi.php/cronjobs?tenant=CANISTRACCI"
Edit Cron Job
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"active": "no"
}' \
"https://pbx.example.com/pbx/openapi.php/cronjobs/OBJECT_ID?tenant=CANISTRACCI"
Delete Cron Job
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/cronjobs/OBJECT_ID?tenant=CANISTRACCI"
List Global Cron Jobs
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/cronjobs?global=1"
Cron Job Destination
Updates the CRONJOB 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 '{
"destination": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/cronjobs/OBJECT_ID?tenant=CANISTRACCI"
Defaults, Schedule and Editor Rules
New cron jobs use the web editor's defaults: type=CUSTOM, active=yes, once=no, node_id=0, every minute, hour, day, month and year, weekday=ANY| and timezone=SYSTEM. An active job with the default schedule runs every minute, so send active=no while preparing it. Global and tenant new-item defaults apply before the request values. node_id=0 uses the tenant's cron server, or the system coordinator.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Daily task","active":"no","hour":"09","minute":"00","destination":[]}' \
"https://pbx.example.com/pbx/openapi.php/cronjobs?tenant=CANISTRACCI"
Schedule fields accept an integer or pipe-separated integers: minute 0–59, hour 0–23, day 1–31, month 1–12, year 1000–9999, weekday 1–7 (Monday–Sunday). Values are deduplicated, sorted and zero-padded: hour="9" becomes 09 and hour="9|17" becomes 09|17|.
The web editor rules also apply to the API:
- Only
CUSTOMjobs can be created, and the type of a job cannot be changed (invalid_cronjob_type). Only CUSTOM jobs have destinations, which must be available to the tenant as in the web destination chooser (destination_not_available). {"run":"yes"}starts a job immediately; the job must be active (409 cronjob_inactive).- A running job, or one awaiting review, cannot be changed or deleted (
409 cronjob_busy). - A job linked to a report cannot be deleted; manage its schedule from the report (
409 cronjob_report_linked).
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. |
Feature Code
The Feature Code 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 | featurecode |
| Primary path | /featurecodes |
| ID field | fe_id |
| Label field | fe_code |
| Primary source table | fe_features |
| Required on create | fe_code |
| Path aliases | /feature, /features, /featurecodes, /feature_codes, /feature_code |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/featurecodes?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/featurecodes/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/featurecodes?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/featurecodes/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/featurecodes/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
code | fe_code |
comment | fe_comment |
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 |
|---|---|
FEATURE | destination, feature |
Examples
List Feature Codes
Returns the feature codes visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/featurecodes?tenant=CANISTRACCI"
Get Feature Code
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/featurecodes/OBJECT_ID?tenant=CANISTRACCI"
Create Feature Code
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 '{
"code": "*880",
"comment": "Docs API feature code"
}' \
"https://pbx.example.com/pbx/openapi.php/featurecodes?tenant=CANISTRACCI"
Edit Feature Code
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"comment": "Docs API feature code updated"
}' \
"https://pbx.example.com/pbx/openapi.php/featurecodes/OBJECT_ID?tenant=CANISTRACCI"
Delete Feature Code
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/featurecodes/OBJECT_ID?tenant=CANISTRACCI"
List Global Feature Codes
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/featurecodes?global=1"
Feature Code Destination
Updates the 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 '{
"destination": [
"EXT-100"
]
}' \
"https://pbx.example.com/pbx/openapi.php/featurecodes/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. |
Standard feature mappings
Use CRUD on /featuremappings with code and feature_id. code must be a known standard function, such as PICKUP. feature_id is an available tenant/global feature ID, 0 for the default, or -1 to disable. Deleting a mapping removes its override. Use global=yes with a global key for shared mappings.
See Additional Configuration Operations for complete request fields, scope rules and examples.
Short Number
The Short Number 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 | shortnumber |
| Primary path | /shortnumbers |
| ID field | sn_id |
| Label field | sn_number |
| Primary source table | sn_shortnumbers |
| Required on create | sn_number |
| Path aliases | /shortnumbers, /short_numbers, /short_number |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/shortnumbers?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/shortnumbers/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/shortnumbers?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/shortnumbers/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/shortnumbers/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
number | sn_number |
destination | sn_destnumber |
destnumber | sn_destnumber |
comment | sn_comment |
Examples
List Short Numbers
Returns the short numbers visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/shortnumbers?tenant=CANISTRACCI"
Get Short Number
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/shortnumbers/OBJECT_ID?tenant=CANISTRACCI"
Create Short Number
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 '{
"number": "901",
"destination": "EXT-100",
"comment": "Docs API shortcut"
}' \
"https://pbx.example.com/pbx/openapi.php/shortnumbers?tenant=CANISTRACCI"
Edit Short Number
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destination": "QUEUE-700"
}' \
"https://pbx.example.com/pbx/openapi.php/shortnumbers/OBJECT_ID?tenant=CANISTRACCI"
Delete Short Number
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/shortnumbers/OBJECT_ID?tenant=CANISTRACCI"
List Global Short Numbers
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/shortnumbers?global=1"
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. |
Phone Book
The Phone Book 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 | phonebook |
| Primary path | /phonebooks |
| ID field | pb_id |
| Label field | pb_name |
| Primary source table | pb_phonebooks |
| Required on create | pb_name |
| Path aliases | /phonebook, /phonebooks, /phone_book, /phone_books |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/phonebooks?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/phonebooks/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/phonebooks?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/phonebooks/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/phonebooks/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | pb_name |
include_extensions | pb_includeext |
includeext | pb_includeext |
include_short_numbers | pb_includeshortnum |
includeshortnum | pb_includeshortnum |
layout | pl_phonebooklayouts |
items | pl_phonebooklayouts |
Important Notes
- The layout field replaces the phone book field layout. Values can be phone book item codes such as NAME, PHONE1, EMAIL, and ROUTING, or pi_phonebookitems IDs.
- When layout is omitted on create, the API creates the default layout NAME, PHONE1, PHONE2, EMAIL, ROUTING.
- Deleting a phone book removes its layout rows, entries, entry details, and phone assignment rows.
Examples
List Phone Books
Returns the phone books visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebooks?tenant=CANISTRACCI"
Get Phone Book
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebooks/OBJECT_ID?tenant=CANISTRACCI"
Create Phone Book
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 Phone Book",
"include_extensions": "no",
"include_short_numbers": "no",
"layout": [
"NAME",
"PHONE1",
"PHONE2",
"EMAIL",
"ROUTING"
]
}' \
"https://pbx.example.com/pbx/openapi.php/phonebooks?tenant=CANISTRACCI"
Edit Phone Book
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs API Phone Book Updated",
"layout": [
"NAME",
"PHONE1",
"EMAIL",
"ROUTING"
]
}' \
"https://pbx.example.com/pbx/openapi.php/phonebooks/OBJECT_ID?tenant=CANISTRACCI"
Delete Phone Book
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/phonebooks/OBJECT_ID?tenant=CANISTRACCI"
Replace Phone Book Layout
Replaces the pl_phonebooklayouts rows for the selected phone book.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"layout": [
"NAME",
"PHONE1",
"EMAIL",
"ROUTING"
]
}' \
"https://pbx.example.com/pbx/openapi.php/phonebooks/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. |
Download, bulk add, and clear one phone book
Use /phonebooks/{id}/entries to work with all stored contacts in one selected tenant phone book. Replace {id} with the phone book ID and supply the tenant code or name through tenant. A global API key must also select a tenant for these operations.
| Method | Operation | API key |
|---|---|---|
| GET | Download every stored entry and its field values as JSON, without pagination. | Full or read-only |
| POST | Append 1–500 entries in one request. | Full |
| DELETE | Delete all entries and their details from the selected phone book. | Full |
The download covers database contacts. Automatically included extensions and short numbers are not synthesized into the export. Deleting entries preserves the phone book definition, its layout, and its phone assignments. Other phone books and tenants are unchanged. To delete the phone book itself, use the separate DELETE /phonebooks/{id} operation.
Download all contacts
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebooks/8/entries?tenant=CANISTRACCI" \
-o phonebook.json
The response includes the phone book ID and name, a contact count, and an entries array. Each contact has its entry ID, a values object keyed by phone book field codes, and the stored detail records. An empty phone book returns "count": 0 and "entries": [].
{
"phonebook_id": 8,
"name": "Customers",
"count": 1,
"entries": [{
"id": 101,
"values": {"NAME": "Alice Smith", "PHONE1": "00123456789"},
"details": [
{"id": 201, "item_id": 1, "code": "NAME", "value": "Alice Smith"},
{"id": 202, "item_id": 2, "code": "PHONE1", "value": "00123456789"}
]
}]
}
The IDs in these examples are illustrative. Existing field codes and item IDs can be inspected with GET /phonebooks/8?tenant=CANISTRACCI in the related.available_items data.
Add several contacts
Send an object containing an entries array. Each entry contains a values object. Use configured field codes such as NAME, PHONE1, PHONE2, and EMAIL; field codes are case-insensitive. Values can be strings, numbers, or null. Keep phone numbers as strings to preserve leading zeros and plus signs. Null and empty values are omitted, and each contact must contain at least one non-empty value. Unknown or duplicate field codes are rejected.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"entries":[
{"values":{"NAME":"Alice Smith","PHONE1":"00123456789"}},
{"values":{"NAME":"Bob Jones","PHONE1":"+390212345678","EMAIL":"bob@example.com"}}
]}' \
"https://pbx.example.com/pbx/openapi.php/phonebooks/8/entries?tenant=CANISTRACCI"
A successful request returns HTTP 201 with IDs in request order:
{"phonebook_id":8,"created":2,"ids":[101,102]}
Missing database fields use the applicable New Item Defaults, as with other creation APIs. Tenant and phone book ownership always come from the authenticated scope and URL. Send larger imports in batches of at most 500 contacts. POST appends contacts; repeating a successful request creates additional entries.
To reuse a download as input, build a new object containing entries with only each contact's values. Do not submit exported IDs, detail records, or the download's name/count fields.
Clear the selected phone book
curl -X DELETE -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebooks/8/entries?tenant=CANISTRACCI"
{"phonebook_id":8,"deleted":true,"deleted_entries":2,"deleted_details":5}
No body is required. Clearing an already empty phone book succeeds with zero counts.
Transactions and failures
Each bulk POST or DELETE uses one checked database transaction. The phone book, entry, and detail tables must use InnoDB. If a contact cannot be inserted, the complete batch is rolled back, including entries inserted earlier in the request. Database truncation warnings also cause a rollback. A clear request followed by an import is two separate transactions.
Errors use the usual error.code and error.message response. Database failures include an error number and affected column when available, without exposing SQL or contact values. Transaction failures also include error.rolled_back (true if rollback completed, false if it could not be confirmed, null if no transaction started) and error.entry_index (the one-based entry position when available). Validation before a transaction can return the standard error shape without those additional fields.
{"error":{"code":"phonebook_bulk_failed","message":"Database error 1406 (column pd_pi_value) while saving entry 2 details. The transaction was rolled back.","rolled_back":true,"entry_index":2}}
If activity logging fails after the database commit, the response remains successful and includes a warning; the contacts have already been saved or deleted.
Alternative query-string routing
For installations that do not accept path information, use the same methods with:
https://pbx.example.com/pbx/openapi.php?object=phonebook&action=entries&id=8&tenant=CANISTRACCI
Phone Book Entry
The Phone Book Entry 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 | phonebookentry |
| Primary path | /phonebookentries |
| ID field | pe_id |
| Label field | pe_id |
| Primary source table | pe_phonebookentries |
| Required on create | phonebook_id, at least one value |
| Path aliases | /phonebookentry, /phonebookentries, /phonebook_entry, /phonebook_entries, /phonebookcontact, /phonebookcontacts, /phonebook_contact, /phonebook_contacts |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
phonebook_id | pe_pb_id |
pbid | pe_pb_id |
values | pd_phonebookdetails keyed by pi_code |
fields | pd_phonebookdetails keyed by pi_code |
details | pd_phonebookdetails rows |
NAME | phone book item code |
PHONE1 | phone book item code |
PHONE2 | phone book item code |
EMAIL | phone book item code |
ROUTING | phone book item code |
Important Notes
- Entry values are stored in pd_phonebookdetails and are keyed by pi_phonebookitems.pi_code.
- Send values as a values or fields object, as top-level item codes, or as detail rows containing pi_id or pi_code and a value.
- Sending an empty string or null for a value clears that field from the entry.
Examples
List Phone Book Entries
Returns the phone book entries visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI"
Get Phone Book Entry
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI"
Create Phone Book Entry
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 '{
"phonebook_id": 12,
"values": {
"NAME": "Ada Rivera",
"PHONE1": "+15551230001",
"EMAIL": "ada.rivera@example.com",
"ROUTING": "EXT-100"
}
}' \
"https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI"
Edit Phone Book Entry
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": {
"PHONE1": "+15551230002",
"EMAIL": "ada.updated@example.com"
}
}' \
"https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI"
Delete Phone Book Entry
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/phonebookentries/OBJECT_ID?tenant=CANISTRACCI"
List Entries for One Phone Book
Filters the phone book entry list by parent phonebook_id. The aliases pbid and pe_pb_id are also accepted.
curl -X GET \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI&phonebook_id=12"
Clear Phone Book Entry Value
Removes the EMAIL detail row for the selected entry while leaving other values unchanged.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": {
"EMAIL": ""
}
}' \
"https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI"
Search and Pagination
GET /phonebookentries accepts search filters, with full or read-only keys. Add phonebook_id (aliases pbid and pe_pb_id) to search one phone book.
| Parameter | Meaning |
|---|---|
name | Exact match on a saved NAME, FIRSTNAME, LASTNAME or COMPANY value. |
number | Exact match on PHONE1–PHONE7 or FAX. Leading zeros and + are kept; formatting is not normalized. |
search | Literal substring of those name and number fields. % and _ are ordinary characters. |
limit, offset | Optional pagination: limit 1–1000 (default 100 when offset is given), offset from 0. |
Filters are combined with AND and follow the database collation, as in the web interface (normally case and accent insensitive). Each contact is returned once, in phone book and entry ID order; no match returns []. Without limit and offset the complete list is returned, as before. To page, increase offset by limit until a page has fewer rows; there is no total count, and concurrent changes can move contacts between pages.
curl -G -H "X-API-Key: TENANT_API_KEY" \
--data-urlencode "tenant=CANISTRACCI" --data-urlencode "phonebook_id=8" \
--data-urlencode "search=Alice" --data-urlencode "limit=100" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries"
curl -G -H "X-API-Key: TENANT_API_KEY" \
--data-urlencode "tenant=CANISTRACCI" --data-urlencode "number=00123456789" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries"
Values must be UTF-8 strings of at most 255 characters without control characters (400 invalid_phonebook_filter); invalid pagination returns 400 invalid_phonebook_pagination. URL-encode the values: a plus sign is %2B.
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. |
All entries of one phone book
Use GET /phonebooks/{id}/entries to download all stored contacts, POST /phonebooks/{id}/entries to append up to 500 contacts atomically, and DELETE /phonebooks/{id}/entries to clear only the selected phone book. These operations require a selected tenant; writes require a full API key.
For request bodies, responses, and rollback behavior, see the Phone Book page.
Provisioning Phone
The Provisioning Phone 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 | provisioningphone |
| Primary path | /provisioningphones |
| ID field | ph_id |
| Label field | ph_name |
| Primary source table | ph_phones |
| Required on create | ph_name, ph_mac |
| Path aliases | /phone, /phones, /provisioningphones, /provisioning_phones, /provisioning_phone |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/provisioningphones?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/provisioningphones/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/provisioningphones?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/provisioningphones/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/provisioningphones/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
name | ph_name |
mac | ph_mac |
model_id | ph_pm_id |
password | ph_password |
filename | ph_filename |
http_user | ph_http_user |
http_password | ph_http_password |
Examples
List Provisioning Phones
Returns the provisioning phones visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/provisioningphones?tenant=CANISTRACCI"
Get Provisioning Phone
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/provisioningphones/OBJECT_ID?tenant=CANISTRACCI"
Create Provisioning Phone
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 Desk Phone",
"mac": "001122334455",
"model_id": 1,
"filename": "docs-api-001122334455.cfg"
}' \
"https://pbx.example.com/pbx/openapi.php/provisioningphones?tenant=CANISTRACCI"
Edit Provisioning Phone
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"http_user": "phone-user",
"http_password": "change-this-password"
}' \
"https://pbx.example.com/pbx/openapi.php/provisioningphones/OBJECT_ID?tenant=CANISTRACCI"
Delete Provisioning Phone
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/provisioningphones/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. |
Phone assignments and provisioning values
Use CRUD on /phonebuttonlayouts (phone_id, layout_id, order), /phonebookassignments (phone_id, phonebook_id, order), and /provisioningvalues (owner_id, type, order, label_id, value). For PHONE/LINE the owner is a phone; for BUTTON it is a button layout. PHONE uses order=0; LINE and BUTTON use a valid position. BUTTON order=0 stores phonebook mappings for a phonebook-enabled layout. All parents must belong to the selected tenant.
See Additional Configuration Operations for complete request fields, scope rules and examples.
Phone Resync
POST /phones/resync asks a registered phone to check its provisioning again, like the resync button of the web interface. A full global or tenant API key is required, with one exact tenant code or name, also for global keys. Read-only keys and extension Dial API Keys are refused. The query form is openapi.php?object=phone&action=resync.
curl -X POST -H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" -d '{"peer":"canistracci-100"}' \
"https://pbx.example.com/pbx/openapi.php/phones/resync?tenant=CANISTRACCI"
The body accepts only peer: the SIP username or PJSIP endpoint name shown in the extension and registration data. It is not the provisioning phone ID, the MAC address or the extension number. The command is sent to the server where the phone is currently registered, with the resync notification supported by its user agent.
| Result | Meaning |
|---|---|
200, delivery=pbx_accepted | The PBX accepted the resync command for every registration. |
404 phone_not_found | The peer does not exist in the tenant. |
409 phone_not_registered | The phone has no current registration. |
409 unsupported_device | The registered user agent does not support remote resync. Nothing was sent. |
502 resync_partial_failure | Some registrations were reached and others failed. Inspect results. |
502 resync_delivery_failed | Delivery could not be confirmed; commands may already have been sent. |
503 registration_server_unavailable | The registration server or its manager connection is not configured. |
pbx_accepted confirms that the PBX accepted the command, not that the phone downloaded or applied the configuration; the response always reports handset_refresh=unverified. There is no automatic retry: repeating the request sends the notification again.
AI Analysis
The AI Analysis endpoint returns transcript, AI summary, and sentimental analysis data for recorded calls. It is a read-only OpenAPI endpoint and supports GET only.
Use this endpoint when an integration already has an Asterisk uniqueid from CDR, Simple CDR, call events, or recording metadata and needs the AI results associated with that call.
Object Summary
| Property | Value |
|---|---|
| Object | aianalysis |
| Primary path | /aianalysis |
| Path aliases | /aianalysis, /aianalyses, /ai_analysis, /ai_analyses, /callanalysis, /call_analysis |
| Supported method | GET |
| Required filter | uniqueid |
| Default format | json |
| Source tables | rm_recordingmetadatas, tr_transcripts |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| Get AI analysis by unique ID | GET https://pbx.example.com/pbx/openapi.php/aianalysis?tenant=CANISTRACCI&uniqueid=1717240000.42 |
| Get AI analysis by path unique ID | GET https://pbx.example.com/pbx/openapi.php/aianalysis/1717240000.42?tenant=CANISTRACCI |
| Get multiple calls | GET https://pbx.example.com/pbx/openapi.php/aianalysis?tenant=CANISTRACCI&uniqueid=1717240000.42,1717240000.43 |
| Use an alias path | GET https://pbx.example.com/pbx/openapi.php/ai_analysis?tenant=CANISTRACCI&uniqueid=1717240000.42 |
Query Parameters
| Parameter | Description |
|---|---|
tenant | Tenant code or tenant name. Tenant API keys are restricted to their tenant. Global API keys can query one tenant by code or name, use % wildcards, or omit the parameter to search all tenants. |
uniqueid | Required comma-separated Asterisk unique ID values. A path value such as /aianalysis/1717240000.42 also maps to this filter. |
key | Optional API key query parameter. Prefer the X-API-Key header or bearer token for new integrations. |
Response Fields
| Field | Description |
|---|---|
tenant_id | Internal tenant ID. |
tenant_code | Tenant code. |
uniqueid | Asterisk unique ID requested by the integration. |
transcript | Full transcript text. When recording metadata does not contain a full transcript, MiRTA PBX builds this value from transcript segments. |
summary | AI-generated call summary. |
sentiment_score | First numeric sentimental analysis score found for the unique ID, or null. |
sentiment_scores | All distinct numeric sentimental analysis scores found for the unique ID. |
sentiment_brief | Short sentimental analysis text from recording metadata. |
sentiment_details | Detailed sentimental analysis payload. This may be JSON text depending on the configured AI processor. |
recordings | Per-recording metadata rows for the unique ID. |
transcript_segments | Timestamped transcript segments for the unique ID. |
Recording Fields
| Field | Description |
|---|---|
metadata_id | Internal recording metadata row ID. |
recording_id | Internal recording ID. |
date | Recording metadata date. |
transcript | Transcript stored on that recording metadata row. |
summary | Summary stored on that recording metadata row. |
sentiment_score | Numeric sentimental score for that recording metadata row, or null. |
sentiment_brief | Short sentimental analysis text for that recording metadata row. |
sentiment_details | Detailed sentimental analysis payload for that recording metadata row. |
Transcript Segment Fields
| Field | Description |
|---|---|
recording_id | Internal recording ID associated with the transcript segment. |
speaker | Speaker number assigned by the transcript processor. |
start | Segment start time. Numeric values are returned as numbers. |
end | Segment end time. Numeric values are returned as numbers. |
text | Transcript text for the segment. |
Examples
Get AI Analysis
Returns transcript, summary, and sentimental analysis data for one call unique ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/aianalysis?tenant=CANISTRACCI&uniqueid=1717240000.42"
Get AI Analysis by Path
Uses the path segment after /aianalysis as the unique ID filter.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/aianalysis/1717240000.42?tenant=CANISTRACCI"
Get Multiple AI Analysis Results
Requests more than one unique ID in a single call.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/aianalysis?tenant=CANISTRACCI&uniqueid=1717240000.42,1717240000.43"
Global Key Tenant Wildcard
Uses a global API key to search matching tenants. Use this only when unique IDs may need to be resolved across tenant boundaries.
curl -H "X-API-Key: GLOBAL_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/aianalysis?tenant=CAN%25&uniqueid=1717240000.42"
Example Response
[
{
"tenant_id": 12,
"tenant_code": "CANISTRACCI",
"uniqueid": "1717240000.42",
"transcript": "Speaker 1: Hello, how can I help you?",
"summary": "The caller asked for support and the agent scheduled a follow-up.",
"sentiment_score": 0.72,
"sentiment_scores": [0.72],
"sentiment_brief": "Positive",
"sentiment_details": "{...}",
"recordings": [
{
"metadata_id": 345,
"recording_id": 678,
"date": "2026-06-01 10:00:00",
"transcript": "Speaker 1: Hello, how can I help you?",
"summary": "The caller asked for support and the agent scheduled a follow-up.",
"sentiment_score": 0.72,
"sentiment_brief": "Positive",
"sentiment_details": "{...}"
}
],
"transcript_segments": [
{
"recording_id": 678,
"speaker": 1,
"start": 0.0,
"end": 3.4,
"text": "Hello, how can I help you?"
}
]
}
]
Important Notes
- The endpoint returns rows only for unique IDs that have recording metadata or transcript segments in the selected tenant scope. Unknown unique IDs are omitted from the response.
- If multiple recording metadata rows exist for the same unique ID, top-level transcript, summary, and sentiment text values are combined without duplicate text. The
recordingsarray preserves the per-recording values. sentiment_detailsis returned as stored. It may contain JSON text produced by the configured sentimental analysis model.- The endpoint checks available database columns before selecting transcript and metadata fields, so older installations may return fewer populated fields until their database upgrades are complete.
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 or tenant name is required when using a tenant API key. |
tenant_not_found | The tenant parameter did not match any visible tenant. |
uniqueid_required | The request did not include a usable uniqueid value. |
method_not_allowed | The endpoint is read-only and only supports GET. |
AI Logs
The AI Logs endpoint exports records from ai_ailogs. It is a read-only OpenAPI endpoint that supports JSON responses and downloadable CSV files.
Use this endpoint to report on conversations handled by the Talk with AI custom destination, including the conversation text, duration, caller ID, and token usage. To retrieve call transcripts, summaries, and sentimental analysis instead, use the /aianalysis endpoint.
Object Summary
| Property | Value |
|---|---|
| Object | ailog |
| Primary path | /ailogs |
| Path aliases | /ailog, /ailogs, /ai_log, /ai_logs |
| Supported method | GET |
| Default format | json |
| Export format | csv |
| Source table | ai_ailogs |
Authentication and Tenant Scope
The endpoint accepts tenant full API keys, tenant read-only API keys, global full API keys, and global read-only API keys. Supply the key in the X-API-Key header, as a bearer token, or in the key query parameter.
- A tenant API key can return records only for its own tenant.
- A global API key can select one tenant by code or name, use a
%wildcard, or omittenantto return records from all tenants. - If IP filtering is enabled for the selected key, the request must originate from an allowed IP address or network.
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List AI logs as JSON | GET https://pbx.example.com/pbx/openapi.php/ailogs?tenant=CANISTRACCI |
| Export AI logs as CSV | GET https://pbx.example.com/pbx/openapi.php/ailogs?tenant=CANISTRACCI&format=csv |
| Use the CSV export path | GET https://pbx.example.com/pbx/openapi.php/ailogs/export?tenant=CANISTRACCI |
| Filter by date range | GET https://pbx.example.com/pbx/openapi.php/ailogs?tenant=CANISTRACCI&start=2026-08-01%2000:00:00&end=2026-08-31%2023:59:59 |
| Get one row by path ID | GET https://pbx.example.com/pbx/openapi.php/ailogs/123?tenant=CANISTRACCI |
| Compatibility query form | GET https://pbx.example.com/pbx/openapi.php?object=ailogs&action=list&tenant=CANISTRACCI |
Query Parameters
| Parameter | Description |
|---|---|
tenant | Tenant code or tenant name. Tenant API keys are restricted to their tenant. Global API keys can use a code, name, % wildcard, or omit this parameter to search all tenants. |
start | Start date and time applied to ai_start. The default is today at 00:00:00. The date filter is not applied when id or uniqueid is supplied. |
end | End date and time applied to ai_start. The default is today at 23:59:59. The date filter is not applied when id or uniqueid is supplied. |
id | One or more comma-separated ai_id values. A path value such as /ailogs/123 maps to this filter. |
uniqueid | One or more comma-separated Asterisk unique ID values. |
callerid | One or more comma-separated exact caller ID values. |
customid | One or more comma-separated custom destination IDs from cu_customs. |
format | json or csv. The default is json. The /ailogs/export path defaults to csv. |
key | Optional API key query parameter. Prefer the X-API-Key header or bearer token for new integrations. |
Response and CSV Fields
JSON objects and CSV columns use the following fields in this order:
| Field | Description |
|---|---|
ai_id | Internal AI log row ID. |
ai_te_id | Internal tenant ID. |
ai_cu_id | Internal custom destination ID. |
cu_name | Name of the associated custom destination, when available. |
ai_uniqueid | Asterisk unique ID associated with the AI conversation. |
ai_callerid | Caller ID recorded for the conversation. |
ai_start | Conversation start date and time. |
ai_end | Conversation end date and time. |
ai_duration | Conversation duration. |
ai_talk | Conversation exchanged with the AI service. |
ai_total_tokens | Total tokens reported for the AI request. |
ai_input_tokens | Input tokens reported for the AI request. |
ai_output_tokens | Output tokens reported for the AI request. |
Examples
List Current-Day AI Logs
When no ID or date filter is supplied, the endpoint returns records started during the current day.
curl -H "X-API-Key: TENANT_READ_ONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/ailogs?tenant=CANISTRACCI"
Export a Date Range as CSV
curl -H "X-API-Key: TENANT_READ_ONLY_API_KEY" \
-o ai-logs.csv \
"https://pbx.example.com/pbx/openapi.php/ailogs/export?tenant=CANISTRACCI&start=2026-08-01%2000:00:00&end=2026-08-31%2023:59:59"
Get Logs by Unique ID
Supplying uniqueid disables the default current-day filter, so an older record can be retrieved without also setting a date range.
curl -H "Authorization: Bearer TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/ailogs?tenant=CANISTRACCI&uniqueid=1787740000.42"
Example JSON Response
[
{
"ai_id": 123,
"ai_te_id": 12,
"ai_cu_id": 34,
"cu_name": "AI Receptionist",
"ai_uniqueid": "1787740000.42",
"ai_callerid": "+390212345678",
"ai_start": "2026-08-26 09:30:00",
"ai_end": "2026-08-26 09:31:15",
"ai_duration": 75,
"ai_talk": ">> I need sales.\n<< I will connect you.",
"ai_total_tokens": 420,
"ai_input_tokens": 280,
"ai_output_tokens": 140
}
]
Important Notes
- The endpoint is read-only.
POST,PUT,PATCH, andDELETEare rejected. - Without
idoruniqueid, the default range is the current day. Setstartandendto export a different period. - When
idoruniqueidis supplied, the date range is intentionally ignored. - A global key without a
tenantparameter can return records from all tenants visible to that key. - The
ai_talkfield can contain sensitive conversation content. Store exports securely and restrict access to API keys. - Use
/aianalysis, not/ailogs, for recorded-call transcripts, summaries, and sentimental analysis.
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. |
api_ip_not_allowed | IP filtering is enabled and the client address is not in the key's allowed IP or network list. |
tenant_required | A tenant code or tenant name is required when using a tenant API key. |
tenant_not_found | The tenant parameter did not match any visible tenant. |
invalid_format | The format value is not json or csv. |
method_not_allowed | The endpoint is read-only and only supports GET. |
Additional Configuration Operations
Additional Configuration Operations
OpenAPI 1.2.0 adds the Configuration/Settings resources and related object operations listed below. All paths are relative to https://pbx.example.com/pbx/openapi.php. Supply the API key in X-API-Key and select the tenant with ?tenant=TENANT_CODE.
Collection and object operations
| Method and path | Operation |
|---|---|
| GET /resource | List the selected scope. |
| POST /resource | Create; returns HTTP 201 and the saved object. |
| GET /resource/{id} | Read one object. |
| PUT or PATCH /resource/{id} | Update supplied fields, preserving omitted fields. |
| DELETE /resource/{id} | Delete one object; returns deleted=true. |
These new lists accept limit (default 100, maximum 1000), offset (default 0), and equality filters using the documented short aliases, except secret, binary and template content fields. Use the returned id for item operations. A list returns an array; object responses include the native database fields, id, and object. Unknown or read-only fields are rejected. Only documented aliases or their corresponding native column names are accepted.
New-item defaults apply to omitted writable fields on creation: installation defaults first, then tenant defaults; explicit request values take precedence. IDs, tenant ownership and worker-maintained fields cannot be supplied. Related IDs are checked in the selected scope. Use a full key for writes; read-only keys can list and read metadata, with credentials and binary downloads withheld. Quick shortcuts require a global key because they belong to users.
Each mutation uses a checked transaction and requires InnoDB for all tables it modifies. A failure returns an error with code, message and rolled_back. Database errors report the number and, when available, the column, without exposing SQL or secret values. A post-commit activity-log failure returns a successful response with a warning. Use global=yes only on the explicitly listed resources, with a global key.
Query-string routing is also supported, for example openapi.php?object=manageruser&action=create&tenant=TENANT_CODE with POST JSON, or object=manageruser&id=8 with GET/PATCH/DELETE. JSON request bodies contain the object fields, not routing parameters.
Available resources
| Collection | Required fields when no new-item default supplies them | Purpose |
|---|---|---|
/managerusers | name, password | manageruser |
/quickshortcuts | us_id, name, link | quickshortcut |
/pickupgroups | number, name | pickupgroup |
/internalroutings | regexp, ex_id | internalrouting |
/parkingreturns | number, dialback | parkingreturn |
/parkinglots | name, start, end | parkinglot |
/callprivacyrules | callerid, action | callprivacy |
/autoanswers | field | autoanswer |
/dialbynamedirectories | name | dialbynamedirectory |
/dialbynameentries | dbn_id, type, type_id, number | dialbynameentry |
/digitalfaxes | number | digitalfax |
/alarmbindings | callerid | alarmbinding |
/mailtofaxes | name, host, username | mailtofax |
/mailtocalls | name, host, username, authtype | mailtocall |
/scheduledcalls | tobecalled | scheduledcall |
/dashboards | name | dashboard |
/dashboarditems | td_id, code | dashboarditem |
/linemonitors | name | linemonitor |
/xmltemplates | name, xmltemplate | xmltemplate |
/causecodes | code | causecode |
/cnamcacheentries | number, name | cnamcacheentry |
/extensiondialings | from, to | extensiondialing |
/translationrooms | name, basenumber | translationroom |
/translationlanguages | tr_id, number, language | translationlanguage |
/customdestinationinfos | cu_id | customdestinationinfo |
/customdestinationfiles | cu_id, name, binaryfile | customdestinationfile |
/provisioningvalues | ph_id, type, al_id | provisioningvalue |
/phonebuttonlayouts | ph_id, bl_id | phonebuttonlayout |
/phonebookassignments | ph_id, pb_id | phonebookassignment |
/featuremappings | code | featuremapping |
managerusers
Manager users are owned by the selected tenant. Read-only keys do not receive passwords.
Writable fields: name, password, description.
quickshortcuts
Global API key required, including reads. user_id is a real user ID, or 0 for default shortcuts. Links must be relative or HTTP(S).
Writable fields: us_id, name, order, icon_stack1, icon_stack2, icon_stack3, link, user_id.
pickupgroups
number identifies the pickup/call group; the name is unique to that tenant and number.
Writable fields: number, name.
internalroutings
extension_id must belong to the selected tenant. regexp must be a valid regular expression; deldigits is non-negative.
Writable fields: regexp, ex_id, adddigits, deldigits, extension_id.
parkingreturns
number and dialback are strings; leading zeros are preserved.
Writable fields: number, dialback, comment.
parkinglots
The tenant-code prefix is automatically added to name. start and end are numeric and inclusive (maximum 10001 spaces per API-created range). hosted must name an existing server. moh is 0 or tenant/global music on hold.
Writable fields: name, start, end, hosted, timeout, defaultreturnnumber, moh.
callprivacyrules
action: allow, kill, torture or deny. data_base64 optionally stores the recorded privacy message. CallerID must be unique per tenant.
Writable fields: callerid, action, media, datetime, data_base64.
autoanswers
Global rows are supported with a global key and global=yes. The shared scope is -1.
Writable fields: field, value, comment.
dialbynamedirectories
Deleting a directory removes its entries and extension membership links. Routing references block deletion.
Writable fields: name, description.
dialbynameentries
directory_id and type_id must be in the selected tenant; type is EXT or VOICEMAIL. number is the directory lookup number.
Writable fields: dbn_id, type, type_id, number, directory_id.
digitalfaxes
Use global=yes with a global key for installation-wide records (scope -1).
Writable fields: number, comment.
alarmbindings
Bindings apply to callerid in the selected tenant.
Writable fields: callerid, emailnotification, relayserver.
mailtofaxes
protocol is /imap or /pop3. transport is /notls, /ssl, /tls, /ssl/novalidate-cert or /tls/novalidate-cert. Defaults without a configured new-item value: /imap, port 143, /notls, folder INBOX and SENDEREMAIL authentication. rp_id is 0 or a response path in this tenant.
Writable fields: name, email, protocol, host, port, transport, username, password, folder, cidnum, faxquality, authtype, authdata, disabled, language, cidname, pagesize, unauthenticated, automaticrotate, parsedestination, alertemail, rp_id.
mailtocalls
Mailbox connection fields follow Mail to Fax. authtype is SENDEREMAIL or SENDEREMAILSECRET; the latter requires authsecret (16–128 printable characters, no spaces). An empty secret preserves the existing one. The hash is never returned. Runtime failure counters are read-only. Delete its scheduled calls before deleting a mailbox.
Writable fields: name, email, protocol, host, port, transport, username, password, folder, cidnum, authtype, authdata, disabled, cidname, unauthenticated, parsedestination, engine, language, voiceapiusername, voiceapipassword, voiceapihost, maxattempts, delaybetweenattempts, requestconfirm, maxdialings, authsecret.
scheduledcalls
Create with tobecalled and either uploaded audio in data_base64, or text with the JSON boolean tts: true. A full API key and a selected tenant are required. Destinations are strings; for example, 103 calls extension 103 in the selected tenant.
Writable fields: callerid, calleridname, tobecalled, notbefore, maxattempts, requestconfirm, calldelay, text, mediafile, mediafileext, mediatimelen, maxdials, senderemail, callstatus, data_base64, tts, dispatch (dispatch on creation only).
Generate speech from text
Set tts to the JSON boolean true and supply nonempty UTF-8 text of at most 5,000 bytes. Do not quote the boolean as "true". Do not combine tts: true with data_base64, mediafile, or sc_mediafile. Without tts: true, text remains descriptive and an audio upload is required for a new call.
Speech uses the selected tenant's configured engine and default voice, with global settings as fallback. Configure VOICEENGINE, VOICEENGINEVOICE, and the provider connection and credential settings in the PBX. Supported configured engines are Google Cloud Text to Speech, IBM Watson TTS, Microsoft Azure Cognitive Services, and Amazon AWS Polly. Provider hosts, credentials, engine and voice cannot be overridden in the scheduled-call request.
The API generates and converts speech to PCM WAV (mono, 8,000 Hz, 16-bit), then computes its hash, format and duration before saving the scheduled call. Alternatively, upload audio in this format using data_base64, up to 16 MiB decoded.
Example: call extension 103 with a spoken message
Replace the example PBX hostname and installation path, and replace YOUR_API_KEY with a full API key. This example selects tenant DEVEL and extension 103. With no notbefore default configured, omitting that field makes the call eligible for the next scheduled-call worker pass.
curl -X POST \
'https://pbx.example.com/pbx/openapi.php/scheduledcalls?tenant=DEVEL' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data-binary '{"tobecalled":"103","text":"This is a test call using text to speech.","tts":true}'
To schedule for a later time, add notbefore using YYYY-MM-DD HH:MM:SS in PBX server time. Omitted fields use New Item Defaults on creation; without overrides, new calls use READY, three attempts, three dials, and a 60-second delay between attempts. Creation returns HTTP 201 with the saved object and its id; delivery happens through the scheduled-call worker.
Update or regenerate a scheduled message
Use PUT or PATCH /scheduledcalls/{id} with tts: true to regenerate speech from supplied text, or from the stored text when text is omitted. Updating text without tts: true preserves the existing audio. Only READY/FAILED calls without an active or pending worker dispatch can be edited or deleted. IDs, ownership, worker counters and receipts are read-only.
curl -X PATCH \
'https://pbx.example.com/pbx/openapi.php/scheduledcalls/CALL_ID?tenant=DEVEL' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data-binary '{"text":"Your updated appointment reminder.","tts":true}'
Malformed JSON, invalid text, an invalid boolean, or conflicting audio/TTS inputs return HTTP 400. Missing or unsupported speech configuration returns 503; generation or audio-conversion failure returns 502. Updates to calls owned by the worker return 409. Responses use the standard JSON error object with code and message; transaction failures also report rolled_back. A failed speech generation does not create a scheduled call; failed regeneration preserves the existing call's text and audio.
Dispatch a call immediately
The scheduled-call worker checks for due calls once a minute. For time-critical messages, such as a one-time code for a number that cannot receive SMS, you can start the call at once. Send "dispatch": true when creating the call, or call POST /scheduledcalls/{id}/dispatch for an existing call. Both require a full API key and the call's tenant. Immediate dispatch ignores notbefore and uses the same dialplan, caller ID, confirmation and play-once options, and retry counters as the worker.
Example: create and call now
curl -X POST \
'https://pbx.example.com/pbx/openapi.php/scheduledcalls?tenant=DEVEL' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data-binary '{"tobecalled":"0583212345","text":"Your code is 4 7 1 9. Again: 4 7 1 9.","tts":true,"maxdials":2,"dispatch":true}'
The response is HTTP 201 with the saved call and a dispatch object. status is one of:
accepted: includesjob_id.not_dispatched: the call remains scheduled for the worker.held: Asterisk rejected or did not confirm the attempt, which now waits on the cron job review page.
not_dispatched and held also include code and message. The call is created even when the dispatch fails. dispatch must be a JSON boolean and is not accepted on PUT/PATCH.
Example: call an existing scheduled call now
curl -X POST \
'https://pbx.example.com/pbx/openapi.php/scheduledcalls/CALL_ID/dispatch?tenant=DEVEL' \
-H 'X-API-Key: YOUR_API_KEY'
HTTP 202 returns status: "accepted", the job_id of the attempt and the current call state, without audio. The request takes no body. The legacy form is POST openapi.php?object=scheduledcall&action=dispatch&id=CALL_ID&tenant=DEVEL. Acceptance means Asterisk started the call; it does not confirm that it was answered or heard. Read the call later for callstatus, numattempted and dtmfreceived.
Each dispatch counts against maxdials. To avoid two calls ringing at once, a call cannot be dispatched again for 90 seconds after any previous dispatch, including one started by the worker. The worker also does not dial a call during the 90 seconds after an immediate dispatch. notbefore is not changed, so a recipient who calls back through the special destination Check for scheduled calls based on callerid still hears the message. If the call is not answered, the worker retries it after the 90 seconds while maxdials allows. Set maxdials to 1 for a single attempt. On the cron job review page, immediate dispatches show the server as openapi: followed by the node name.
Immediate dispatch runs on the default cronjob server (Default cronjob server in global settings), so the API request must be served by that node. On other nodes it returns 409 coordinator_required and the call stays scheduled.
Errors use the standard JSON error object:
- 404: the call is not in the selected tenant.
- 403: read-only key.
- 409
scheduledcall_not_ready: the call is notREADY. - 409
dispatch_limit_reached:maxdialsormaxattemptsis used up. - 409
dispatch_held: a previous attempt awaits review. - 409
dispatch_recent: dispatched within the last 90 seconds. - 409
dispatch_conflict: the call changed concurrently. - 409
coordinator_requiredordispatch_unavailable: not available on this node or installation. - 503
asterisk_unavailable: the call stays scheduled. - 502
dispatch_rejectedordispatch_uncertain: the attempt is held on the cron job review page. Check active calls before allowing a retry there.
Advanced API keys need the dispatchScheduledCall operation allowed.
dashboards
Delete removes dashboard items and the corresponding dashboard setting. global=yes requires a global key and uses scope -1. The built-in Default dashboard cannot be deleted.
Writable fields: name.
dashboarditems
dashboard_id determines ownership; there is no writable tenant ID. code is an existing dashboard widget code, such as ONLINEEXTENSIONS. order controls display order. global=yes selects the global dashboard scope.
Writable fields: td_id, code, order, dashboard_id.
linemonitors
start_url, answer_url and end_url must be HTTP(S) URLs or empty. hosted is an existing server name or empty.
Writable fields: name, start_url, answer_url, end_url, hosted.
xmltemplates
xmltemplate contains the template text. Read-only keys receive metadata without template content.
Writable fields: name, description, xmltemplate.
causecodes
destinations is an ordered array of existing destination codes, such as EXT-100. Supply [] to clear the routing list; omit it to preserve routing. disposition: empty, CHANUNAVAIL, CONGESTION, BUSY, ANSWER, NOANSWER or CANCEL. global=yes selects scope 0 with a global key.
Writable fields: disposition, code, comment, destinations.
cnamcacheentries
number is unique within the selected tenant. New manual entries default to manual=on and the current datetime.
Writable fields: number, name, datetime, manual, note.
extensiondialings
from and to contain the extension dialing patterns; advanced follows the existing editor value (on or empty).
Writable fields: from, to, advanced.
translationrooms
Also available on installations where Translation Rooms is hidden from the menu. Deleting a room removes its language rows.
Writable fields: name, basenumber, minsilence, silencethreshold.
translationlanguages
room_id must belong to the selected tenant. number is the room offset; language is the TTS language and speaking is the voice name.
Writable fields: tr_id, number, language, speaking, welcome_text, room_id.
customdestinationinfos
customdestination_id must belong to the selected tenant. param1, param2 and param3 hold the custom type’s extended data. Their meaning depends on the destination type.
Writable fields: cu_id, param1, param2, param3, customdestination_id.
customdestinationfiles
customdestination_id must belong to the selected tenant. data_base64 stores arbitrary binary data, at most 16 MiB decoded. name is a stored label, not a server filesystem path. Full-key detail GET downloads data_base64; lists return data_bytes without content.
Writable fields: cu_id, name, binaryfile, data_base64, customdestination_id.
provisioningvalues
type is PHONE, LINE or BUTTON. owner_id is a phone ID for PHONE/LINE and a button layout ID for BUTTON. label_id must have the same type. PHONE uses order=0; LINE uses a line in the phone model range. BUTTON uses a position within the layout range; order=0 is reserved for phonebook mappings on a phonebook-enabled layout. Value strings may contain the template placeholders used by the web editor. Read-only keys do not receive values.
Writable fields: ph_id, type, order, al_id, value, owner_id, label_id.
phonebuttonlayouts
phone_id and layout_id must belong to the same selected tenant. order controls assignment order.
Writable fields: ph_id, bl_id, order, phone_id, layout_id.
phonebookassignments
phone_id and phonebook_id must belong to the same selected tenant. order controls assignment order.
Writable fields: ph_id, pb_id, order, phone_id, phonebook_id.
featuremappings
code must be a standard function from sf_standardfunctions, for example PICKUP. feature_id is a tenant/global feature ID, 0 for the system/global default, or -1 to disable. Deleting a mapping removes the override; the web page may recreate a default mapping. global=yes requires a global key and uses scope 0.
Writable fields: code, fe_id, feature_id.
Examples
curl -X POST -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"Reception","number":10}' \
'https://pbx.example.com/pbx/openapi.php/pickupgroups?tenant=TENANT_CODE'
curl -X POST -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"phone_id":8,"phonebook_id":12,"order":1}' \
'https://pbx.example.com/pbx/openapi.php/phonebookassignments?tenant=TENANT_CODE'
curl -X POST -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"owner_id":8,"type":"BUTTON","order":2,"label_id":5,"value":"100"}' \
'https://pbx.example.com/pbx/openapi.php/provisioningvalues?tenant=TENANT_CODE'
curl -X PATCH -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"Updated reception"}' \
'https://pbx.example.com/pbx/openapi.php/pickupgroups/OBJECT_ID?tenant=TENANT_CODE'
curl -X DELETE -H "X-API-Key: TENANT_API_KEY" \
'https://pbx.example.com/pbx/openapi.php/phonebookassignments/OBJECT_ID?tenant=TENANT_CODE'
The example parent, label and object IDs must be replaced with IDs from your installation. For BUTTON values the owner is the button layout, not the phone. To create a phonebook mapping, use a phonebook-enabled layout and order=0.
Generated internal phone book
GET /internalphonebook?tenant=TENANT_CODE returns entries with type, id, number and description, generated from configuration objects, parking slots and reserved numbers. Use limit, offset and optional search for an exact number or conduit prefix. Editing or deleting an entry means editing or deleting its source object. There is no separate writable internal-directory table. To avoid unbounded expansion, a legacy parking range larger than 100000 spaces produces an explicit error.
Extension technology conversion
POST /extensions/{id}/technology changes an extension between SIP, PJSIP, CUSTOM and VIRTUAL in one transaction. The extension ID, number, peer name, routing and queue memberships are preserved. SIP/PJSIP conversions retain the password and codec list unless replacements are supplied. Other technology fields are initialized from the target technology’s new-item defaults. Review target-specific settings after conversion; settings without an equivalent in the new technology are not migrated.
curl -X POST -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"technology":"PJSIP"}' \
'https://pbx.example.com/pbx/openapi.php/extensions/8/technology?tenant=TENANT_CODE'
Optional fields: secret (or password), allow (codec string), custom, virtual, providers (CUSTOM provider IDs), and items (VIRTUAL member extension IDs). The custom object accepts ce_dialoption, ce_auth_type, ce_auth_parameter, ce_usecid, ce_custom_param1. The virtual object accepts supported columns among ve_callerid, ve_mailbox, ve_timeout, ve_strategy; unavailable installation columns are rejected. Send other extension edits in a separate request.
A technology-only PATCH to /extensions/{id} with {"tech":"PJSIP"} also converts. Query routing: POST ?object=extension&action=technology&id=8&tenant=TENANT_CODE. Shared/custom PJSIP authentication or AOR links block conversion until normalized. An extension already used inside another virtual extension cannot become virtual. The response identifies the previous and new technology; a live PBX refresh failure returns a warning after the database change has committed. A database failure rolls the conversion back.
Voicemail messages and greetings
| Resource | Supported methods |
|---|---|
| /voicemails/{id}/messages | GET list, POST create |
| /voicemails/{id}/messages/{messageId} | GET, PUT, PATCH, DELETE |
| /voicemails/{id}/greetings | GET list, POST create |
| /voicemails/{id}/greetings/{name} | GET, PUT, PATCH, DELETE |
The voicemail ID is the mailbox configuration ID, and messageId is the recording’s database ID, not its position number. Greeting names: busy, unavail, greet, temp. Every operation checks both tenant and mailbox ownership. Use limit and offset for lists (100 by default, maximum 1000).
POST requires data_base64; greeting POST also requires name. Audio must be PCM WAV, mono, 8000 Hz, 16 bit, at most 16 MiB decoded, and the installation’s VOICEMAILFORMAT must be wav. Full-key detail GET returns data_base64; list responses and read-only keys omit audio. An existing greeting is replaced with PUT/PATCH, not another POST.
Message fields: folder (INBOX by default; also Old, Work, Family, Friends, Cust1–Cust5), callerid, flag (empty, Urgent or PRIORITY), category, origtime (Unix timestamp), and data_base64. PATCH folder moves the message within that mailbox. Storage paths, mailbox identity, message positions and analysis fields are generated/read-only. Replacing audio clears stale transcripts and summaries.
curl -H "X-API-Key: TENANT_API_KEY" \
'https://pbx.example.com/pbx/openapi.php/voicemails/8/messages?tenant=TENANT_CODE'
curl -X PATCH -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"folder":"Old"}' \
'https://pbx.example.com/pbx/openapi.php/voicemails/8/messages/42?tenant=TENANT_CODE'
curl -X PUT -H "X-API-Key: TENANT_API_KEY" -H "Content-Type: application/json" \
-d '{"data_base64":"BASE64_ENCODED_WAV"}' \
'https://pbx.example.com/pbx/openapi.php/voicemails/8/greetings/busy?tenant=TENANT_CODE'
Query routing is supported using object=voicemail&action=messages&id=8&item=42 or action=greetings&id=8&item=busy. Omit item for collection requests. DELETE requires one item and does not clear the entire mailbox.
SMS and MMS
The messaging endpoints use the same scheduled delivery queue and tenant SMS routing as the web interface. A concrete tenant code or name is required for every request, including requests authenticated with a global key. Full keys can send messages and download MMS attachment content. Full and read-only keys can retrieve stored message text and attachment metadata.
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /sms | Queue one outgoing SMS. |
| POST | /mms | Queue one outgoing MMS with one attachment. |
| GET | /sms | List stored SMS history. |
| GET | /mms | List stored MMS history. |
| GET | /sms/{id} | Retrieve one stored SMS. |
| GET | /mms/{id} | Retrieve one stored MMS and its attachment metadata. |
| GET | /mms/{id}/attachments/{attachment_id}/download | Download an original stored attachment as binary data. |
Sending
Send JSON with these fields:
to: required string containing one destination number, 2-79 digits with an optional leading+. Preserve leading zeroes by using a string.from: optional sender number or alphanumeric ID; maximum 80 letters, digits,+,_,.or-. Default is empty; the existing tenant routing may select or rewrite the sender.body: required nonempty UTF-8 text for SMS; optional for MMS. Tabs and newlines are allowed. The maximum is the lower ofMAXSMSLENGTH(1024 when unset) and the databasesm_bodycolumn capacity (normally 255 characters). Overlong messages are rejected without truncation.not_before: optional future date/time inYYYY-MM-DD HH:MM:SSusing PBX server time, years 1970-2037. Defaults to the current database time. Past times are rejected.attachment: required for MMS only. An object containingfilenameanddata_base64. Use a basename of 1-200 letters, digits,_,.or-, starting with a letter or digit. Supply canonical base64 encoding of a nonempty file, maximum 16 MiB. Provider limits may be lower. One outgoing attachment is supported, matching the existing sender. MMS to internal SIP/PJSIP extensions is rejected because their existing delivery path does not send media.
Unknown message or attachment fields are rejected. Sending requires InnoDB for the tenant, history, delivery queue and (for MMS) media tables. The history row, attachment and queue entry are committed together, or rolled back together if a write fails.
curl --request POST 'https://pbx.example.com/pbx/openapi.php/sms?tenant=TENANT' \
--header 'X-API-Key: YOUR_FULL_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"to":"+390212345678","from":"+390298765432","body":"Hello from MirtaPBX"}'
For MMS, encode the local file, then submit the JSON using jq. This example uses uuencode -m for base64 encoding:
jq -n \
--arg to '+390212345678' \
--arg from '+390298765432' \
--arg data "$(uuencode -m /tmp/photo.jpg photo.jpg | sed '1d;$d' | tr -d '\n')" \
'{to:$to,from:$from,body:"Photo attached",attachment:{filename:"photo.jpg",data_base64:$data}}' \
| curl --request POST 'https://pbx.example.com/pbx/openapi.php/mms?tenant=TENANT' \
--header 'X-API-Key: YOUR_FULL_API_KEY' \
--header 'Content-Type: application/json' \
--data-binary @-
A successful send returns HTTP 202 Accepted:
{"id":123,"queue_id":456,"type":"sms","tenant_id":15,"status":"queued","to":"+390212345678","from":"+390298765432","not_before":"2026-10-25 14:30:00"}
HTTP 202 confirms queuing, not delivery. croncheck.php dispatches the message using the existing tenant SMS routing and DEFAULTSMSSERVER setting; external MMS requires an MMS-capable provider. The returned id identifies the SCHEDULED history row. The existing sender writes separate delivery history and does not update that row. queue_id identifies the pending delivery entry, which is consumed by the existing dispatcher. Repeating a successful POST creates another message.
Retrieving history
Both lists return newest IDs first and accept:
limit: 1-500, default 100.before_id: return older IDs; usenext_before_idfrom the preceding page.direction:INorOUT.from,to,status: exact-match filters. Status is the stored value, such asSCHEDULED,RECEIVEDorDELIVERED.start,end: inclusive PBX server date/time bounds, inYYYY-MM-DD HH:MM:SSformat.
curl --get 'https://pbx.example.com/pbx/openapi.php/sms' \
--header 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'tenant=TENANT' \
--data-urlencode 'direction=IN' \
--data-urlencode 'start=2026-10-25 00:00:00' \
--data-urlencode 'end=2026-10-25 23:59:59' \
--data-urlencode 'limit=100'
The response is {"data":[...],"limit":100,"has_more":false,"next_before_id":null}. No total COUNT query is performed. Each message contains id, tenant_id, type, datetime, direction, from, to, body, status, real_source, from_type, to_type and unread. Detail responses also contain an attachments array with id, filename and bytes for each stored attachment.
Example History Response
{
"data": [
{
"id": 123,
"tenant_id": 15,
"type": "sms",
"datetime": "2026-10-25 14:30:00",
"direction": "IN",
"from": "+390212345678",
"to": "+390298765432",
"body": "Message received",
"status": "RECEIVED",
"real_source": "",
"from_type": "SMS",
"to_type": "SMS",
"unread": true
}
],
"limit": 100,
"has_more": false,
"next_before_id": null
}
SMS/MMS classification follows the stored sm_mms=yes flag. Only retained history/media can be retrieved; if message storage was disabled for an incoming message, its body is not recoverable through the API. Reading does not mark a message as read. Raw provider responses and media access keys are omitted.
curl 'https://pbx.example.com/pbx/openapi.php/mms/123?tenant=TENANT' \
--header 'X-API-Key: YOUR_API_KEY'
curl 'https://pbx.example.com/pbx/openapi.php/mms/123/attachments/789/download?tenant=TENANT' \
--header 'X-API-Key: YOUR_FULL_API_KEY' \
--output /tmp/received-photo.jpg
The download returns application/octet-stream with an attachment filename and the original bytes. Unknown messages, mismatched types, foreign-tenant messages and unavailable attachments return HTTP 404. Read-only sending/downloading returns 403; invalid payloads/filters return 400; unsupported methods return 405; incompatible configuration returns 409. Errors use the standard JSON error structure. A rejected write includes rollback information when a transaction was started.
Query-style routing is also supported: ?object=sms&action=send&tenant=TENANT with POST, ?object=sms&action=list&tenant=TENANT, ?object=mms&action=get&id=123&tenant=TENANT, and ?object=mms&action=download&id=123&attachment_id=789&tenant=TENANT with GET.
Faxes
The fax endpoints send documents through the existing fax worker and retrieve retained fax history and documents. Every request requires a concrete tenant code or name, including requests using a global API key. Full keys can send faxes and download documents; full and read-only keys can retrieve metadata and delivery attempts.
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /faxes | Convert and queue one document for one destination. |
| GET | /faxes | List stored inbound and outbound fax history. |
| GET | /faxes/{id} | Retrieve one fax and its recent delivery attempts. |
| GET | /faxes/{id}/download | Download the fax document as PDF. |
Sending a Fax
Submit JSON with these fields:
| Field | Required | Description |
|---|---|---|
to | Yes | One destination string: 1-80 digits, * or #, with at least one digit and an optional leading +. Strings preserve leading zeroes. |
document | Yes | Object with filename and data_base64. Use a basename ending in .pdf, .tif or .tiff, maximum 255 characters. Encode the complete nonempty file as canonical base64, maximum 16 MiB before encoding. |
from | No | Sender number, maximum 80 characters including an optional leading +; digits, * and # are accepted. Default empty; the existing DID/tenant routing selects or rewrites the outbound caller ID. |
from_name | No | Sender name, maximum 255 UTF-8 characters without control characters. |
quality | No | 204x98 (default), 204x196 or 204x392. |
page_size | No | a4, letter, legal, or empty to retain the source size. When omitted, the tenant/global FAXPAGEFORMAT setting applies, or the original PDF size if unset. |
automatic_rotate | No | JSON boolean; default true. Rotate landscape PDF pages when pdftk is installed. |
not_before | No | Delivery date/time in YYYY-MM-DD HH:MM:SS using PBX server time. Defaults to database NOW(); past dates are rejected. |
status_email | No | One email address for the existing fax status notifications. |
delete_after_send | No | JSON boolean; default false. Tenant/system ALWAYSDELETEFAX=on forces deletion regardless of the requested value. |
routing_profile_id | No | Default 0 uses the normal source-DID/tenant fax routing. Tenant keys may select the tenant's default FAX profile or a FAX profile assigned to one of its DIDs. Global full keys can select any existing FAX profile. Voice/SMS profiles are rejected. |
Documents are converted to fax-ready Group 4 TIFF and must contain 1-500 pages. Both the uploaded file and final TIFF are limited to 16 MiB. TIFF uploads use an intermediate PDF, limited to 20 MiB. Invalid/unconvertible documents are rejected before a fax is queued. Conversion uses the existing fax helpers with bounded subprocess execution and private temporary files. Required tools are pdfinfo, Ghostscript, tiffinfo and timeout; TIFF input also requires tiff2pdf. Automatic rotation uses pdftk when available.
This Bash example sends /tmp/fax.pdf using uuencode -m and jq. The base64 data is read from a stream rather than passed as a shell argument, so larger documents avoid command-line argument limits:
jq -n \
--arg to '+390212345678' \
--arg from '+390298765432' \
--rawfile data <(uuencode -m /tmp/fax.pdf fax.pdf | sed '1d;$d' | tr -d '\n') \
'{to:$to,from:$from,document:{filename:"fax.pdf",data_base64:$data},quality:"204x196"}' \
| curl --request POST 'https://pbx.example.com/pbx/openapi.php/faxes?tenant=CANISTRACCI' \
--header 'X-API-Key: YOUR_FULL_API_KEY' \
--header 'Content-Type: application/json' \
--data-binary @-
A successful request returns HTTP 202 Accepted:
{
"id": 123,
"tenant_id": 15,
"status": "queued",
"fax_status": "READY",
"to": "+390212345678",
"from": "+390298765432",
"pages": 2,
"size": 42110,
"not_before": "2026-10-25 14:30:00",
"delete_after_send": false
}
HTTP 202 confirms queuing, not successful delivery. The API uses the tenant/system fax storage configuration: database or S3/Wasabi. Older tenant schemas inherit the system settings. A fax becomes READY only after conversion and storage succeed. The existing checksendfax.php worker handles scheduling, routing, retries, channel limits and notifications. Poll GET /faxes/{id} for the latest stored status and error. Repeating a successful POST queues another fax; this endpoint does not deduplicate repeated submissions.
Listing Faxes
GET /faxes returns newest IDs first, without a total COUNT query. It accepts:
limit: 1-500, default 100.before_id: continue with thenext_before_idfrom the preceding page.direction:INorOUT.from,to,status: exact stored-value matches, for exampleREADY,SENDING,SUCCESS,FAILEDorBUSY. Status/error values are not translated.start,end: inclusive fax creation date/time bounds, inYYYY-MM-DD HH:MM:SSusing PBX server time. These filter the creation date, not the scheduled delivery time.
curl --get 'https://pbx.example.com/pbx/openapi.php/faxes' \
--header 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'tenant=CANISTRACCI' \
--data-urlencode 'direction=OUT' \
--data-urlencode 'start=2026-10-25 00:00:00' \
--data-urlencode 'end=2026-10-25 23:59:59' \
--data-urlencode 'limit=100'
The list response is {"data":[...],"limit":100,"has_more":false,"next_before_id":null}. When has_more is true, repeat the same filters with before_id set to the returned next_before_id.
Fax Details and Delivery Status
curl 'https://pbx.example.com/pbx/openapi.php/faxes/123?tenant=CANISTRACCI' \
--header 'X-API-Key: YOUR_API_KEY'
List/detail metadata contains id, tenant_id, date, direction, from, from_name, to, remote_id, status, attempt, error, pages, size, filename, status_email, not_before, delete_after_send, rescheduled_as, routing_profile_id, processing_icon and processing_note. The document bytes and storage credentials are excluded.
Details additionally include the newest 100 delivery-attempt records in attempts, ordered by attempt record ID descending. attempts_truncated is true if older attempt records were omitted. Each attempt contains id, date, remote_id, status, dial_status, error, attempt, ecm, rate, modem and status_extra.
Downloading the Document
curl 'https://pbx.example.com/pbx/openapi.php/faxes/123/download?tenant=CANISTRACCI' \
--header 'X-API-Key: YOUR_FULL_API_KEY' \
--output /tmp/received-fax.pdf
Downloads require a full API key and return application/pdf with Content-Disposition: attachment and the actual Content-Length. Ordinary incoming PDF data is returned directly; outgoing TIFF and fast-on-net TIFF are converted to PDF. Database and S3/Wasabi storage use the same download flow as the web interface. Failed or partial faxes can be downloaded when retained document data is available. If the document has been deleted, its metadata can still be retrieved while the history row exists.
Errors and Compatibility
Errors use the standard JSON error.code/error.message response. Common statuses are 400 for invalid payloads, base64 or filters; 403 for read-only sending/downloading; 404 for unknown/foreign-tenant IDs, unavailable documents or disallowed routing profiles; 405 for unsupported methods; 409 for incompatible storage or missing transactional support; 422 for document conversion failure; and 502 for remote storage/download failure. Sending requires InnoDB for the fax and tenant tables. Failed preparation or publication does not leave a fax ready for delivery.
The singular path /fax is an alias. Query-style routing is supported with object=fax (or faxes): POST with action=send; GET with action=list, action=get&id=123, or action=download&id=123. Every form requires tenant.
Queue Logs
Historical queue logs
These read-only endpoints retrieve historical events from queue_log and the aggregated results shown by Status / Queue History. Both full and read-only API keys are accepted. Every request must select one exact tenant code or tenant name, including requests using a global key.
| Endpoint | Result |
|---|---|
GET /queuelogs | Queue History aggregation, including recording metadata. |
GET /queuelogs/history | Alias for the same aggregation. Add view=simple for the Simple Queue History query. |
GET /queuelogs/raw | Individual stored events, ordered by ascending log ID. |
GET /queuelogs/history/download | Download aggregated history as CSV. |
GET /queuelogs/raw/download | Download individual stored events as CSV. |
Ordinary endpoints default to JSON. Add format=csv to download CSV instead. The download paths default to CSV. All forms apply the same filters and pagination.
Filters
| Parameter | Meaning |
|---|---|
tenant | Required, exact tenant code or name. Wildcard and cross-tenant selection are rejected. |
start, end | Inclusive event timestamps in PBX server time: YYYY-MM-DD HH:MM:SS. Defaults to the start of the day seven days ago through the end of today. The same time prefilter is used by the Queue History page, so events outside the interval do not contribute to a call's aggregate. |
queue_id | Optional internal qu_id, not the dialable queue number. A queue outside the selected tenant returns 404. |
callid, agent | Exact stored call or agent identifier. In history mode, agent filtering is applied after aggregating the call events. |
event | Raw mode only. Exact event such as ENTERQUEUE, CONNECT or ABANDON. |
disposition | History only. Exact aggregated English value, such as ANSWERED, ABANDONED, TRANSFERRED or TIMEOUT. |
view | History only: complete (default) or simple. Simple mode omits recording metadata. |
limit | Page size, 1–10000. Defaults to 100 for JSON and 1000 for CSV. |
offset | Zero-based offset, default 0, maximum 10000000. |
after_id | Raw mode only. Retrieve rows whose ID is greater than this value. Use next_after_id and offset=0 for subsequent incremental pulls. |
Examples
# Aggregated Queue History, using the same SQL as the page
curl --get 'https://pbx.example.com/pbx/openapi.php/queuelogs' \
--header 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'tenant=TENANT_CODE' \
--data-urlencode 'queue_id=25' \
--data-urlencode 'start=2026-11-01 00:00:00' \
--data-urlencode 'end=2026-11-01 23:59:59'
# Download raw events as CSV
curl --get 'https://pbx.example.com/pbx/openapi.php/queuelogs/raw/download' \
--header 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'tenant=TENANT_CODE' \
--data-urlencode 'start=2026-11-01 00:00:00' \
--data-urlencode 'end=2026-11-01 23:59:59' \
--data-urlencode 'limit=10000' \
--dump-header queue-log-headers.txt --output queue-log-events.csv
# Download the Queue History aggregation as CSV
curl --get 'https://pbx.example.com/pbx/openapi.php/queuelogs/history/download' \
--header 'X-API-Key: YOUR_API_KEY' \
--data-urlencode 'tenant=TENANT_CODE' \
--data-urlencode 'view=simple' \
--output queue-history.csv
Results and pagination
JSON responses contain data, tenant_id, mode, view, start, end, limit, offset, has_more, next_offset and next_after_id. Continue with offset=next_offset until has_more is false. Raw results additionally provide next_after_id when another page exists; use it with after_id and reset offset to 0.
CSV is also paginated. Check X-Has-More and continue using X-Next-Offset, or X-Next-After-Id for raw results. Each CSV page includes its header row. Downloading one page does not imply that every matching record was returned.
Raw rows contain id, time, callid, queuename, agent, event and data1 through data5. CSV exports these database columns; it is not an Asterisk pipe-delimited log file. Only events belonging to an existing queue in the tenant can be attributed to that tenant. Raw mode includes REALTIME and NONE call IDs when their queue belongs to the selected tenant; aggregated history excludes them, matching the page.
History returns one row per queue/call with its time, queue name, caller number and name, disposition, hangup party, pause reason, agent and agent name, transfer destination, hold/call times, original position, call ID, queue ID and composite queue row ID. Complete mode adds the selected recording metadata ID, summary, transcript, sentiment score and emotional analysis. UI links and action-icon HTML are omitted. History is ordered by time descending, then queue ID and call ID descending.
Tenant privacy rules are preserved: inbound caller digits are masked in history; raw data1 through data5 become [hidden] if either inbound or outbound number privacy is enabled. Reads do not change queue logs or run transfer repair. Unsupported methods return 405; invalid filters return 400; missing or foreign queue IDs return 404.
Peer Counts
The Peer Counts endpoint is the read-only OpenAPI equivalent of proxyapi.php?reqtype=COUNTPEERS. It returns a count for each configured PBX node and a cluster total.
Endpoint and authentication
GET https://pbx.example.com/pbx/openapi.php/countpeers
GET https://pbx.example.com/pbx/openapi.php/countpeers?tenant=CANISTRACCI
The query-style equivalent is GET openapi.php?object=countpeers&tenant=CANISTRACCI. Only GET is supported.
Use a full or read-only global or tenant API key, sent using X-API-Key, Authorization: Bearer, or the key query parameter. Extension Dial API Keys are not accepted. The existing API key IP restrictions and tenant OpenAPI access setting apply.
| Parameter | Meaning |
|---|---|
tenant | One exact tenant code or name. Required for tenant keys. With a global key, omit it for all tenants, or provide it to filter one tenant. Codes take precedence over display names. Ambiguous names return HTTP 409. Wildcards are not expanded. |
Examples
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/countpeers"
curl -H "X-API-Key: TENANT_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/countpeers?tenant=CANISTRACCI"
To obtain a breakdown for multiple tenants, repeat the filtered request for each tenant using a global key or the appropriate tenant keys.
Response and counting rules
{
"node1": 120,
"node2": 85,
"total": 205
}
The JSON properties use the configured node names. Each value is the sum of:
- CHAN_SIP: monitored online peers reported by
sip show peers. This includes OK and LAGGED peers; unmonitored peers are excluded. - PJSIP: contact objects reported by
pjsip list contacts, including contacts regardless of qualification status and configured static contacts.
This preserves the counting meaning of the legacy command. It is not a count of distinct registered endpoints or physical phones: several contacts for one endpoint count separately, and the same peer appearing on several nodes contributes to each node and to the total.
Tenant filtering uses the tenant's actual SIP peer names and PJSIP endpoint AOR assignments, with exact matching. It does not search for the tenant code as an arbitrary substring of a peer name. Custom peer names are included when they belong to that tenant.
Counts are obtained from live Asterisk manager read commands, without registering or unregistering phones, reloading modules, or changing PBX configuration. Nodes are queried sequentially, so the response is not an atomic cluster snapshot.
Empty results and errors
A node without a particular channel driver contributes zero for that technology. A node with no matching peers or contacts contributes zero. With no configured nodes the result is {"total":0}.
If an AMI connection or command fails, or its response cannot be interpreted, the request returns HTTP 502 peer_counts_unavailable. No partial total is returned as a successful response. Missing AMI connection settings also produce 502.
Invalid API keys return 401; denied IP addresses or disabled tenant OpenAPI access return 403; unknown tenants return 404; ambiguous tenant names return 409; unsupported HTTP methods return 405. Database read failures or invalid peer/node configuration return 500. Node names must be unique and cannot be total, which is reserved for the total property. Peer/AOR names queried for a tenant must use letters, digits, underscores, hyphens, dots, @, colons or plus signs and contain at most 255 characters.
Translations
The Translations endpoint is the read-only OpenAPI equivalent of Admin / Translations. It returns the interface texts for one language: the English source text, the page where it is shown, the stored translation and the text users actually see. Each row has a stable ID and a content version, so an integration can detect added, changed and removed texts.
Endpoint and authentication
GET https://pbx.example.com/pbx/openapi.php/translations?language=it-IT
GET https://pbx.example.com/pbx/openapi.php/translations/languages
The query-style equivalents are GET openapi.php?object=translations&language=it-IT and GET openapi.php?object=translations&action=languages. Only GET is supported.
Translations are shared by all tenants, so a full or read-only global API key is required, sent using X-API-Key, Authorization: Bearer, or the key query parameter. Tenant API keys return HTTP 403 and the endpoints are not listed in the tenant specification. The existing API key IP restrictions apply. Reads never change the translation tables.
| Parameter | Meaning |
|---|---|
language | Required for /translations. Language and sublanguage, for example it-IT or he_IL. Use the values returned by /translations/languages; codes containing a dash, such as zh-Hant-TW, are resolved using the configured languages. |
file | Optional. Exact, case-sensitive page name, for example extension.php. An empty value selects the global texts, which are shared by all pages. |
limit | Page size, 1–5000, default 1000. |
cursor | The next_cursor value of the previous page. Omit it to start from the beginning. |
Examples
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/translations/languages"
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/translations?language=it-IT&file=extension.php"
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/translations?language=it-IT&limit=5000&cursor=NEXT_CURSOR"
Response
{
"object": "translations",
"language": "it-IT",
"translations_enabled": true,
"data": [
{
"id": "12e4671110640219437354c03a40ca32",
"file": "extension.php",
"text": "Save",
"language": "it-IT",
"translation": "",
"effective_translation": "Salva",
"version": "94c77638aa4c302e2cb6723f621b5fd7f2de544c"
}
],
"limit": 1000,
"has_more": true,
"next_cursor": "1137920"
}
| Field | Meaning |
|---|---|
id | Stable key of the page and English text. It changes only if the English text or the page changes. |
file, text | Page where the text is shown, and the English source text. An empty file is a global text. |
translation | Value stored for this page and language, as shown on the Translations page. Empty when missing. |
effective_translation | Text users see. When the page has no translation, the PBX uses the global translation, then the first translation of the same text on another page, then the English text. Values are returned unescaped. |
version | Hash of file, text, language, translation and effective translation. It changes whenever any of them changes. |
translations_enabled | False when the global Use translations setting is off. Users then see the English texts, and effective_translation equals text. |
/translations/languages returns language, code, sublanguage, name and enabled (offered in the language selector) for each configured language.
Detecting changes
The translation tables have no update timestamp. To find changes, read every page, following next_cursor until has_more is false, and compare the result with the previous run: a new id is a new text, a different version is a changed text or translation, and a missing id is a removed text. A page can contain fewer rows than limit, or none, while has_more is true. Each page is read from a consistent snapshot.
The PBX records a text the first time a page displays it. The list therefore contains the texts already shown at least once on the system; texts of pages never opened appear after their first use. Clean not translated texts removes texts without a translation in any language, so they disappear until they are displayed again.
Errors
A missing or invalid language returns HTTP 400 invalid_language; invalid file, limit or cursor values return 400. Invalid API keys return 401; tenant keys and denied IP addresses return 403; unknown paths or actions return 404; unsupported HTTP methods return 405. Database read failures return 500.
Firewall
The /firewall resource exposes the options from Admin > Security > GeoIP/Fail2Ban Filters, the allowed country list, and cached firewall status from the PBX nodes. It applies to the entire installation.
Authentication and application
Use a global API key and omit tenant. Full and read-only global keys can read configuration and status. Changes require a full global key. Tenant keys and extension Dial API Keys cannot use this resource.
Send the key using X-API-Key or Authorization: Bearer. The examples use fictional addresses and keys. Replace them with your own values.
Writes save the same database options as the web interface. The normal scheduled firewall processes apply them on the nodes. A successful save returns application: "scheduled"; it does not confirm that every node has applied the configuration. Check the cached status and warnings separately. The API does not execute an immediate firewall reload, restart, ban/unban, or GeoIP database download.
Routes
| Method | Path | Behavior |
|---|---|---|
| GET | /firewall | Read all supported options, selected countries, and the GeoIP warning flags shown on the Security page. |
| POST, PUT, PATCH | /firewall | Create or update supplied option overrides and optionally replace the selected countries. Unspecified fields are preserved for all three methods. |
| GET | /firewall/settings/{code} | Read one known option, its value and its reset default. |
| POST, PUT, PATCH | /firewall/settings/{code} | Set one option using an object containing only value. |
| DELETE | /firewall/settings/{code} | Reset that option to its web default. This does not delete the entire firewall configuration. |
| GET | /firewall/countries | List country codes and names, with an allowed boolean. |
| POST, PUT, PATCH | /firewall/countries | Replace the selection using {"countries":["IT","NL"]}. |
| DELETE | /firewall/countries | Clear the selected countries. |
| GET | /firewall/status | Read cached Fail2Ban and SIP rate status, including checker warnings, paginated by node. |
| GET | /firewall/status/{nodeId} | Read the same cached status for one PBX node. |
The compatibility form openapi.php?object=firewall reads configuration. Use action=status for status, action=countries for the country catalog, or action=settings&code=F2BBLOCKEDIP for one option.
Read and update options
curl -H 'X-API-Key: GLOBAL_API_KEY' \
'https://pbx.example.com/pbx/openapi.php/firewall'
curl -H 'X-API-Key: GLOBAL_API_KEY' \
'https://pbx.example.com/pbx/openapi.php/firewall/settings/F2BBLOCKEDIP'
curl -X PATCH \
-H 'X-API-Key: GLOBAL_API_KEY' \
-H 'Content-Type: application/json' \
--data '{"settings":{"F2BBLOCKEDIP":"203.0.113.10\n2001:db8::/32","FAIL2BAN":true,"F2BMAXATTEMPTS":5},"countries":["IT","NL"]}' \
'https://pbx.example.com/pbx/openapi.php/firewall'
The root request accepts either a settings object or the setting names directly, for example {"F2BBLOCKEDIP":"203.0.113.10"}. Do not supply the same option twice through different spellings or wrappers. Unknown options and attempts to write status fields are rejected.
Configuration responses contain settings and countries. Flag values use the stored "on" or empty-string form; numeric options are returned as strings. Missing options use the defaults listed below. Existing blank numeric options use the same display defaults as the web page.
Supported settings
| Code | Accepted value | Reset default |
|---|---|---|
GEOIPFILTER | Enable the full server country filter. | Off |
WEBGEOIPFILTER | Enable the web interface country filter. | Off |
FAIL2BAN | Enable VoIP Fail2Ban. | Off |
WEBFAIL2BAN | Enable web interface Fail2Ban. | Off |
F2BMAXATTEMPTS | Integer from 1 to 2147483647. | 5 |
F2BBANTIME | Seconds, from -1 to 2147483647. -1 represents a permanent ban. | 600 |
F2BFINDTIME | Seconds, from 1 to 2147483647. | 600 |
F2BNOTIFY | Notify ban activity. | Off |
F2BNOTIFYEMAIL | Notification email address or a list separated by commas, semicolons or whitespace. Lists are normalized to one comma-separated line. | Empty |
F2BNOTIFYSENDEREMAIL | One sender email address. | Empty |
F2BTRUSTCUSTOMHEADERS | Trust a custom client-IP header. Enable only behind a trusted reverse proxy that strips untrusted client-supplied headers. | Off |
F2BREVERSEPROXY | PHP server header name, for example HTTP_X_FORWARDED_FOR. Used when custom headers are trusted. | Empty |
F2BVOIPPORTS | Comma-separated ports, or an array of port numbers. Each port must be from 1 to 65535. | 5060,5061,5080,5081,5082 |
F2BWEBPORTS | The same port format. | 80,443 |
F2BSSHPORTS | The same port format. | 22 |
SIPRATELIMIT | Enable SIP rate limiting. | Off |
SIPPACKETSSEC | Integer from 1 to 2147483647. | 50 |
F2BALWAYSALLOWED | Whitelisted IPv4/IPv6 addresses or CIDR networks, as text or an array of strings. | Empty |
F2BTENANTWHITELIST | Autowhitelist from tenant IP restrictions. | Off |
F2BTENANTCONNWHITELIST | Autowhitelist from tenant registrations. | Off |
SIPEXPLICITALLOW | Allow SIP connections only from allowed IPs. | Off |
F2BCUSTOMRULES | IPv4 iptables rule arguments for the CustomRules chain, one rule per line, as on the web page. | Empty |
F2BCUSTOMRULES6 | IPv6 rule arguments for CustomRules, one per line. Applied only on nodes with IPv6 enabled. | Empty |
BLOCKSIPSCANNERS | Enable blocking of configured SIP scanner signatures. | Off |
SIPSCANNER | Scanner signatures, one per line. | Empty |
F2BBLOCKEDIP | Manually blocked IPv4/IPv6 addresses or CIDR networks, as text or an array of strings. | Empty |
Flags accept JSON booleans, 0/1, or the strings on, off, yes, no, 1, 0 and an empty string. A JSON null resets an option. Text network lists accept spaces, new lines, commas and semicolons; a # starts a comment. Pipes are not network separators. Extended text is limited to 1 MiB per option; ordinary settings use a 255-byte limit.
DELETE resets the option instead of removing required parameters from the generated jail configuration. Numeric and port defaults are persisted; flags and text options are cleared. Settings omitted from a request are unchanged.
curl -X PATCH \
-H 'X-API-Key: GLOBAL_API_KEY' \
-H 'Content-Type: application/json' \
--data '{"value":["203.0.113.10","2001:db8::/32"]}' \
'https://pbx.example.com/pbx/openapi.php/firewall/settings/F2BBLOCKEDIP'
curl -X DELETE -H 'X-API-Key: GLOBAL_API_KEY' \
'https://pbx.example.com/pbx/openapi.php/firewall/settings/F2BBLOCKEDIP'
Allowed countries
Read the available codes using GET /firewall/countries. Supply up to 1000 codes using countries. Codes must exist in the country catalog; lowercase codes are normalized to uppercase and duplicates are removed. Country updates replace the complete selection. An empty array or DELETE /firewall/countries clears it.
Read node status
curl -H 'X-API-Key: GLOBAL_READ_ONLY_API_KEY' \
'https://pbx.example.com/pbx/openapi.php/firewall/status?limit=10&offset=0'
curl -H 'X-API-Key: GLOBAL_READ_ONLY_API_KEY' \
'https://pbx.example.com/pbx/openapi.php/firewall/status/1?jail=asterisk-udp'
Status is paginated by node. limit defaults to 10 and is capped at 100; offset defaults to 0. Follow next_offset while has_more is true. Use node_id or the node ID in the path to select one node. The optional jail filter selects Fail2Ban rows, for example asterisk-udp, asterisk-tcp or sshd.
{
"object": "firewall_status",
"cached": true,
"data": [
{
"node_id": 1,
"node_name": "PBX node 1",
"peer_name": "pbx01.example.com",
"warning": "",
"fail2ban": [{"jail":"asterisk-udp","status":"Status at ..."}],
"sip_rate_status": "..."
}
],
"limit": 10,
"offset": 0,
"has_more": false,
"next_offset": null
}
The status text comes from fs_fail2banstatus and sr_sipratestatus, as displayed in the Security page. warning contains the node's CHECKGEOIPF2B-* message. These are stored observations, not live commands. They can be stale; no current timestamp is invented. Node credentials are never returned. Status and warning fields cannot be created, overwritten or deleted through this endpoint.
Atomicity and errors
The configuration tables se_settings, se_settings_max and ge_geoip must use InnoDB for API writes. Configuration changes use a checked transaction, read-back verification, and a database lock to serialize API writers. Validation failures, storage warnings or write failures roll back the change. Successful changes are recorded in the activity log.
| Status/code | Meaning |
|---|---|
400 invalid_firewall | Invalid value, malformed JSON structure, conflicting option values or invalid country/node filter. |
400 tenant_not_applicable | Remove the tenant selector; this resource is global. |
403 admin_required | A global API key is required. |
403 read_only_api_key | The key cannot modify firewall settings. |
404 firewall_setting_not_found | The requested code is not one of the supported firewall options. |
404 node_not_found | The requested PBX node does not exist. |
405 method_not_allowed | The operation is not available, including writes to observed status or deleting the entire configuration. |
500 database_error, database_warning or firewall_verification_failed | The change could not be saved and verified. The transaction is rolled back. |
503 transactional_tables_required | Convert se_settings, se_settings_max and ge_geoip to InnoDB before API writes. |
503 firewall_busy | Another API writer holds the configuration lock. Retry later. |
503 firewall_commit_unknown | The save outcome is uncertain. Read the configuration before retrying; do not assume that it was rolled back. |
User Activity
User Activity
Read and search the activity shown in Admin → Users → User Activity. This resource reads ul_userlogs; it cannot create, edit, delete, or clear activity entries.
Endpoints and access
| Method | Endpoint | Result |
|---|---|---|
| GET | /useractivity | A filtered, paginated list, newest entry first. |
| GET | /useractivity/{id} | One entry. The same filters and tenant restrictions apply. |
Use a global API Key or global Read Only API Key from Admin → Settings. Supply it using X-API-Key, Authorization: Bearer, or the key query parameter. Configured API IP restrictions apply. Tenant keys and extension Dial API Keys are not accepted. Other methods return HTTP 405.
Without a tenant filter, results include all tenants, global entries, and entries whose tenant has been deleted. tenant accepts one exact code or name; a matching code takes precedence over a matching name. Wildcards are not supported. Use tenant_id to filter by the stored ID, including 0 for global entries or the ID of a deleted tenant. If both selectors are supplied they must identify the same tenant.
Search filters
| Parameter | Meaning |
|---|---|
start, end | Optional inclusive timestamps in PBX server time, formatted YYYY-MM-DD HH:MM:SS. No date restriction is applied when omitted. |
user / ul_user | Exact stored username. |
user_action / ul_action | Exact activity action, for example LOGIN, LOGIN FAILED, or UPDATE. Use these parameters rather than the routing parameter action. |
table / ul_table | Exact stored table or API resource label. |
table_id / ul_table_id | Exact nonnegative table record ID. |
host / ul_host | Exact stored caller IP address. |
countrycode / ul_countrycode | Exact stored country code, such as IT. |
objecttype / ul_objecttype | Exact stored object type. |
q | Literal substring search across visible activity columns and tenant name/code. Characters %, _, and ! are literal, not wildcards. Case matching follows the database collation. |
id | Optional exact activity entry ID when using the list URL; returns the same single-entry envelope as the ID URL. |
Filters are combined with AND. Text filters accept at most 255 UTF-8 bytes without control characters. Conflicting values for an alias and its native column name are rejected. Invalid dates or pagination values return HTTP 400. An individual entry that does not match the supplied filters returns HTTP 404.
Pagination
| Parameter | Meaning |
|---|---|
limit | Page size, default 100, from 1 to 1000. |
offset | Page offset, default 0, maximum 10000000. |
order | desc (default) or asc, ordered by activity ID ul_id. |
before_id | Exclusive upper ID bound. Continue a descending listing with the returned next_before_id. |
after_id | Exclusive lower ID bound. Continue an ascending listing with the returned next_after_id. |
The list response contains data, limit, offset, order, has_more, next_offset, next_before_id, and next_after_id. No full-table total count is performed. While has_more is true, use either the next offset or the cursor for the selected order. Keep the same filters and use offset=0 with cursor continuation. Treat IDs as opaque decimal strings to preserve precision. ID cursor pagination avoids offset shifts when newer activity is inserted.
Returned data
Entries contain the native fields ul_id, ul_te_id, ul_datetime, ul_action, ul_user, ul_host, ul_table, ul_table_id, ul_table_value, ul_objecttype, ul_objectvalue, ul_oldvalues, ul_newvalues, ul_changedvalues, ul_numhost, ul_countrycode, ul_country, ul_useragent, and ul_requesturi. Additional fields tenant_code and tenant_name are null when there is no matching tenant.
Values are stored data, without the web interface's flag icons or action HTML. A full global key can read historical audit payloads, which may contain credentials. With a global read-only key, ul_oldvalues, ul_newvalues, ul_changedvalues, ul_objectvalue, and ul_requesturi contain [hidden]. They are also excluded from q so their contents cannot be discovered through search results. The envelope's details_redacted flag indicates this behavior.
Examples
Search updates by a particular operator and tenant:
curl --get 'https://pbx.example.com/pbx/openapi.php/useractivity' \
-H 'X-API-Key: YOUR_GLOBAL_API_KEY' \
--data-urlencode 'tenant=DEVEL' \
--data-urlencode 'user=operator' \
--data-urlencode 'user_action=UPDATE' \
--data-urlencode 'start=2026-11-01 00:00:00' \
--data-urlencode 'end=2026-11-30 23:59:59' \
--data-urlencode 'limit=100'
Find login attempts from an IP address:
curl --get 'https://pbx.example.com/pbx/openapi.php/useractivity' \
-H 'X-API-Key: YOUR_GLOBAL_API_KEY' \
--data-urlencode 'host=198.51.100.10' \
--data-urlencode 'q=LOGIN'
Read one entry:
curl 'https://pbx.example.com/pbx/openapi.php/useractivity/12345' \
-H 'X-API-Key: YOUR_GLOBAL_API_KEY'
Continue descending pagination using the previous page's cursor:
curl --get 'https://pbx.example.com/pbx/openapi.php/useractivity' \
-H 'X-API-Key: YOUR_GLOBAL_API_KEY' \
--data-urlencode 'before_id=12345' \
--data-urlencode 'limit=100' \
--data-urlencode 'offset=0'
Equivalent query-string routing is available:
https://pbx.example.com/pbx/openapi.php?object=useractivity&action=list&user_action=LOGIN
https://pbx.example.com/pbx/openapi.php?object=useractivity&action=get&id=12345
Authenticate query-string examples with the same header. Path aliases /useractivities and /user_activity are accepted; the documented canonical route is /useractivity.
PBX Nodes
The PBX Nodes resource returns the operational information shown in Admin → PBX Nodes (nodes.php): saved system health and service checks, plus optional live Asterisk readings. It is read-only.
Endpoints and authentication
GET https://pbx.example.com/pbx/openapi.php/nodes
GET https://pbx.example.com/pbx/openapi.php/nodes/{id}
Use a full or read-only global API key. Send it with X-API-Key, Authorization: Bearer, or the key query parameter. Normal API IP restrictions apply. Tenant keys and extension Dial API Keys cannot read this resource. Omit tenant, including when using a global key. Only GET is supported; these endpoints cannot change node configuration.
Parameters and pagination
| Parameter | Meaning |
|---|---|
id | Numeric node ID. Supply it in /nodes/{id} or as a query parameter. Both forms return one object in data; conflicting IDs are rejected. |
live | true by default. Include live Asterisk version, peer/contact counts, channels/calls and ODBC state. Use false for database readings without an AMI connection. |
limit | For lists: 1–100 nodes per page; default 10. |
offset | For lists: number of nodes to skip, default 0; maximum 10,000,000. A nonzero offset is not accepted for a single-node request. |
GET /nodes returns an array in data, ordered by numeric node ID. Read has_more and use next_offset to retrieve the next page. A missing single node returns 404; an empty list page returns data: [].
Examples
# All returned nodes, including live AMI readings
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/nodes"
# One node, saved/database readings only
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/nodes/3?live=false"
# A bounded page for monitoring without AMI
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/nodes?live=false&limit=10&offset=0"
# Equivalent query-style single-node request
curl -H "X-API-Key: GLOBAL_READONLY_API_KEY" \
"https://pbx.example.com/pbx/openapi.php?object=nodes&action=get&id=3&live=false"
The query-style list form is openapi.php?object=nodes&action=list&live=false. The OpenAPI specification lists these operations as listNodes and getNode in its global catalog.
Response fields
| Field | Meaning |
|---|---|
object | nodes for both list and single-node responses. |
generated_at, timezone | Response snapshot time and PBX server timezone. This is not a new collection timestamp for saved metrics. |
data | Node objects for a list, or one node object for an ID lookup. |
limit, offset, has_more, next_offset | Pagination. next_offset is null on the last page. |
peers_online_on_page | Sum of the live peer/contact counts for the returned nodes only; null when a returned count is unavailable or live readings are disabled. It is not a cluster total when pagination is used. |
context | AI processing backlogs for returned processing nodes, cluster housekeeping and the database auto-increment capacity check. |
| Node field | Meaning |
|---|---|
id, name, peer_name, ip_address, pbx_version | Node identity, host address and installed PBX version. |
os | version, pending security/normal updates, last checked timestamp, upgrade status, error text and health colour. End-of-life status or pending security updates is red; other pending updates yellow. |
checks.croncheck | Saved scheduling cursor and freshness check. Includes wall-clock last_check, effective epoch, stored_epoch, age_seconds, threshold_seconds, future and status. |
checks.devstate | Saved device-state heartbeat with a 1,800-second threshold; installed and expected versions, ping and pong timestamps. |
checks.geoip_module, checks.geoip_data, checks.dahdi | Saved GeoIP module/data and DAHDI status values and colours. |
checks.asterisk_recovery | Whether automatic recovery is enabled, saved recovery state, last restart timestamp and status. |
services.amirouter, services.openaigateway | Configured enable value, saved runtime state, installed/expected versions, icon state and status. |
services.voipmonitor | Whether VoIPmonitor is enabled and its saved status message. |
system | CPU cores and governor, system/Asterisk uptime in seconds, three load averages, memory, swap, disks, recordings awaiting processing and firewall suspension minutes. cached is true because these measurements come from stored samples. |
live | AMI availability, probe time, live Asterisk readings, four ODBC link states and warning codes. |
Memory fields are total_bytes, used_bytes, free_bytes, shared_bytes, buffers_bytes, cached_bytes, page_free_ratio and status. They follow the stored free command positions displayed by the web page; the meaning of its last columns can differ across OS versions. page_free_ratio follows the page calculation, (free + cached) / total. Swap returns total, used and free bytes, free ratio and status.
Each system.disks entry contains filesystem, mount, total/used/available bytes, used_percent and status. Usage is yellow above 80% and red above 90%, including 100%. Health colours are green, yellow, red or unknown. Missing or malformed samples yield null/unknown values rather than fabricated healthy zero readings. The existing page memory, swap and recordings alert semantics are retained.
Reading the croncheck cursor
checks.croncheck.last_check corresponds to no_nodes.no_croncheck. stored_epoch is no_nodes.no_croncheck_epoch, when available; the effective epoch falls back to the legacy timestamp when no valid stored epoch exists. The freshness threshold is 360 seconds. The future flag helps identify a saved cursor ahead of the current time.
This cursor records the last completed scheduling minute, not the exact finish time of every croncheck task. It can lag during backlog processing. During daylight-saving clock changes, use the epoch rather than comparing ambiguous wall-clock strings. This endpoint reads the cursor; it never advances or resets it.
Example excerpt from a single-node response; other response fields are omitted:
{
"object": "nodes",
"generated_at": "2026-12-01T11:02:00+00:00",
"timezone": "Europe/Rome",
"data": {
"id": 3,
"checks": {
"croncheck": {
"last_check": "2026-12-01 12:00:00",
"epoch": 1796122800,
"age_seconds": 120,
"threshold_seconds": 360,
"future": false,
"status": "green",
"stored_epoch": 1796122800
}
}
}
}
AI queues, housekeeping and database capacity
context.ai_queues contains entries with type (transcript, summary or sentiment), node_id, pending and status. Only processing nodes returned on this page are included. As in the web page, the count includes entries first checked in the last day or not yet checked. It is green below 100, yellow below 1,000, otherwise red.
context.housekeeping identifies the cluster node with the latest housekeeping start, together with start/end timestamps and completion status. context.database_capacity returns the page’s database-wide auto-increment capacity check: database/table/column, column type, next ID, maximum ID, percentage and status. Large IDs are strings to preserve their precision. These two checks are cluster-wide, including for a single-node request.
Saved data and live AMI readings
live=true opens one AMI connection per returned, configured node, with events disabled, and issues only fixed read commands: sip show peers, pjsip list contacts, core show version, core show channels count, and odbc show for asterisk1, asterisk2, asteriskcdrdb1 and asteriskcdrdb2.
| Live field | Meaning |
|---|---|
requested, available, partial | Whether live data was requested, an AMI connection succeeded, and some requested readings were unavailable. |
checked_at | Time of a probe attempt, not proof of a successful connection. Null when live probing was disabled or not admitted due to the request budget. |
asterisk_version | Live Asterisk version. |
sip_peers_online | Monitored SIP peers reported online by Asterisk. |
pjsip_contacts | PJSIP contact objects, including multiple contacts for one endpoint. This is not a distinct endpoint or phone count. |
peers_online | SIP plus PJSIP counts, or null if either is unavailable. |
active_channels, active_calls, calls_processed | Live Asterisk channel/call counters. |
odbc | For each queried link: name, connected state, active and maximum connection counts, and status. |
warnings | Machine-readable reasons for unavailable or partial live data. |
A missing SIP/PJSIP channel driver contributes zero for that technology. An empty, failed or unrecognized response contributes null. Nodes are queried sequentially, so the response is not an atomic cluster snapshot. A healthy cached reading is not proof of a successful live connection.
AMI failure does not discard the saved node data. The response is HTTP 200 with explicit unavailable/partial live fields and warnings. Warning codes include ami_not_configured, ami_client_unavailable, ami_connection_failed, ami_request_failed, ami_response_unavailable_*, ami_time_budget_exceeded and ami_request_budget_exceeded.
Connection and socket reads use a two-second timeout. There is a per-node command budget and a 20-second budget for admitting more node probes. These are best-effort limits, not a hard HTTP deadline; an in-progress probe can finish later. Paginate larger clusters or use live=false for monitoring that must avoid AMI.
live=false does not instantiate an AMI client or select AMI credentials. Saved health/service values can be stale. Queue counts and global context are still read from the database. generated_at is the response snapshot time, not the collection time of every stored value; no extra freshness timestamp is invented.
Errors and access boundaries
| HTTP status / code | Meaning |
|---|---|
400 invalid_nodes_request | Invalid ID, pagination, live flag or conflicting selectors. |
400 tenant_not_applicable | Tenant supplied for a global operation; omit it. |
401 missing_api_key / invalid_api_key | Missing or invalid credentials. |
403 admin_required / api_ip_not_allowed | A verified tenant key is not a global key, or the normal API IP filter denied access. |
404 node_not_found / not_found | Requested node or route does not exist. |
405 method_not_allowed | Only GET is supported; standard OpenAPI OPTIONS handling is available. |
503 node_status_unavailable | The server could not read the node status from the database. Internal SQL and credentials are not returned. |
The response uses an explicit allowlist. It does not expose AMI usernames/passwords, health-probe passwords or arbitrary configuration columns. Repository URL credentials and common secret query parameters are redacted from error text. Standard OpenAPI authentication, auditing and usage accounting apply. No node updates, cron cursor changes, job submissions, module reloads or service restarts are performed.
Extension States
The Extension States endpoint returns the state of every extension in one tenant in a single JSON array, including offline extensions. It supports GET only and has its own advanced-key permission, getExtensionStates.
Endpoint and authentication
GET https://pbx.example.com/pbx/openapi.php/extensions/states?tenant=CANISTRACCI
The equivalent query form is:
GET https://pbx.example.com/pbx/openapi.php?object=extension&action=states&tenant=CANISTRACCI
Full and read-only tenant or global API keys are supported. Send the key with X-API-Key, Authorization: Bearer, or the key query parameter. Extension Dial API keys are not supported.
An Advanced Open API Key must explicitly authorize GET /extensions/states (getExtensionStates) and the selected tenant. Global administrative permission is not required. Permission to list extensions or read one extension's live state does not grant this aggregate operation. Adding this endpoint does not automatically expand existing keys.
Parameters
| Parameter | Required | Description |
|---|---|---|
tenant | Yes | One exact tenant code or name. Codes take precedence over names. Ambiguous names and wildcard tenant selection are rejected, including for global keys. |
live | No | Defaults to true. Use false for cached device states only. 1 and 0 are accepted aliases. |
key | Unless an authentication header is used | An API key authorized for this operation and tenant. |
Omit id, objectid, number, and ext: this endpoint always covers all extensions. It does not use a reserved value such as number=ALL.
Examples
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions/states?tenant=CANISTRACCI"
curl -H "Authorization: Bearer TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/extensions/states?tenant=CANISTRACCI&live=false"
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php?object=extension&action=states&tenant=CANISTRACCI"
Response
The response is always an array, ordered by extension number and internal ID. An empty tenant returns []. Missing backend mappings do not remove extensions from the result.
[
{
"id": 134,
"number": "103",
"name": "Reception",
"tech": "PJSIP",
"state": "RINGING",
"dnd": false,
"device_state": "NOT_INUSE",
"active_channels": 1,
"live_status": "ok"
},
{
"id": 135,
"number": "104",
"name": "Warehouse",
"tech": "SIP",
"state": "UNAVAILABLE",
"dnd": false,
"device_state": "UNAVAILABLE",
"active_channels": 0,
"live_status": "ok"
}
]
| Field | Type | Meaning |
|---|---|---|
id | Integer | Extension internal ID. |
number | String | Dialable extension number; leading zeros are preserved. |
name | String | Extension display name. |
tech | String | Configured technology, such as SIP, PJSIP, CUSTOM, or VIRTUAL. |
state | String | Cached device state, overlaid with observed live channel activity. Observed channels can produce INUSE, RINGING, or RINGINUSE. Cached ONHOLD and BUSY states are preserved for observed non-ringing calls. Without observed channels, the cached state is retained. |
dnd | Boolean | Configured extension Do Not Disturb flag, independent of channel activity. |
device_state | String or null | Normalized cached state before the live overlay; null when no trustworthy peer mapping or sample exists. |
active_channels | Integer or null | Observed channel count for a complete live snapshot. Null when live collection is disabled, unsupported, or incomplete. This counts channels, not distinct conversations. |
live_status | String | ok: complete live snapshot; partial: at least one node failed to provide a valid snapshot; cached_only: live collection disabled or channel attribution unsupported. |
Recognized cached states are UNKNOWN, NOT_INUSE, INUSE, BUSY, INVALID, UNAVAILABLE, RINGING, RINGINUSE, and ONHOLD. Missing or ambiguous peer mappings return state: "UNKNOWN" and device_state: null.
An idle phone with DND enabled may return state: "INUSE", dnd: true, and active_channels: 0. Zero observed channels does not reset a cached device state to NOT_INUSE.
Live collection and cached mode
By default, device states are read in batches and live collection uses one connection and one fixed core show channels concise command per configured PBX node. There are no separate commands for each extension or channel. Each connection/socket read has a two-second timeout; new nodes stop being admitted after a 20-second collection budget.
SIP/PJSIP channels are matched by exact device name and exact tenant account code. Virtual extensions also observe their own tenant's physical members; custom extensions use cached state only. Ambiguous ownership across technologies, tenants, or canonical device-state aliases is excluded. Identically named channels on different nodes are counted separately.
If a node fails, live-capable entries report live_status: "partial" and active_channels: null, while retaining the cached state and any observed overlay. A successful empty live snapshot returns zero channels, which differs from an unavailable snapshot.
With live=false, the endpoint reads cached states only, does not read AMI credentials, and makes no AMI connection. Channel counts are null and live_status is cached_only. Neither mode returns credentials, registration addresses, channel names, caller IDs, or other tenants' call details.
Node snapshots are sequential rather than one atomic cluster-wide instant. The device-state cache has no sample timestamp and may be stale if its sender/receiver is stopped.
Errors
| HTTP status | Reason |
|---|---|
| 400 | Missing or invalid exact tenant selection, unsupported identifier filters, another action combined with the endpoint, or an invalid live value. |
| 401 | Missing, unknown, revoked, or expired API key. |
| 403 | Disallowed IP, tenant, or endpoint; or OpenAPI disabled for the tenant. A missing advanced-key operation returns api_endpoint_not_allowed. |
| 404 | Tenant or requested route not found. |
| 405 | A method other than GET was used. |
| 409 | The tenant display name is ambiguous; use its unique code. |
| 503 | Database lookup failed (extension_states_unavailable) or the key policy could not be verified. |
Related endpoints
GET /extensionslists basic extension information without this state snapshot.GET /extensions/state?tenant=...&number=...returns live call details for one extension and retains its existing object response.- Extension detail endpoints retain their existing cached state and configuration fields.