api:pbx:events:log
Table of Contents
API : PBX : Events Log
Introduction
A PBX event is a rule that runs actions - a webhook, an SMS, a call, setting a variable or a switch, or changing the members of a queue - when something happens on the PBX. See PBX events for the triggers, the variables and the limits.
Every run of an event is logged: what triggered it, the variables it ran with, and how each action went. This request returns the latest runs of an event, newest first - both runs the PBX triggered and test runs. Runs are kept for 30 days.
Request
| URL | https://api.telecomx.dk/pbx/events/EVENT_ID/log | |
|---|---|---|
| Method | GET | |
| Access level | VIEWER, MANAGER or OWNER if user belongs to the customer. RESELLER if customer belongs to the reseller. ADMIN. |
|
| Param | EVENT_ID | Id of the event (24 hex-char string) |
| Query | limit | [optional] The number of runs to return, default 20, min 1, max 100. A value outside the range is moved to the nearest allowed value. |
Query examples
https://api.telecomx.dk/pbx/events/1234567890ABCDEF12345678/log https://api.telecomx.dk/pbx/events/1234567890ABCDEF12345678/log?limit=100
Response
| JSON object | ||
|---|---|---|
| logs | Array | The runs, newest first - see definition below. |
| Run object | ||
|---|---|---|
| _id | Id | Unique id of the run. |
| customer | Id | Id of the customer the event belongs to. |
| event | Id | Id of the event. |
| type | String | The type of the event when it ran, e.g. CALL_END. Null for a test that could not run. |
| summary | String | Short description of what triggered the run, e.g. CALL_END +4512345678 → +4587654321, SWITCH_ON door1 or TEST. A secret number is shown as [hidden]. A test that could not run has TEST failed: and the reason, e.g. TEST failed: rule not found. |
| test | Boolean | True for a test run. |
| requestId | String | Id of the test request that started the run, null when the PBX triggered it. |
| variables | Object | The variables the actions ran with, as name: value - see Variables. |
| actions | Array | One entry per action of the event, in the order they ran. Empty if the event has no actions. |
| actions[].action | String | Which action: SET_SWITCH, SET_VARIABLE, QUEUE, WEBHOOK, SMS or CALL. |
| actions[].success | Boolean | True if the action succeeded - for a webhook, a response with status 200-299. |
| actions[].status | Number | The HTTP status the webhook answered with - or the PBX, for a call. Null when there was none. |
| actions[].error | String | Why the action failed, null when it succeeded - see below. |
| actions[].ms | Number | How long the action took, in milliseconds. |
| createdAt | Date | When the event ran. |
The errors an action can fail with:
| Error | Action | Description |
|---|---|---|
| rate_limited | All | The action was skipped because the customer has used its limit for the last minute - see Limits. |
| HTTP status | Webhook | The webhook answered with a status that is not 200-299. |
| Call | The PBX refused the call, e.g. because the destination is not an extension, a group or an external number, or is an emergency number. | |
| timeout | Webhook | The webhook did not answer within 5 seconds. |
| blocked_address | Webhook | The host name of the webhook points at a private, loopback or otherwise non-public address, or at Telecom X's own network. |
| dns_failed: … | Webhook | The host name of the webhook could not be looked up. |
| other text | Webhook | The connection to the webhook failed - the text says why, e.g. that the connection was refused. |
| n of m recipients failed: … | SMS | The SMS could not be sent to some of the recipients - the text after the colon is the answer from the SMS provider. It was sent to the others. |
| no_recipients | SMS | The SMS action has no valid recipient. |
| empty_message | SMS | The SMS message is empty after the variables were filled in. |
| billing_failed | SMS | The SMS was sent, but an error occurred afterwards. Contact support if it happens again. |
| invalid_number | Call | The call destination or source is not a valid number. |
| no_pbx_server | Call | No PBX server was available to place the call. |
| pbx_timeout | Call | The PBX did not answer the request to place the call in time. |
| pbx_unreachable | Call | The PBX could not be reached to place the call. |
| invalid_name | Set variable, set switch | The name of the variable or switch to set is not valid. |
| variables_unavailable | Set variable, set switch, webhook, SMS | The PBX variables and switches could not be read or set at the moment. |
| invalid_settings | Queue | The queue action is missing its queue or extension, or one of them is not valid. |
| no_trigger_queue | Queue | The queue is TRIGGER, but what triggered the event has no queue - e.g. a call that did not come through a queue. |
| no_trigger_extension | Queue | The extension is TRIGGER, but what triggered the event has no extension - e.g. a member who is an external number. |
| queue_not_found | Queue | The queue does not exist, was deleted or does not belong to the customer. |
| extension_not_found | Queue | The extension does not exist, was deleted or does not belong to the customer. |
| not_permitted | Queue | Only the members of a group may join the queue, and the extension is not in the group (JOIN). |
| permanent_member | Queue | The extension is a permanent member of the queue, and cannot be taken out (LEAVE). |
| last_member_locked | Queue | The queue locks its last member: the extension is the last member (LEAVE), or nobody would be left (EMPTY). Nothing was changed. |
| internal_error | All | An unexpected error. Contact support if it happens again. |
Example
{ logs: [ { _id: '6728a1b2c3d4e5f601234567', customer: '1234567890123456789ABCDE', event: '12345678901234567890ABCD', type: 'CALL_END', summary: 'CALL_END +4512345678 -> +4570123456', test: false, requestId: null, variables: { EVENT_TYPE: 'CALL_END', TIME: '2026-11-04 14:30:05', TIMESTAMP: '1793799005', GUID: '1b4e28ba-2fa1-41d2-883f-0016d3cca427', EVENT_ID: '12345678901234567890ABCD', A_NUMBER: '+4512345678', A_NUMBER_NO_PREFIX: '12345678', A_NAME: 'Anna Hansen', B_NUMBER: '+4570123456', B_NUMBER_NO_PREFIX: '70123456', B_NAME: '', DIRECTION: 'I', CALL_ID: 'b6f0c3a2-6c1e-4f57-9a0e-3d2f1c4b5a69', START: '2026-11-04 14:27:41', CALL_DURATION: '144', CONVERSATION_DURATION: '131', EXTENSION_ID: '', QUEUE_ID: '', QUEUE_NAME: '' }, actions: [ { action: 'WEBHOOK', success: true, status: 200, error: null, ms: 87 }, { action: 'SMS', success: false, status: null, error: 'rate_limited', ms: 0 } ], createdAt: '2026-11-04T13:30:05.000Z' } ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 403 | access_denied | Insufficient access level |
| 404 | id | Event not found |
| 422 | id | Invalid ObjectId |
| 500 | internal_error | <Unspecified> |
api/pbx/events/log.txt · Last modified: by Telecom X AI
