OpenAPI

OpenAPI JSON endpoint reference and examples.

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:

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

ActionPattern
ListGET https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI
Get by IDGET https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI
Get extension by numberGET https://pbx.example.com/pbx/openapi.php/extensions/number/100?tenant=CANISTRACCI
Get live extension stateGET https://pbx.example.com/pbx/openapi.php/extensions/state?tenant=CANISTRACCI&number=100
Count peersGET https://pbx.example.com/pbx/openapi.php/countpeers?tenant=CANISTRACCI
Outbound caller IDsGET https://pbx.example.com/pbx/openapi.php/outbounddids?tenant=CANISTRACCI
Resync a registered phonePOST https://pbx.example.com/pbx/openapi.php/phones/resync?tenant=CANISTRACCI
List tenants by code or nameGET /tenants
Tenant server placementGET|POST https://pbx.example.com/pbx/openapi.php/tenants/TENANT_ID/placement
Download call recordingGET https://pbx.example.com/pbx/openapi.php/recordings/UNIQUEID?tenant=CANISTRACCI
TranslationsGET https://pbx.example.com/pbx/openapi.php/translations?language=it-IT
DialPOST https://pbx.example.com/pbx/openapi.php/dial?tenant=CANISTRACCI
Transfer live callPOST https://pbx.example.com/pbx/openapi.php/calls/transfer?tenant=CANISTRACCI
Queue agent actionPOST https://pbx.example.com/pbx/openapi.php/queues/QUEUE_ID/agents/EXTENSION_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI
Queue agent action by queue numberPOST https://pbx.example.com/pbx/openapi.php/queues/by-number/QUEUE_NUMBER/agents/EXTENSION_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI
External queue agent actionPOST 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 numberPOST 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 actionPOST https://pbx.example.com/pbx/openapi.php/queues/all/agents/EXTENSION_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI
All-queues external agent actionPOST https://pbx.example.com/pbx/openapi.php/queues/all/external-agents/EXTERNAL_AGENT_ID/{login|logout|pause|unpause}?tenant=CANISTRACCI
Queue HistoryGET https://pbx.example.com/pbx/openapi.php/queuelogs/history?tenant=CANISTRACCI
Raw queue logsGET https://pbx.example.com/pbx/openapi.php/queuelogs/raw?tenant=CANISTRACCI
Queue log CSV downloadGET https://pbx.example.com/pbx/openapi.php/queuelogs/raw/download?tenant=CANISTRACCI
CreatePOST https://pbx.example.com/pbx/openapi.php/extensions?tenant=CANISTRACCI
ModifyPATCH https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI
DeleteDELETE https://pbx.example.com/pbx/openapi.php/extensions/EXTENSION_ID?tenant=CANISTRACCI
Read firewallGET https://pbx.example.com/pbx/openapi.php/firewall
Read user activityGET https://pbx.example.com/pbx/openapi.php/useractivity
Read PBX nodesGET https://pbx.example.com/pbx/openapi.php/nodes?live=false
List all extension statesGET 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.

ObjectPrimary pathAuthentication scopeOperations or required fields
Auth Token/auth/tokenGlobal full API keyPOST generate, DELETE reset
Dial/dialTenant full API keyPOST only; requires source and dest
Live Call Transfer/calls/transferWritable full tenant or global API key; exact tenant requiredPOST blind or attended transfer of an active tenant-owned channel
CDR/cdrsTenant API key or global key; GET onlyGET only
Simple CDR/simplecdrsTenant API key or global key; GET onlyGET only
AI Analysis/aianalysisTenant API key or global key; GET onlyGET only; requires uniqueid
AI Logs/ailogsTenant full or read-only API key, or global key; GET onlyGET only; JSON or CSV; defaults to the current day
SMS and MMS/sms, /mmsConcrete 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}/downloadConcrete 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/countpeersFull or read-only tenant/global key; tenant required for tenant keysGET counts per node and total; SIP monitored online peers plus PJSIP contacts. See Peer Counts.
Translations/translationsFull or read-only global keyGET interface texts of one language with stable ID and version; /translations/languages lists the languages. See Translations.
Extension/extensionsTenant API keynumber or ex_number; GET /extensions/state for live state
Tenant/tenantsGlobal API keyte_name, te_code
User/usersGlobal API keyus_username
User Profile/userprofilesGlobal API keyup_name
Routing Profile/routingprofilesGlobal API keyrp_name
Provider/providersGlobal API keypr_name
Voicemail/voicemailsTenant API keymailbox
IVR/ivrsTenant API keyiv_name
Custom Destination/customdestinationsTenant API key or global key with global=1cu_name, cu_ct_id
Condition/conditionsTenant API keyco_type
Hunt List/huntlistsTenant API keyhu_name
DID/didsTenant API keydi_number
Queue/queuesTenant API key; agent actions require a writable full key and an exact tenantCRUD; 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/rawTenant or global full/read-only API key; one exact tenant is requiredGET only; historical Queue History aggregation or raw events; JSON and paginated CSV downloads
Setting/settingsTenant API key or global key with global=1se_code
Media File/mediafiles; /mediafiles/{id}/downloadTenant or global key for metadata; full key required to download audiome_name; binary download examples
Music On Hold/musiconholdsTenant API key or global key with global=1mu_name
Paging Group/paginggroupsTenant API keypa_name, pa_number
Conference Room/conferenceroomsTenant API keycr_name, cr_number
Flow/flowsTenant API keyfl_name
Tenant Variable/tenantvariablesTenant API keytv_al_id
DISA/disasTenant API keyds_name
Caller ID Blacklist/calleridblacklistsTenant API key or global key with global=1bl_callerid
Campaign/campaignsTenant API keyca_name
Campaign Number/campaignnumbersTenant API keycn_ca_id, cn_number
Cron Job/cronjobsTenant API key or global key with global=1cr_name
Feature Code/featurecodesTenant API key or global key with global=1fe_code
Short Number/shortnumbersTenant API key or global key with global=1sn_number
Phone Book/phonebooksTenant API keypb_name
Phone Book Entry/phonebookentriesTenant API keyphonebook_id, at least one value
Provisioning Phone/provisioningphonesTenant API keyph_name, ph_mac
Firewall/firewallGlobal key only; writes require a full global keyRead or change GeoIP/Fail2Ban options and allowed countries; read cached node status. See Firewall.
User Activity/useractivityGlobal full or read-only key; GET onlyRead 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 tenantRead node health, cron/devstate checks, services, OS updates, processing backlogs and optional live Asterisk/ODBC readings. See PBX Nodes.
Extension States/extensions/statesFull or read-only tenant/global key; advanced keys require getExtensionStates and the selected tenantAll 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

TaskDocumentation
Generate or replace saved audioMedia File: TTS, WAV/MP3 uploads and audio replacement. Use tts: true for generation or POST /mediafiles/{id}/upload for uploads.
Assign, transfer or release numbersDID assignment: POST /dids/{id}/assign, owner checks, tenant permissions and pool behavior.
Update hold musicMusic On Hold: ordered media selection, automatic playlist rebuilding and reload warnings.
Create or convert extensionsExtension 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
ParameterRequiredDescription
tenantYesTenant code or tenant name.
numberYes, unless ext is usedExtension number to check.
extYes, unless number is usedCompatibility alias for number.
keyNo, if using headersAPI 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

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.

OperationPathAPI key
Generate tokenPOST https://pbx.example.com/pbx/openapi.php/auth/tokenGLOBAL_API_KEY
Reset tokenDELETE https://pbx.example.com/pbx/openapi.php/auth/tokenGLOBAL_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 typeMatched field
Web userus_users.us_username
Extension web userex_extensions.ex_webuser
SIP extension usernamesipfriends.name when ex_webuser is empty
PJSIP endpoint IDps_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

Common Errors

ErrorMeaning
missing_api_keyNo API key was supplied in the query string, X-API-Key, or bearer token.
invalid_api_keyThe supplied key does not match a valid API key.
admin_requiredA global API key is required.
read_only_api_keyThe supplied key is read-only and cannot generate or reset tokens.
missing_userThe request body did not include a user value.
invalid_validityThe validity value was not ONCE and could not be parsed as a date/time.
user_not_foundNo 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
ParameterRequiredDescription
tenantYesTenant code or tenant name.
keyNo, if using headersFull API key. The key can also be sent with X-API-Key or Authorization: Bearer.

Request Body

