Table of Contents

API : PBX : Events Get

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.

Request

This request will return a single event.

URL https://api.telecomx.dk/pbx/events/EVENT_ID
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 example

https://api.telecomx.dk/pbx/events/1234567890ABCDEF12345678

Response

An action the event does not have (webhook, sms, call, setVariable, setSwitch or queue) is left out.

JSON object
_id Id Unique id of the event.
customer Id Id of the customer the event belongs to.
type String What triggers the event: CALL, CALL_START, CALL_RING, CALL_ANSWER, CALL_END, SWITCH, SWITCH_ON, SWITCH_OFF, QUEUE, QUEUE_MEMBER_JOIN, QUEUE_MEMBER_LEFT, CONFERENCE, HOTDESK or TIMER - see Triggers.
enabled Boolean True if the event is triggered. False if it is kept, but not triggered.
target String What the trigger is limited to, null for no limit:
CALL, CALL_START, CALL_RING, CALL_ANSWER, CALL_END - a phone number or the start of one, matched against the calling and the called number.
SWITCH, SWITCH_ON, SWITCH_OFF - the name of the switch.
QUEUE, QUEUE_MEMBER_JOIN, QUEUE_MEMBER_LEFT - id of the queue.
CONFERENCE - id of the conference.
HOTDESK - id of the extension, or MAC address of the SIP phone (00:15:65:AA:BB:CC).
TIMER - not used.
timers Array When a TIMER event runs. Empty for the other types.
timers[].day Number Weekly timer: day of the week, 0-6, 0 is Sunday.
timers[].time Number Weekly timer: minutes since midnight, Danish time, 0-1439 - e.g. 480 is 08:00.
timers[].date Date One-off timer: the date and time to run. A timer has either date, or day and time.
webhook Object Call a URL.
webhook.method String GET, POST or POSTJSON - see Webhook.
webhook.url String URL to call. May hold variables.
webhook.json String The JSON to post when method is POSTJSON, empty otherwise. May hold variables.
webhook.secret String Secret the requests are signed with (header X-TCX-Signature). Only returned to users who may change the event - and never by List.
sms Object Send an SMS.
sms.message String The message. May hold variables.
sms.recipients String Comma separated list of phone numbers in E.164 format, at most 10.
sms.from String Sender - an E.164 number (sent without its + and cut to 11 digits) or up to 11 characters. Null for the customer's name, cut to 11 characters.
call Object Place a call.
call.destination String Number to ring: an extension, a group or an external number.
call.source String Number the destination is connected to when a person answers, called as an internal call - e.g. a playback with an announcement.
call.autoAnswer Boolean True to make the SIP phones of the destination answer by themselves, for announcements.
setVariable Object Set a PBX variable.
setVariable.target String Name of the variable - prefixed with SHARED: if shared, or <employee-id>: if personal.
setVariable.value String Value to set. May hold variables.
setSwitch Object Turn a PBX switch on or off.
setSwitch.target String Name of the switch - prefixed with SHARED: if shared, or <employee-id>: if personal.
setSwitch.value Boolean True to turn the switch on, false to turn it off.
queue Object Change the members of a queue - see Queue.
queue.action String JOIN, LEAVE, LEAVE_ALL or EMPTY.
queue.queue String Id of the queue, or TRIGGER for the queue of what triggered the event. Null for LEAVE_ALL.
queue.extension String Id of the extension, or TRIGGER for the extension of what triggered the event. For EMPTY, the member to keep - null to keep no one.
queue.priority Number JOIN only: priority of the new member, 1-20. Null for 1.
queue.exclusive Boolean JOIN only: true to also take every other member who is not permanent out of the queue.
notes String Notes about the event.
createdAt Date When the event was created.
updatedAt Date When the event was last changed.

Example

{
  _id: '12345678901234567890ABCD',
  customer: '1234567890123456789ABCDE',
  type: 'CALL_END',
  enabled: true,
  target: '+4570',
  timers: [],
  webhook: {
    method: 'POSTJSON',
    url: 'https://hooks.example.com/pbx',
    json: '{ "event": "%EVENT_TYPE%", "caller": "%A_NUMBER%", "called": "%B_NUMBER%", "talked": "%CONVERSATION_DURATION%" }',
    secret: '6f1c0f2a9d0e4b7a8c3d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3'
  },
  sms: {
    message: 'Missed call from %A_NUMBER% (%A_NAME%) at %TIME%',
    recipients: '+4520123456,+4530123456',
    from: 'Reception'
  },
  notes: 'Tell the sales team about calls to the 70 number',
  createdAt: '2026-11-04T08:12:44.000Z',
  updatedAt: '2026-11-04T08:12:44.000Z'
}

Example - queue action

{
  _id: '12345678901234567890ABCE',
  customer: '1234567890123456789ABCDE',
  type: 'TIMER',
  enabled: true,
  target: null,
  timers: [
    { day: 6, time: 480 },
    { day: 0, time: 480 }
  ],
  queue: {
    action: 'JOIN',
    queue: '23456789012345678901BCDE',
    extension: '3456789012345678901CDEF0',
    priority: 1,
    exclusive: true
  },
  notes: 'The weekend phone takes over the support queue at 08:00 on Saturday and Sunday',
  createdAt: '2026-11-06T09:20:31.000Z',
  updatedAt: '2026-11-06T09:20:31.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>