FieldRequiredDescription
sourceYesSource extension. Compatibility aliases are exten and ?exten.
destYesDestination number. Compatibility alias is phone.
dialtimeoutNoOriginate timeout in seconds. Defaults to 30.
timeoutNoSets the dialplan variable SETTIMEOUT.
sourceclidNoSets SETSOURCECLID.
destclidNoSets SETDESTCLID.
logqueueoutboundNoSets SETLOGQUEUEOUTBOUND.
recordingNoSets SETRECORDING.
autoanswerNoSets AUTOANSWER.
nofollowNoSets SETNOFOLLOWEXTENSION.
accountNoPeer account name to set as SETPEERNAME. Use SOURCE to resolve it from the source extension.
serverNoPBX node peer name to use when the source or destination registration server cannot be found.
varNoComma-separated custom variables, for example campaign=summer,lead=42.
varsNoCustom 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.

FieldDescription
externalExternal number to call. Aliases: dest, phone, destination and number.
dialfirstextension (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

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

FieldRequiredDescription
channelOne of channel or uniqueidExact active Asterisk channel name, for example PJSIP/101-00000042.
uniqueidOne of channel or uniqueidAsterisk channel UniqueID. If both identifiers are supplied, they must resolve to the same live channel.
destinationYesDestination run at priority 1 in the authenticated dialplan context.
typeNoblind or attended. Defaults to blind.
extra_channelNoOptional 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.
serverNoPBX 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

Relevant Errors

HTTP statusCodeDescription
400exact_tenant_requiredThe tenant is missing, uses a wildcard, or does not exactly match the authenticated tenant.
400missing_call_identifierNeither channel nor uniqueid was supplied.
400invalid_transfer_typetype is not blind or attended.
400extra_channel_not_allowedAn extra channel was supplied for an attended transfer.
404channel_not_foundNo active channel matches the identifier and tenant.
404extra_channel_not_foundThe extra channel is not active on the selected node for the same tenant.
409ambiguous_channelMore than one PBX node has a matching channel; supply server.
409call_state_changedThe call changed between discovery and execution; obtain current channel information and retry.
502channel_state_unavailableLive channel state could not be read from the selected PBX nodes.
502transfer_rejectedAsterisk rejected the Redirect or Atxfer action.
502transfer_unconfirmedThe 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

PropertyValue
Objectcdr
Primary path/cdrs
Path aliases/cdr, /cdrs, /call, /calls
Supported methodGET
Default formatjson
Compatibility formatstemplate, xml

Endpoint Patterns

ActionExample pattern
List recordsGET https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI
Filter by date rangeGET 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 pathGET https://pbx.example.com/pbx/openapi.php/cdrs/RECORD_ID?tenant=CANISTRACCI
Template/XML compatibility outputGET https://pbx.example.com/pbx/openapi.php/cdrs?tenant=CANISTRACCI&format=template&template=Docs%20Export

Query Parameters

ParameterDescription
tenantTenant code or tenant name. Global API keys can use % wildcards; tenant API keys are restricted to their tenant.
startStart date and time. Defaults to today at 00:00:00.
endEnd date and time. Defaults to today at 23:59:59.
idComma-separated CDR ID values. A path value such as /cdrs/123 also maps to this filter.
uniqueidComma-separated Asterisk unique ID values.
linkedidComma-separated linked ID values used to group call legs.
srcComma-separated source values.
firstdstComma-separated first destination values.
dispositionComma-separated disposition values such as ANSWERED, NO ANSWER, BUSY, or FAILED.
directionDirection filter based on the CDR userfield mapping. Accepted values are IN, OUT, IN,OUT, and OUT,IN.
phoneComma-separated phone values searched across src, dst, firstdst, lastdst, realsrc, and wherelanded.
formatResponse format. Defaults to json. Use template or xml for template-based compatibility output.
templateTemplate name from the tenant XML templates. Used only with format=template or format=xml.
contenttypeOptional Content-Type header for rendered template output.

Response Fields

FieldDescription
accountcodeTenant code stored on the CDR.
IDInternal CDR row ID.
startCall start timestamp.
answerAnswer timestamp when the call was answered.
endCall end timestamp.
clidFull caller ID string.
realsrcNormalized or real source value.
firstdstFirst dialed destination tracked by MiRTA PBX.
durationTotal call duration in seconds.
billsecAnswered talk time in seconds.
dispositionAsterisk call disposition.
cc_costCalculated tenant-side call cost when available.
dcontextAsterisk destination context.
dstchannelDestination channel.
userfieldMiRTA PBX call marker, commonly including inbound or outbound direction information.
uniqueidAsterisk unique ID for the CDR leg.
prevuniqueidPrevious unique ID for linked call-leg processing.
lastdstLast destination reached by the call.
wherelandedFinal PBX object or destination where the call landed.
srcAsterisk source value.
dstAsterisk destination value.
lastappLast Asterisk application executed.
srcCallIDSource SIP Call-ID when available.
linkedidAsterisk linked ID used to group related CDR legs.
peeraccountAsterisk peer account value.
originateidOrigination tracking ID when available.
cc_countryRated country when rating data is available.
cc_networkRated network when rating data is available.
pincodePIN code associated with the call when present.
cc_buyCalculated buy-side cost when available.

Important Notes

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"

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_statusMeaning
pending_uploadRecording started or a local file was found; the upload is still expected.
not_recordedAll the call channels have closed without a recording.
upload_failedThe upload failed. retryable tells whether recovery is expected.
unavailableThe recording was catalogued but cannot be retrieved, or was discarded.
unknownNot 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

ErrorMeaning
missing_api_keyNo API key was supplied in the query string, X-API-Key, or bearer token.
invalid_api_keyThe supplied key does not match the tenant or global API key.
tenant_requiredA tenant code or tenant name is required when using a tenant API key.
single_tenant_requiredTemplate output requires the request to resolve to exactly one tenant.
template_not_foundThe 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_allowedThe 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

PropertyValue
Objectsimplecdr
Primary path/simplecdrs
Path aliases/simplecdr, /simplecdrs, /simple_cdr, /simple_cdrs
Supported methodGET
Default formatjson
Compatibility formatstemplate, xml

Endpoint Patterns

ActionExample pattern
List recordsGET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI
Filter by date rangeGET 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 pathGET https://pbx.example.com/pbx/openapi.php/simplecdrs/RECORD_ID?tenant=CANISTRACCI
Template/XML compatibility outputGET https://pbx.example.com/pbx/openapi.php/simplecdrs?tenant=CANISTRACCI&format=template&template=Docs%20Export

Query Parameters

ParameterDescription
tenantTenant code or tenant name. Global API keys can use % wildcards; tenant API keys are restricted to their tenant.
startStart date and time. Defaults to today at 00:00:00.
endEnd date and time. Defaults to today at 23:59:59.
idComma-separated simple CDR ID values. A path value such as /simplecdrs/123 also maps to this filter.
uniqueidComma-separated Asterisk unique ID values.
calleridnumComma-separated caller ID number values.
calleridnameComma-separated caller ID name values.
dispositionComma-separated disposition values such as ANSWERED, NO ANSWER, BUSY, or FAILED.
directionComma-separated simple CDR directions, such as IN, OUT, or LOCAL.
dialednumComma-separated dialed number values.
whoansweredComma-separated values for the extension, user, or object that answered.
phoneComma-separated phone values searched across sc_whoanswered, sc_calleridnum, and sc_dialednum.
mindurationMinimum total call duration in seconds, exclusive.
mintalktimeMinimum answered talk time in seconds, exclusive.
formatResponse format. Defaults to json. Use template or xml for template-based compatibility output.
templateTemplate name from the tenant XML templates. Used only with format=template or format=xml.
contenttypeOptional Content-Type header for rendered template output.

Response Fields

FieldDescription
sc_te_idInternal tenant ID.
tenantcodeTenant code.
sc_startSimple CDR start timestamp.
sc_directionSimple direction value, such as IN, OUT, or LOCAL.
sc_calleridnumCaller ID number.
sc_calleridnameCaller ID name.
sc_dialednumDialed number.
sc_dispositionCall disposition.
sc_durationTotal call duration in seconds.
sc_billsecAnswered talk time in seconds.
sc_uniqueidAsterisk unique ID represented by the simple CDR row.
sc_whoansweredExtension, 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.

VariableDescription
{$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

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

ErrorMeaning
missing_api_keyNo API key was supplied in the query string, X-API-Key, or bearer token.
invalid_api_keyThe supplied key does not match the tenant or global API key.
tenant_requiredA tenant code or tenant name is required when using a tenant API key.
single_tenant_requiredTemplate output requires the request to resolve to exactly one tenant.
template_not_foundThe selected XML/template output template does not exist for the tenant.
method_not_allowedThe 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

PropertyValue
Objectextension
Primary path/extensions
ID fieldex_id
Label fieldex_number
Primary source tableex_extensions
Required on createnumber or ex_number
Path aliases/extensions

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
numberex_number
nameex_name
techex_tech
sipusernameusername
mailboxex_mailbox
emailex_email
passwordtechnology secret/password
callgroupsex_callgroup
pickupgroupsex_pickupgroup
realextensionsvirtual_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.

FieldTypeMeaning
ex_el_idInteger, 0 to 2147483647A 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 typeAccepted aliases
EXT-UNCONDITIONALunconditional
EXT-NOANSWERonnoanswer, noanswer, no_answer
EXT-BUSYonbusy, busy
EXT-OFFLINEonoffline, offline
EXT-ONCONDITIONoncondition, condition
EXT-DIALBYNAMEdialbyname, dial_by_name
EXT-ONLYALLOWCALLonlyallowcall, only_allow_call
EXT-DONOTCALLdonotcall, do_not_call

Important Notes

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

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

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

PropertyValue
Objecttenant
Primary path/tenants
ID fieldte_id
Label fieldte_name
Primary source tablete_tenants
Required on createte_name, te_code
Path aliases/tenants

Endpoint Patterns

ActionExample pattern
ListGET https://pbx.example.com/pbx/openapi.php/tenants
Get by IDGET https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID
CreatePOST https://pbx.example.com/pbx/openapi.php/tenants
UpdatePATCH https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID
DeleteDELETE https://pbx.example.com/pbx/openapi.php/tenants/OBJECT_ID

Accepted Field Aliases

Request fieldSource field
namete_name
codete_code
billingcodete_billingcode
billing_codete_billingcode
timezonete_timezone
routing_profile_idte_rp_id
campaign_routing_profile_idte_campaign_rp_id
fax_routing_profile_idte_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 statusMeaning
400invalid_tenant when the selector is supplied in a form other than a string.
404tenant_not_found when the selector has no match.
409ambiguous_tenant when the exact selector for an advanced key is ambiguous.
500database_error when the legacy tenant lookup or the tenant list query fails.
503api_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"

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 objectMeaning
settingsDefaults 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.
assignmentsMoves every current object of a service in the tenant: queues, parkinglots, conferences, campaigns, cronjobs. System jobs and UPLOADRECORDING jobs are excluded.

Common Errors

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

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

PropertyValue
Objectuser
Primary path/users
ID fieldus_id
Label fieldus_username
Primary source tableus_users
Required on createus_username
Path aliases/user, /users, /nuser, /nusers, /us_user, /us_users

Endpoint Patterns

ActionExample pattern
ListGET https://pbx.example.com/pbx/openapi.php/users
Get by IDGET https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID
CreatePOST https://pbx.example.com/pbx/openapi.php/users
UpdatePATCH https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID
DeleteDELETE https://pbx.example.com/pbx/openapi.php/users/OBJECT_ID

Accepted Field Aliases

Request fieldSource field
usernameus_username
nameus_username
descriptionus_description
emailus_email
profile_idus_up_id
userprofile_idus_up_id
passwordus_password
use_ldapus_useldap
ip_filterus_ipfilter
two_factor_typeus_2fatype
never_expireus_neverexpire
dynamic_ipus_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

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

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

PropertyValue
Objectuserprofile
Primary path/userprofiles
ID fieldup_id
Label fieldup_name
Primary source tableup_userprofiles
Required on createup_name
Path aliases/userprofile, /userprofiles, /user_profile, /user_profiles

Endpoint Patterns

ActionExample pattern
ListGET https://pbx.example.com/pbx/openapi.php/userprofiles
Get by IDGET https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID
CreatePOST https://pbx.example.com/pbx/openapi.php/userprofiles
UpdatePATCH https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID
DeleteDELETE https://pbx.example.com/pbx/openapi.php/userprofiles/OBJECT_ID

Accepted Field Aliases

Request fieldSource field
nameup_name
descriptionup_description
reservedup_reserved
userpanelup_userpanel
user_panelup_userpanel
extension_user_profileup_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

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

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

PropertyValue
Objectroutingprofile
Primary path/routingprofiles
ID fieldrp_id
Label fieldrp_name
Primary source tablerp_routingprofiles
Required on createrp_name
Path aliases/routingprofiles, /routing_profiles, /routing_profile

Endpoint Patterns

ActionExample pattern
ListGET https://pbx.example.com/pbx/openapi.php/routingprofiles
Get by IDGET https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID
CreatePOST https://pbx.example.com/pbx/openapi.php/routingprofiles
UpdatePATCH https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID
DeleteDELETE https://pbx.example.com/pbx/openapi.php/routingprofiles/OBJECT_ID

Accepted Field Aliases

Request fieldSource field
namerp_name
descriptionrp_description
typerp_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

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

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

PropertyValue
Objectprovider
Primary path/providers
ID fieldpr_id
Label fieldpr_name
Primary source tablepr_providers
Required on createpr_name
Path aliases/provider, /providers

Endpoint Patterns

ActionExample pattern
ListGET https://pbx.example.com/pbx/openapi.php/providers
Get by IDGET https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID
CreatePOST https://pbx.example.com/pbx/openapi.php/providers
UpdatePATCH https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID
DeleteDELETE https://pbx.example.com/pbx/openapi.php/providers/OBJECT_ID

Accepted Field Aliases

Request fieldSource field
namepr_name
peernamepr_peername
peer_namepr_peername
techpr_tech
hostpr_host
disabledpr_disabled
penaltypr_penalty
realtimepr_userealtime
use_realtimepr_userealtime
calleridmod_idpr_ca_id
calleridpr_callerid
caller_idpr_callerid
callerid_numberpr_callerid
caller_id_numberpr_callerid
calleridnamepr_calleridname
callerid_namepr_calleridname
caller_id_namepr_calleridname
did_mod_idpr_did_ca_id
max_out_channelspr_maxoutchannels
ignore_sip_causepr_ignoresipcause
ignore_busypr_ignorebusy
sms_protocolpr_smsprotocol
sms_urlpr_smsurl
sms_userpr_smsuser
sms_passwordpr_smspassword
canreinvitesipfriends.canreinvite for chan_sip direct media
direct_mediaps_endpoints.direct_media for PJSIP direct media

Important Notes

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

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

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

PropertyValue
Objectvoicemail
Primary path/voicemails
ID fielduniqueid
Label fieldmailbox
Primary source tablevoicemail
Required on createmailbox
Path aliases/voicemails

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namefullname
numbermailbox

Destination Fields

Destination fields accept one destination string or an array of destination strings such as EXT-100, VOICEMAIL-100, or another supported destination type and ID pair.

Destination typeAccepted aliases
VOICEMAIL-OPERATORoperator, voicemail_operator
VOICEMAIL-FOLLOWfollow, voicemail_follow
VOICEMAIL-BROADCASTbroadcast, 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

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

Voicemail messages and greetings

ResourceSupported methods
/voicemails/{id}/messagesGET list, POST create
/voicemails/{id}/messages/{messageId}GET, PUT, PATCH, DELETE
/voicemails/{id}/greetingsGET 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

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

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
nameiv_name
mediafile_idiv_me_id
timeoutiv_timeout
digit_timeoutiv_digittimeout

Destination Fields

Destination fields accept one destination string or an array of destination strings such as EXT-100, VOICEMAIL-100, or another supported destination type and ID pair.

Destination typeAccepted aliases
IVR_1ivr_1, key_1, 1
IVR_2ivr_2, key_2, 2
IVR_3ivr_3, key_3, 3
IVR_4ivr_4, key_4, 4
IVR_5ivr_5, key_5, 5
IVR_6ivr_6, key_6, 6
IVR_7ivr_7, key_7, 7
IVR_8ivr_8, key_8, 8
IVR_9ivr_9, key_9, 9
IVR_0ivr_0, key_0, 0
IVR_STARivr_star, key_star, star
IVR_SHARPivr_sharp, key_sharp, sharp
IVR_WRONGivr_wrong, wrong
IVR_TIMEOUTivr_timeout, timeout
IVR_HANGUPivr_hangup, hangup
IVR_FEATUREivr_feature, feature
IVR_EXTENSIONivr_extension, extension
IVR_MEDIAFILEivr_mediafile, mediafile
IVR_OPTIONSMEDIAFILEivr_optionsmediafile, optionsmediafile
CUSTOMIVR_SUPPORTcustomivr_support

Important Notes

Examples

List IVRs

Returns the ivrs visible to the key and scope.

curl -H "X-API-Key: TENANT_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/ivrs?tenant=CANISTRACCI"

Get IVR

Reads one object by its internal ID.

curl -H "X-API-Key: TENANT_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

Create IVR

Creates a new object. Use the short aliases shown above or the source field names.

curl -X POST \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Docs API IVR",
  "mediafile_id": 22,
  "timeout": 5,
  "digit_timeout": 3
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs?tenant=CANISTRACCI"

Edit IVR

Updates only the supplied fields.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "timeout": 8,
  "digit_timeout": 4
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

Delete IVR

Deletes the object. Check references before deleting configuration used by routing or reporting.

curl -X DELETE \
  -H "X-API-Key: TENANT_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 1 Destination

Updates the IVR_1 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_1": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 2 Destination

Updates the IVR_2 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_2": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 3 Destination

Updates the IVR_3 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_3": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 4 Destination

Updates the IVR_4 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_4": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 5 Destination

Updates the IVR_5 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_5": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 6 Destination

Updates the IVR_6 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_6": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 7 Destination

Updates the IVR_7 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_7": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 8 Destination

Updates the IVR_8 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_8": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 9 Destination

Updates the IVR_9 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_9": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR 0 Destination

Updates the IVR_0 destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_0": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR STAR Destination

Updates the IVR_STAR destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_star": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR SHARP Destination

Updates the IVR_SHARP destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_sharp": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR WRONG Destination

Updates the IVR_WRONG destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_wrong": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR TIMEOUT Destination

Updates the IVR_TIMEOUT destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_timeout": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR HANGUP Destination

Updates the IVR_HANGUP destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_hangup": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR FEATURE Destination

Updates the IVR_FEATURE destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_feature": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR EXTENSION Destination

Updates the IVR_EXTENSION destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_extension": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR MEDIAFILE Destination

Updates the IVR_MEDIAFILE destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_mediafile": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR OPTIONSMEDIAFILE Destination

Updates the IVR_OPTIONSMEDIAFILE destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ivr_optionsmediafile": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

IVR SUPPORT Destination

Updates the CUSTOMIVR_SUPPORT destination. The same value can also be sent inside a destinations object.

curl -X PATCH \
  -H "X-API-Key: TENANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "customivr_support": [
    "EXT-100"
  ]
}' \
  "https://pbx.example.com/pbx/openapi.php/ivrs/OBJECT_ID?tenant=CANISTRACCI"

Common Errors

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

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

PropertyValue
Objectcustomdestination
Primary path/customdestinations
ID fieldcu_id
Label fieldcu_name
Primary source tablecu_customs
Required on createcu_name, cu_ct_id
Path aliases/custom, /customs, /customdestinations, /custom_destinations, /custom_destination

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namecu_name
type_idcu_ct_id
custom_type_idcu_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 typeAccepted aliases
PRIVACY-DONTCALLprivacy_dontcall, dontcall
PRIVACY-TORTUREprivacy_torture, torture
CTONANSWERonanswer
CALLBACK-CONNECTEDcallback_connected
CTONCALLERHANGUPcaller_hangup
SPLITCHANNELACTION-CALLERsplit_caller
SPLITCHANNELACTION-CALLEDsplit_called
RANDOMDESTINATIONrandomdestination, random_destination
RANDOMDESTINATION1randomdestination1, random_destination1
RANDOMDESTINATION2randomdestination2, random_destination2
RANDOMDESTINATION3randomdestination3, random_destination3
RANDOMDESTINATION4randomdestination4, random_destination4
RANDOMDESTINATION5randomdestination5, random_destination5
RANDOMDESTINATION6randomdestination6, random_destination6
RANDOMDESTINATION7randomdestination7, random_destination7
RANDOMDESTINATION8randomdestination8, random_destination8
RANDOMDESTINATION9randomdestination9, random_destination9
RANDOMDESTINATION10randomdestination10, random_destination10
RANDOMDESTINATION11randomdestination11, random_destination11
RANDOMDESTINATION12randomdestination12, random_destination12
RANDOMDESTINATION13randomdestination13, random_destination13
RANDOMDESTINATION14randomdestination14, random_destination14
RANDOMDESTINATION15randomdestination15, random_destination15
RANDOMDESTINATION16randomdestination16, random_destination16
RANDOMDESTINATION17randomdestination17, random_destination17
RANDOMDESTINATION18randomdestination18, random_destination18
RANDOMDESTINATION19randomdestination19, random_destination19
RANDOMDESTINATION20randomdestination20, 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

Uses the shared/global record set for object types that support global rows.

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.

Common Errors

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

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

PropertyValue
Objectcondition
Primary path/conditions
ID fieldco_id
Label fieldco_name
Primary source tableco_conditions
Required on createco_type
Path aliases/conditions

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
nameco_name
typeco_type
timezoneco_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 typeAccepted aliases
CONDITIONcondition, true, yes, destination
NOTCONDITIONnotcondition, false, no, notdestination
CONDITION1condition1, destination1, destinationmvv1
CONDITION2condition2, destination2, destinationmvv2
CONDITION3condition3, destination3, destinationmvv3
CONDITION4condition4, destination4, destinationmvv4
CONDITION5condition5, destination5, destinationmvv5
CONDITION6condition6, destination6, destinationmvv6
CONDITION7condition7, destination7, destinationmvv7
CONDITION8condition8, destination8, destinationmvv8
CONDITION9condition9, destination9, destinationmvv9
CONDITION10condition10, destination10, destinationmvv10
CONDITION11condition11, destination11, destinationmvv11
CONDITION12condition12, destination12, destinationmvv12
CONDITION13condition13, destination13, destinationmvv13
CONDITION14condition14, destination14, destinationmvv14
CONDITION15condition15, destination15, destinationmvv15
CONDITION16condition16, destination16, destinationmvv16
CONDITION17condition17, destination17, destinationmvv17
CONDITION18condition18, destination18, destinationmvv18
CONDITION19condition19, destination19, destinationmvv19
CONDITION20condition20, 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

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

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

PropertyValue
Objecthuntlist
Primary path/huntlists
ID fieldhu_id
Label fieldhu_name
Primary source tablehu_huntlists
Required on createhu_name
Path aliases/huntlists

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namehu_name
numberhu_number
typehu_type
ringtimehu_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 typeAccepted aliases
HUNTLISTextensions, members, huntlist
HUNTLIST-TIMEOUTtimeout, 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

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

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

PropertyValue
Objectdid
Primary path/dids
ID fielddi_id
Label fielddi_number
Primary source tabledi_dids
Required on createdi_number
Path aliases/dids

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
numberdi_number
countrydi_country
areadi_area
commentdi_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 typeAccepted aliases
DIDdestination, did
DID-UNCONDITIONALunconditional
DID-SMSsms
DID-FAXSUCCESSfaxsuccess, 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}.

OperationPermissions and result
Pool to tenantA 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 tenantRequires 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 poolRequires 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 ownerReturns 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

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

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

PropertyValue
Objectqueue
Primary path/queues
ID fieldqu_id
Label fieldqu_name
Primary source tablequ_queues
Path aliases/queues

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namequ_name
numberqu_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 typeAccepted aliases
QUEUE-FULLfull
QUEUE-TIMEOUTtimeout_destination, timeout
QUEUE-EXITKEYexitkey
QUEUE-ONCALLBACKoncallback
QUEUE-NOBODYHOMEnobodyhome
QUEUE-NOFREEMEMBERnofreemember
QUEUE-PERIODICANNOUNCEperiodicannounce
QUEUE-BEFORERINGINGbeforeringing
QUEUE-ONAUTOPAUSEonautopause
QUEUE-ONABANDONEDCALLonabandonedcall

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

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

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

ActionEndpoint
LoginPOST /queues/{queueId}/agents/{agentId}/login
LogoutPOST /queues/{queueId}/agents/{agentId}/logout
PausePOST /queues/{queueId}/agents/{agentId}/pause
UnpausePOST /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:

ActionEndpoint
LoginPOST /queues/by-number/{queueNumber}/agents/{agentId}/login
LogoutPOST /queues/by-number/{queueNumber}/agents/{agentId}/logout
PausePOST /queues/by-number/{queueNumber}/agents/{agentId}/pause
UnpausePOST /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.

ValueRequiredDescription
queueIdFor ID routesThe queue's internal ID (qu_id), not its dialable queue number.
queueNumberFor by-number routesThe dialable queue number (qu_number) in the selected tenant. Leading zeros are preserved.
agentIdFor extension routesThe extension's internal ID (ex_id), not its extension number.
externalAgentIdFor external-agent routesThe external agent's internal ID (ea_externalagents.ea_id). Select an existing external agent belonging to the tenant.
tenantYesExact tenant code or tenant name.
keyNo, if using headersThe 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.

ActionQueue by internal IDQueue by dialable number
LoginPOST /queues/{queueId}/external-agents/{externalAgentId}/loginPOST /queues/by-number/{queueNumber}/external-agents/{externalAgentId}/login
LogoutPOST /queues/{queueId}/external-agents/{externalAgentId}/logoutPOST /queues/by-number/{queueNumber}/external-agents/{externalAgentId}/logout
PausePOST /queues/{queueId}/external-agents/{externalAgentId}/pausePOST /queues/by-number/{queueNumber}/external-agents/{externalAgentId}/pause
UnpausePOST /queues/{queueId}/external-agents/{externalAgentId}/unpausePOST /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.

OptionDefaultBehavior
penalty0JSON integer from 0 to 2147483647 for a new membership. An existing membership retains its penalty on repeated login.
confirmfalseSet to true to require the external agent to confirm answering a queue call.
monitor_statetrueMonitor 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.

ActionExtensionExternal agent
LoginPOST /queues/all/agents/{agentId}/loginPOST /queues/all/external-agents/{externalAgentId}/login
LogoutPOST /queues/all/agents/{agentId}/logoutPOST /queues/all/external-agents/{externalAgentId}/logout
PausePOST /queues/all/agents/{agentId}/pausePOST /queues/all/external-agents/{externalAgentId}/pause
UnpausePOST /queues/all/agents/{agentId}/unpausePOST /queues/all/external-agents/{externalAgentId}/unpause

Which Queues Are Affected?

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.

FieldMeaning
successTrue when there are no per-queue action failures. PBX refresh failures are reported separately.
changedTrue when at least one successful queue action changed membership or pause state.
summary.totalNumber of queues selected at the start of the operation.
summary.changedNumber of successful queue actions that changed state.
summary.unchangedNumber of successful queue actions whose requested state was already in effect.
summary.failedNumber of failed queue actions. Their results include error.status, error.code, and error.message.
summary.pbx_refresh_failedSuccessful 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

Relevant Errors

HTTP statusCodeDescription
400exact_tenant_requiredThe tenant was omitted, does not exactly match the authenticated tenant, or uses a wildcard.
400invalid_pause_reasonThe pause reason is invalid or longer than 80 characters.
400conflicting_pause_reasonreason and pausereason contain different values.
400pause_reason_not_allowedA reason was sent to login, logout, or unpause.
400invalid_queue_numberThe by-number value is invalid or exceeds 40 characters.
400invalid_penaltyPenalty is not a JSON integer from 0 to 2147483647.
400penalty_not_allowedPenalty was supplied to an action other than login.
400invalid_external_agent_optionAn external-agent request contains an unsupported field or a login option is not a JSON boolean.
404external_agent_not_foundThe external agent does not exist in the selected tenant.
404queue_not_foundThe queue does not exist in the selected tenant.
409queue_number_ambiguousMore than one queue in the selected tenant has this number. Use the internal ID route.
409external_agents_disabledThe tenant EXTERNALAGENTS setting does not allow a new external-agent membership.
409agent_not_logged_inPause or unpause was requested before the extension was logged into the queue.
409agent_peer_unavailableThe extension does not have a valid queue member device, or the external agent has no valid configured destination number.
409queue_agent_state_changedA concurrent change prevented the requested final state from being confirmed; retry the request.
500queue_agent_update_failedThe 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

PropertyValue
Objectsetting
Primary path/settings
ID fieldse_id
Label fieldse_code
Primary source tablese_settings
Required on createse_code
Path aliases/settings

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
codese_code
valuese_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

Uses the shared/global record set for object types that support global rows.

curl -H "X-API-Key: GLOBAL_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/settings?global=1"

Common Errors

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

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

PropertyValue
Objectmediafile
Primary path/mediafiles
ID fieldme_id
Label fieldme_name
Primary source tableme_mediafiles
Required on createme_name
Path aliases/mediafiles, /media_files, /media_file

Endpoint Patterns

ActionExample pattern
ListGET https://pbx.example.com/pbx/openapi.php/mediafiles?tenant=CANISTRACCI
Get by IDGET https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID?tenant=CANISTRACCI
Download fileGET https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID/download?tenant=CANISTRACCI (full API key)
CreatePOST https://pbx.example.com/pbx/openapi.php/mediafiles?tenant=CANISTRACCI
UpdatePATCH https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID?tenant=CANISTRACCI
DeleteDELETE https://pbx.example.com/pbx/openapi.php/mediafiles/OBJECT_ID?tenant=CANISTRACCI

Accepted Field Aliases

Request fieldSource field
nameme_name
descriptionme_description
formatme_format
typeme_type
textme_text
engineme_engine
languageme_language
data_base64me_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

Uses the shared/global record set for object types that support global rows.

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

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 statusMeaning
400Invalid or missing media ID.
401 / 403Missing/invalid key, read-only key, denied IP address or insufficient scope.
404Media record is outside the selected scope, does not exist, or has no stored audio.
405A method other than GET was used.
409The stored media format is unavailable.
500 / 502 / 503Database, 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"
OptionBehavior
Audio sourceSupply exactly one source: multipart file or JSON audio. Do not combine uploaded audio with tts: true.
SizeMaximum uploaded or generated source audio is 16 MiB. PHP upload/memory limits and database packet/column limits can reduce the usable upload size.
ConversionSupported 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 defaultsOmitted format and volume retain the existing media values. Metadata-only edits preserve stored audio.
PermissionsA full API key and tenant write scope are required. Shared/global media require a global full key and global=yes.
Storage and referencesUses 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.
FailuresFailed 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

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

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

PropertyValue
Objectmusiconhold
Primary path/musiconholds
ID fieldmu_id
Label fieldmu_name
Primary source tablemu_musiconholds
Required on createmu_name
Path aliases/moh, /music, /musiconholds, /music_on_hold, /music_on_holds

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namemu_name
custommu_custom
volumemu_volume
randomizeordermu_randomizeorder
streamenginemu_streamengine
formatformat
applicationapplication
modemode

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.

OperationMeaning
Omit the selectionPreserve the existing selection on update.
Send mediafile: []Clear the selected recordings.
Send a nonempty listReplace 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

Uses the shared/global record set for object types that support global rows.

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

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

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

PropertyValue
Objectpaginggroup
Primary path/paginggroups
ID fieldpa_id
Label fieldpa_name
Primary source tablepa_paginggroups
Required on createpa_name, pa_number
Path aliases/paging, /pagings, /paginggroup, /paginggroups, /intercom, /intercoms

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namepa_name
numberpa_number
pinpa_pin
bidirectionalpa_bidirectional
checkinusepa_checkinuse
mediafile_idpa_me_id
manualheaderpa_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 typeAccepted aliases
PAGINGextensions, 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

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

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

PropertyValue
Objectconferenceroom
Primary path/conferencerooms
ID fieldcr_id
Label fieldcr_name
Primary source tablecr_conferencerooms
Required on createcr_name, cr_number
Path aliases/conference, /conferences, /conferencerooms, /conference_rooms, /conference_room

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namecr_name
numbercr_number
hostedcr_hosted
rate_idcr_rrid
startdatestarttime
enddateendtime
request_pin_mediafile_idcr_requestpinmeid

Important Notes

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

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

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

PropertyValue
Objectflow
Primary path/flows
ID fieldfl_id
Label fieldfl_name
Primary source tablefl_flows
Required on createfl_name
Path aliases/flow, /flows

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namefl_name
commentfl_comment
numberfl_number
valuefl_value
variable_namefl_variable_name
monitor_typefl_monitor_type
monitor_type_idfl_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 typeAccepted aliases
FLOWdestination, 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

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

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

PropertyValue
Objecttenantvariable
Primary path/tenantvariables
ID fieldtv_id
Label fieldtv_value
Primary source tabletv_tenantvariables
Required on createtv_al_id
Path aliases/variable, /variables, /tenantvariable, /tenantvariables, /tenant_variable, /tenant_variables

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
variable_idtv_al_id
valuetv_value
commenttv_comment
lockedtv_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

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

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

PropertyValue
Objectdisa
Primary path/disas
ID fieldds_id
Label fieldds_name
Primary source tableds_disas
Required on createds_name
Path aliases/disa, /disas

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
nameds_name
mediafile_idds_me_id
pinds_pin
outboundds_outbound
blockcidds_blockcid
calleridnumds_calleridnum
calleridnameds_calleridname
digitstimeoutds_digitstimeout
responsetimeoutds_responsetimeout
looponattemptds_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

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

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

PropertyValue
Objectcalleridblacklist
Primary path/calleridblacklists
ID fieldbl_id
Label fieldbl_callerid
Primary source tablebl_blacklists
Required on createbl_callerid
Path aliases/calleridblacklist, /calleridblacklists, /callerid_blacklist, /callerid_blacklists, /blacklist, /blacklists

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
calleridbl_callerid
reasonbl_reason
insertedbl_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

Uses the shared/global record set for object types that support global rows.

curl -H "X-API-Key: GLOBAL_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/calleridblacklists?global=1"

Common Errors

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

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

PropertyValue
Objectcampaign
Primary path/campaigns
ID fieldca_id
Label fieldca_name
Primary source tableca_campaigns
Required on createca_name
Path aliases/campaign, /campaigns

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
nameca_name
typeca_type
techca_tech
datestartca_datestart
dateendca_dateend
condition_idca_co_id
calleridca_callerid
calleridnameca_calleridname
stateca_state
queue_idca_qu_id
messageca_message
confirmmessage_idca_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 typeAccepted aliases
CAMPAIGN-ONCONNECTonconnect, on_connect
CAMPAIGN-DONOTCALLdonotcall, 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

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

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

PropertyValue
Objectcampaignnumber
Primary path/campaignnumbers
ID fieldcn_id
Label fieldcn_number
Primary source tablecn_campaignnumbers
Required on createcn_ca_id, cn_number
Path aliases/campaignnumber, /campaignnumbers, /campaign_number, /campaign_numbers

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
campaign_idcn_ca_id
numbercn_number
descriptioncn_description
dispositioncn_disposition
attemptscn_attempts
lastattemptcn_lastattempt
billseccn_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

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

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

PropertyValue
Objectcronjob
Primary path/cronjobs
ID fieldcr_id
Label fieldcr_name
Primary source tablecr_cronjobs
Required on createcr_name
Path aliases/cronjob, /cronjobs, /cron_job, /cron_jobs

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namecr_name
typecr_type
node_idcr_no_id
activecr_active
oncecr_once
minutecr_minute
hourcr_hour
daycr_day
monthcr_month
yearcr_year
weekdaycr_weekday
timezonecr_timezone
runcr_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 typeAccepted aliases
CRONJOBdestination, 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

Uses the shared/global record set for object types that support global rows.

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:

Common Errors

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

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

PropertyValue
Objectfeaturecode
Primary path/featurecodes
ID fieldfe_id
Label fieldfe_code
Primary source tablefe_features
Required on createfe_code
Path aliases/feature, /features, /featurecodes, /feature_codes, /feature_code

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
codefe_code
commentfe_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 typeAccepted aliases
FEATUREdestination, 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

Uses the shared/global record set for object types that support global rows.

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

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

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

PropertyValue
Objectshortnumber
Primary path/shortnumbers
ID fieldsn_id
Label fieldsn_number
Primary source tablesn_shortnumbers
Required on createsn_number
Path aliases/shortnumbers, /short_numbers, /short_number

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
numbersn_number
destinationsn_destnumber
destnumbersn_destnumber
commentsn_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

Uses the shared/global record set for object types that support global rows.

curl -H "X-API-Key: GLOBAL_API_KEY" \
  "https://pbx.example.com/pbx/openapi.php/shortnumbers?global=1"

Common Errors

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

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

PropertyValue
Objectphonebook
Primary path/phonebooks
ID fieldpb_id
Label fieldpb_name
Primary source tablepb_phonebooks
Required on createpb_name
Path aliases/phonebook, /phonebooks, /phone_book, /phone_books

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
namepb_name
include_extensionspb_includeext
includeextpb_includeext
include_short_numberspb_includeshortnum
includeshortnumpb_includeshortnum
layoutpl_phonebooklayouts
itemspl_phonebooklayouts

Important Notes

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

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

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.

MethodOperationAPI key
GETDownload every stored entry and its field values as JSON, without pagination.Full or read-only
POSTAppend 1–500 entries in one request.Full
DELETEDelete 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

PropertyValue
Objectphonebookentry
Primary path/phonebookentries
ID fieldpe_id
Label fieldpe_id
Primary source tablepe_phonebookentries
Required on createphonebook_id, at least one value
Path aliases/phonebookentry, /phonebookentries, /phonebook_entry, /phonebook_entries, /phonebookcontact, /phonebookcontacts, /phonebook_contact, /phonebook_contacts

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
phonebook_idpe_pb_id
pbidpe_pb_id
valuespd_phonebookdetails keyed by pi_code
fieldspd_phonebookdetails keyed by pi_code
detailspd_phonebookdetails rows
NAMEphone book item code
PHONE1phone book item code
PHONE2phone book item code
EMAILphone book item code
ROUTINGphone book item code

Important Notes

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.

ParameterMeaning
nameExact match on a saved NAME, FIRSTNAME, LASTNAME or COMPANY value.
numberExact match on PHONE1–PHONE7 or FAX. Leading zeros and + are kept; formatting is not normalized.
searchLiteral substring of those name and number fields. % and _ are ordinary characters.
limit, offsetOptional 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

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

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

PropertyValue
Objectprovisioningphone
Primary path/provisioningphones
ID fieldph_id
Label fieldph_name
Primary source tableph_phones
Required on createph_name, ph_mac
Path aliases/phone, /phones, /provisioningphones, /provisioning_phones, /provisioning_phone

Endpoint Patterns

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

Accepted Field Aliases

Request fieldSource field
nameph_name
macph_mac
model_idph_pm_id
passwordph_password
filenameph_filename
http_userph_http_user
http_passwordph_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

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

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.

ResultMeaning
200, delivery=pbx_acceptedThe PBX accepted the resync command for every registration.
404 phone_not_foundThe peer does not exist in the tenant.
409 phone_not_registeredThe phone has no current registration.
409 unsupported_deviceThe registered user agent does not support remote resync. Nothing was sent.
502 resync_partial_failureSome registrations were reached and others failed. Inspect results.
502 resync_delivery_failedDelivery could not be confirmed; commands may already have been sent.
503 registration_server_unavailableThe 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

PropertyValue
Objectaianalysis
Primary path/aianalysis
Path aliases/aianalysis, /aianalyses, /ai_analysis, /ai_analyses, /callanalysis, /call_analysis
Supported methodGET
Required filteruniqueid
Default formatjson
Source tablesrm_recordingmetadatas, tr_transcripts

Endpoint Patterns

ActionExample pattern
Get AI analysis by unique IDGET https://pbx.example.com/pbx/openapi.php/aianalysis?tenant=CANISTRACCI&uniqueid=1717240000.42
Get AI analysis by path unique IDGET https://pbx.example.com/pbx/openapi.php/aianalysis/1717240000.42?tenant=CANISTRACCI
Get multiple callsGET https://pbx.example.com/pbx/openapi.php/aianalysis?tenant=CANISTRACCI&uniqueid=1717240000.42,1717240000.43
Use an alias pathGET https://pbx.example.com/pbx/openapi.php/ai_analysis?tenant=CANISTRACCI&uniqueid=1717240000.42

Query Parameters

ParameterDescription
tenantTenant 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.
uniqueidRequired comma-separated Asterisk unique ID values. A path value such as /aianalysis/1717240000.42 also maps to this filter.
keyOptional API key query parameter. Prefer the X-API-Key header or bearer token for new integrations.

Response Fields

FieldDescription
tenant_idInternal tenant ID.
tenant_codeTenant code.
uniqueidAsterisk unique ID requested by the integration.
transcriptFull transcript text. When recording metadata does not contain a full transcript, MiRTA PBX builds this value from transcript segments.
summaryAI-generated call summary.
sentiment_scoreFirst numeric sentimental analysis score found for the unique ID, or null.
sentiment_scoresAll distinct numeric sentimental analysis scores found for the unique ID.
sentiment_briefShort sentimental analysis text from recording metadata.
sentiment_detailsDetailed sentimental analysis payload. This may be JSON text depending on the configured AI processor.
recordingsPer-recording metadata rows for the unique ID.
transcript_segmentsTimestamped transcript segments for the unique ID.

Recording Fields

FieldDescription
metadata_idInternal recording metadata row ID.
recording_idInternal recording ID.
dateRecording metadata date.
transcriptTranscript stored on that recording metadata row.
summarySummary stored on that recording metadata row.
sentiment_scoreNumeric sentimental score for that recording metadata row, or null.
sentiment_briefShort sentimental analysis text for that recording metadata row.
sentiment_detailsDetailed sentimental analysis payload for that recording metadata row.

Transcript Segment Fields

FieldDescription
recording_idInternal recording ID associated with the transcript segment.
speakerSpeaker number assigned by the transcript processor.
startSegment start time. Numeric values are returned as numbers.
endSegment end time. Numeric values are returned as numbers.
textTranscript 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

Common Errors

ErrorMeaning
missing_api_keyNo API key was supplied in the query string, X-API-Key, or bearer token.
invalid_api_keyThe supplied key does not match the tenant or global API key.
tenant_requiredA tenant code or tenant name is required when using a tenant API key.
tenant_not_foundThe tenant parameter did not match any visible tenant.
uniqueid_requiredThe request did not include a usable uniqueid value.
method_not_allowedThe 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

PropertyValue
Objectailog
Primary path/ailogs
Path aliases/ailog, /ailogs, /ai_log, /ai_logs
Supported methodGET
Default formatjson
Export formatcsv
Source tableai_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.

Endpoint Patterns

ActionExample pattern
List AI logs as JSONGET https://pbx.example.com/pbx/openapi.php/ailogs?tenant=CANISTRACCI
Export AI logs as CSVGET https://pbx.example.com/pbx/openapi.php/ailogs?tenant=CANISTRACCI&format=csv
Use the CSV export pathGET https://pbx.example.com/pbx/openapi.php/ailogs/export?tenant=CANISTRACCI
Filter by date rangeGET 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 IDGET https://pbx.example.com/pbx/openapi.php/ailogs/123?tenant=CANISTRACCI
Compatibility query formGET https://pbx.example.com/pbx/openapi.php?object=ailogs&action=list&tenant=CANISTRACCI

Query Parameters

ParameterDescription
tenantTenant 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.
startStart 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.
endEnd 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.
idOne or more comma-separated ai_id values. A path value such as /ailogs/123 maps to this filter.
uniqueidOne or more comma-separated Asterisk unique ID values.
calleridOne or more comma-separated exact caller ID values.
customidOne or more comma-separated custom destination IDs from cu_customs.
formatjson or csv. The default is json. The /ailogs/export path defaults to csv.
keyOptional 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:

FieldDescription
ai_idInternal AI log row ID.
ai_te_idInternal tenant ID.
ai_cu_idInternal custom destination ID.
cu_nameName of the associated custom destination, when available.
ai_uniqueidAsterisk unique ID associated with the AI conversation.
ai_calleridCaller ID recorded for the conversation.
ai_startConversation start date and time.
ai_endConversation end date and time.
ai_durationConversation duration.
ai_talkConversation exchanged with the AI service.
ai_total_tokensTotal tokens reported for the AI request.
ai_input_tokensInput tokens reported for the AI request.
ai_output_tokensOutput 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

Common Errors

ErrorMeaning
missing_api_keyNo API key was supplied in the query string, X-API-Key, or bearer token.
invalid_api_keyThe supplied key does not match the tenant or global API key.
api_ip_not_allowedIP filtering is enabled and the client address is not in the key's allowed IP or network list.
tenant_requiredA tenant code or tenant name is required when using a tenant API key.
tenant_not_foundThe tenant parameter did not match any visible tenant.
invalid_formatThe format value is not json or csv.
method_not_allowedThe 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 pathOperation
GET /resourceList the selected scope.
POST /resourceCreate; 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

CollectionRequired fields when no new-item default supplies themPurpose
/managerusersname, passwordmanageruser
/quickshortcutsus_id, name, linkquickshortcut
/pickupgroupsnumber, namepickupgroup
/internalroutingsregexp, ex_idinternalrouting
/parkingreturnsnumber, dialbackparkingreturn
/parkinglotsname, start, endparkinglot
/callprivacyrulescallerid, actioncallprivacy
/autoanswersfieldautoanswer
/dialbynamedirectoriesnamedialbynamedirectory
/dialbynameentriesdbn_id, type, type_id, numberdialbynameentry
/digitalfaxesnumberdigitalfax
/alarmbindingscalleridalarmbinding
/mailtofaxesname, host, usernamemailtofax
/mailtocallsname, host, username, authtypemailtocall
/scheduledcallstobecalledscheduledcall
/dashboardsnamedashboard
/dashboarditemstd_id, codedashboarditem
/linemonitorsnamelinemonitor
/xmltemplatesname, xmltemplatexmltemplate
/causecodescodecausecode
/cnamcacheentriesnumber, namecnamcacheentry
/extensiondialingsfrom, toextensiondialing
/translationroomsname, basenumbertranslationroom
/translationlanguagestr_id, number, languagetranslationlanguage
/customdestinationinfoscu_idcustomdestinationinfo
/customdestinationfilescu_id, name, binaryfilecustomdestinationfile
/provisioningvaluesph_id, type, al_idprovisioningvalue
/phonebuttonlayoutsph_id, bl_idphonebuttonlayout
/phonebookassignmentsph_id, pb_idphonebookassignment
/featuremappingscodefeaturemapping

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:

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:

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

ResourceSupported methods
/voicemails/{id}/messagesGET list, POST create
/voicemails/{id}/messages/{messageId}GET, PUT, PATCH, DELETE
/voicemails/{id}/greetingsGET 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.

MethodEndpointPurpose
POST/smsQueue one outgoing SMS.
POST/mmsQueue one outgoing MMS with one attachment.
GET/smsList stored SMS history.
GET/mmsList 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}/downloadDownload an original stored attachment as binary data.

Sending

Send JSON with these fields:

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:

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.

MethodEndpointPurpose
POST/faxesConvert and queue one document for one destination.
GET/faxesList stored inbound and outbound fax history.
GET/faxes/{id}Retrieve one fax and its recent delivery attempts.
GET/faxes/{id}/downloadDownload the fax document as PDF.

Sending a Fax

Submit JSON with these fields:

FieldRequiredDescription
toYesOne destination string: 1-80 digits, * or #, with at least one digit and an optional leading +. Strings preserve leading zeroes.
documentYesObject 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.
fromNoSender 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_nameNoSender name, maximum 255 UTF-8 characters without control characters.
qualityNo204x98 (default), 204x196 or 204x392.
page_sizeNoa4, 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_rotateNoJSON boolean; default true. Rotate landscape PDF pages when pdftk is installed.
not_beforeNoDelivery date/time in YYYY-MM-DD HH:MM:SS using PBX server time. Defaults to database NOW(); past dates are rejected.
status_emailNoOne email address for the existing fax status notifications.
delete_after_sendNoJSON boolean; default false. Tenant/system ALWAYSDELETEFAX=on forces deletion regardless of the requested value.
routing_profile_idNoDefault 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:

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.

EndpointResult
GET /queuelogsQueue History aggregation, including recording metadata.
GET /queuelogs/historyAlias for the same aggregation. Add view=simple for the Simple Queue History query.
GET /queuelogs/rawIndividual stored events, ordered by ascending log ID.
GET /queuelogs/history/downloadDownload aggregated history as CSV.
GET /queuelogs/raw/downloadDownload 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

ParameterMeaning
tenantRequired, exact tenant code or name. Wildcard and cross-tenant selection are rejected.
start, endInclusive 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_idOptional internal qu_id, not the dialable queue number. A queue outside the selected tenant returns 404.
callid, agentExact stored call or agent identifier. In history mode, agent filtering is applied after aggregating the call events.
eventRaw mode only. Exact event such as ENTERQUEUE, CONNECT or ABANDON.
dispositionHistory only. Exact aggregated English value, such as ANSWERED, ABANDONED, TRANSFERRED or TIMEOUT.
viewHistory only: complete (default) or simple. Simple mode omits recording metadata.
limitPage size, 1–10000. Defaults to 100 for JSON and 1000 for CSV.
offsetZero-based offset, default 0, maximum 10000000.
after_idRaw 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.

ParameterMeaning
tenantOne 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:

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.

ParameterMeaning
languageRequired 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.
fileOptional. Exact, case-sensitive page name, for example extension.php. An empty value selects the global texts, which are shared by all pages.
limitPage size, 1–5000, default 1000.
cursorThe 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"
}
FieldMeaning
idStable key of the page and English text. It changes only if the English text or the page changes.
file, textPage where the text is shown, and the English source text. An empty file is a global text.
translationValue stored for this page and language, as shown on the Translations page. Empty when missing.
effective_translationText 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.
versionHash of file, text, language, translation and effective translation. It changes whenever any of them changes.
translations_enabledFalse 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

MethodPathBehavior
GET/firewallRead all supported options, selected countries, and the GeoIP warning flags shown on the Security page.
POST, PUT, PATCH/firewallCreate 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/countriesList country codes and names, with an allowed boolean.
POST, PUT, PATCH/firewall/countriesReplace the selection using {"countries":["IT","NL"]}.
DELETE/firewall/countriesClear the selected countries.
GET/firewall/statusRead 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

CodeAccepted valueReset default
GEOIPFILTEREnable the full server country filter.Off
WEBGEOIPFILTEREnable the web interface country filter.Off
FAIL2BANEnable VoIP Fail2Ban.Off
WEBFAIL2BANEnable web interface Fail2Ban.Off
F2BMAXATTEMPTSInteger from 1 to 2147483647.5
F2BBANTIMESeconds, from -1 to 2147483647. -1 represents a permanent ban.600
F2BFINDTIMESeconds, from 1 to 2147483647.600
F2BNOTIFYNotify ban activity.Off
F2BNOTIFYEMAILNotification email address or a list separated by commas, semicolons or whitespace. Lists are normalized to one comma-separated line.Empty
F2BNOTIFYSENDEREMAILOne sender email address.Empty
F2BTRUSTCUSTOMHEADERSTrust a custom client-IP header. Enable only behind a trusted reverse proxy that strips untrusted client-supplied headers.Off
F2BREVERSEPROXYPHP server header name, for example HTTP_X_FORWARDED_FOR. Used when custom headers are trusted.Empty
F2BVOIPPORTSComma-separated ports, or an array of port numbers. Each port must be from 1 to 65535.5060,5061,5080,5081,5082
F2BWEBPORTSThe same port format.80,443
F2BSSHPORTSThe same port format.22
SIPRATELIMITEnable SIP rate limiting.Off
SIPPACKETSSECInteger from 1 to 2147483647.50
F2BALWAYSALLOWEDWhitelisted IPv4/IPv6 addresses or CIDR networks, as text or an array of strings.Empty
F2BTENANTWHITELISTAutowhitelist from tenant IP restrictions.Off
F2BTENANTCONNWHITELISTAutowhitelist from tenant registrations.Off
SIPEXPLICITALLOWAllow SIP connections only from allowed IPs.Off
F2BCUSTOMRULESIPv4 iptables rule arguments for the CustomRules chain, one rule per line, as on the web page.Empty
F2BCUSTOMRULES6IPv6 rule arguments for CustomRules, one per line. Applied only on nodes with IPv6 enabled.Empty
BLOCKSIPSCANNERSEnable blocking of configured SIP scanner signatures.Off
SIPSCANNERScanner signatures, one per line.Empty
F2BBLOCKEDIPManually 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/codeMeaning
400 invalid_firewallInvalid value, malformed JSON structure, conflicting option values or invalid country/node filter.
400 tenant_not_applicableRemove the tenant selector; this resource is global.
403 admin_requiredA global API key is required.
403 read_only_api_keyThe key cannot modify firewall settings.
404 firewall_setting_not_foundThe requested code is not one of the supported firewall options.
404 node_not_foundThe requested PBX node does not exist.
405 method_not_allowedThe operation is not available, including writes to observed status or deleting the entire configuration.
500 database_error, database_warning or firewall_verification_failedThe change could not be saved and verified. The transaction is rolled back.
503 transactional_tables_requiredConvert se_settings, se_settings_max and ge_geoip to InnoDB before API writes.
503 firewall_busyAnother API writer holds the configuration lock. Retry later.
503 firewall_commit_unknownThe 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

MethodEndpointResult
GET/useractivityA 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

ParameterMeaning
start, endOptional inclusive timestamps in PBX server time, formatted YYYY-MM-DD HH:MM:SS. No date restriction is applied when omitted.
user / ul_userExact stored username.
user_action / ul_actionExact activity action, for example LOGIN, LOGIN FAILED, or UPDATE. Use these parameters rather than the routing parameter action.
table / ul_tableExact stored table or API resource label.
table_id / ul_table_idExact nonnegative table record ID.
host / ul_hostExact stored caller IP address.
countrycode / ul_countrycodeExact stored country code, such as IT.
objecttype / ul_objecttypeExact stored object type.
qLiteral substring search across visible activity columns and tenant name/code. Characters %, _, and ! are literal, not wildcards. Case matching follows the database collation.
idOptional 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

ParameterMeaning
limitPage size, default 100, from 1 to 1000.
offsetPage offset, default 0, maximum 10000000.
orderdesc (default) or asc, ordered by activity ID ul_id.
before_idExclusive upper ID bound. Continue a descending listing with the returned next_before_id.
after_idExclusive 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

ParameterMeaning
idNumeric node ID. Supply it in /nodes/{id} or as a query parameter. Both forms return one object in data; conflicting IDs are rejected.
livetrue by default. Include live Asterisk version, peer/contact counts, channels/calls and ODBC state. Use false for database readings without an AMI connection.
limitFor lists: 1–100 nodes per page; default 10.
offsetFor 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

FieldMeaning
objectnodes for both list and single-node responses.
generated_at, timezoneResponse snapshot time and PBX server timezone. This is not a new collection timestamp for saved metrics.
dataNode objects for a list, or one node object for an ID lookup.
limit, offset, has_more, next_offsetPagination. next_offset is null on the last page.
peers_online_on_pageSum 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.
contextAI processing backlogs for returned processing nodes, cluster housekeeping and the database auto-increment capacity check.
Node fieldMeaning
id, name, peer_name, ip_address, pbx_versionNode identity, host address and installed PBX version.
osversion, 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.croncheckSaved scheduling cursor and freshness check. Includes wall-clock last_check, effective epoch, stored_epoch, age_seconds, threshold_seconds, future and status.
checks.devstateSaved device-state heartbeat with a 1,800-second threshold; installed and expected versions, ping and pong timestamps.
checks.geoip_module, checks.geoip_data, checks.dahdiSaved GeoIP module/data and DAHDI status values and colours.
checks.asterisk_recoveryWhether automatic recovery is enabled, saved recovery state, last restart timestamp and status.
services.amirouter, services.openaigatewayConfigured enable value, saved runtime state, installed/expected versions, icon state and status.
services.voipmonitorWhether VoIPmonitor is enabled and its saved status message.
systemCPU 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.
liveAMI 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 fieldMeaning
requested, available, partialWhether live data was requested, an AMI connection succeeded, and some requested readings were unavailable.
checked_atTime 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_versionLive Asterisk version.
sip_peers_onlineMonitored SIP peers reported online by Asterisk.
pjsip_contactsPJSIP contact objects, including multiple contacts for one endpoint. This is not a distinct endpoint or phone count.
peers_onlineSIP plus PJSIP counts, or null if either is unavailable.
active_channels, active_calls, calls_processedLive Asterisk channel/call counters.
odbcFor each queried link: name, connected state, active and maximum connection counts, and status.
warningsMachine-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 / codeMeaning
400 invalid_nodes_requestInvalid ID, pagination, live flag or conflicting selectors.
400 tenant_not_applicableTenant supplied for a global operation; omit it.
401 missing_api_key / invalid_api_keyMissing or invalid credentials.
403 admin_required / api_ip_not_allowedA verified tenant key is not a global key, or the normal API IP filter denied access.
404 node_not_found / not_foundRequested node or route does not exist.
405 method_not_allowedOnly GET is supported; standard OpenAPI OPTIONS handling is available.
503 node_status_unavailableThe 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

ParameterRequiredDescription
tenantYesOne exact tenant code or name. Codes take precedence over names. Ambiguous names and wildcard tenant selection are rejected, including for global keys.
liveNoDefaults to true. Use false for cached device states only. 1 and 0 are accepted aliases.
keyUnless an authentication header is usedAn 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"
  }
]
FieldTypeMeaning
idIntegerExtension internal ID.
numberStringDialable extension number; leading zeros are preserved.
nameStringExtension display name.
techStringConfigured technology, such as SIP, PJSIP, CUSTOM, or VIRTUAL.
stateStringCached 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.
dndBooleanConfigured extension Do Not Disturb flag, independent of channel activity.
device_stateString or nullNormalized cached state before the live overlay; null when no trustworthy peer mapping or sample exists.
active_channelsInteger or nullObserved channel count for a complete live snapshot. Null when live collection is disabled, unsupported, or incomplete. This counts channels, not distinct conversations.
live_statusStringok: 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 statusReason
400Missing or invalid exact tenant selection, unsupported identifier filters, another action combined with the endpoint, or an invalid live value.
401Missing, unknown, revoked, or expired API key.
403Disallowed IP, tenant, or endpoint; or OpenAPI disabled for the tenant. A missing advanced-key operation returns api_endpoint_not_allowed.
404Tenant or requested route not found.
405A method other than GET was used.
409The tenant display name is ambiguous; use its unique code.
503Database lookup failed (extension_states_unavailable) or the key policy could not be verified.