Skip to content

Queue

Manage Zorio PBX queues: CRUD queues, add / update / remove agent tiers.

GET /api/pbx/queues — List

Query: search (matches name or queue_number), page, per_page (1-200).

The response shape matches Extensions (5 keys: current_page, data, last_page, per_page, total).

GET /api/pbx/queues/{name} — Detail

Path parameter

name (user-facing string, NOT id).

Response body fields

FieldTypeDescriptionValid values
namestringUser-facing queue nameunique per account
queue_numberstringInternal extension to dial into the queue3-10 digits
team_idinteger|nullOwning team
strategystringAgent-selection strategyring-all / longest-idle-agent / round-robin / top-down / agent-with-least-talk-time / agent-with-fewest-calls / sequentially-by-agent-order / random
tier_rules_applyboolWhether tier rules are applied
tier_rule_wait_secondintegerSeconds to wait before escalating to the next tier0-3600
tier_rule_wait_multiply_levelboolMultiply wait seconds by the tier level
tier_rule_no_agent_no_waitboolSkip waiting if no agent is online in the tier
abandoned_resume_allowedboolAllow the caller to resume after hanging up
discard_abandoned_afterintegerSeconds before discarding an abandoned record
max_wait_time_with_no_agentintegerMaximum wait while no agent is available (seconds)≥ 0
max_wait_time_with_no_agent_time_reachedstringAction when the wait time expireshangup / or another action name
time_base_scorestringScore by system (system-wide) or queue (within this queue only)system / queue
recording_templatestring|nullRecording filename template (Zorio PBX variable interpolation)
statusstringStatusactive / inactive
created_atdatetime
updated_atdatetime

Response Body (JSON) — 200

json
{
  "data": {
    "name": "Support01",
    "queue_number": "200",
    "team_id": 2,
    "strategy": "agent-with-fewest-calls",
    "tier_rules_apply": true,
    "tier_rule_wait_second": 15,
    "tier_rule_wait_multiply_level": true,
    "tier_rule_no_agent_no_wait": true,
    "abandoned_resume_allowed": false,
    "discard_abandoned_after": 14400,
    "max_wait_time_with_no_agent": 60,
    "max_wait_time_with_no_agent_time_reached": "hangup",
    "time_base_score": "queue",
    "recording_template": null,
    "status": "active"
  }
}

POST /api/pbx/queues — Create

Request body fields

FieldTypeRequiredDescriptionValues
namestringQueue namemax 100, unique per account
queue_numberstringNumber to dial into the queueRegex ^[0-9]{3,10}$, unique per account
team_idintegeroptionalOwning team
strategystringoptionalAgent-selection strategy8 enum values (see Detail)
tier_rules_applybooloptional
tier_rule_wait_secondintegeroptional0-3600
tier_rule_wait_multiply_levelbooloptional
tier_rule_no_agent_no_waitbooloptional
abandoned_resume_allowedbooloptional
discard_abandoned_afterintegeroptional≥ 0
max_wait_time_with_no_agentintegeroptional≥ 0
max_wait_time_with_no_agent_time_reachedstringoptional
time_base_scorestringoptionalsystem / queue

Request Body (JSON)

json
{
  "name": "Sales01",
  "queue_number": "300",
  "team_id": 2,
  "strategy": "agent-with-fewest-calls",
  "tier_rules_apply": true,
  "tier_rule_wait_second": 15,
  "tier_rule_no_agent_no_wait": true,
  "max_wait_time_with_no_agent": 60,
  "time_base_score": "queue"
}

Response Body (JSON) — 201

json
{
  "data": {
    "name": "Sales01",
    "queue_number": "300",
    "team_id": 2,
    "strategy": "agent-with-fewest-calls",
    "tier_rules_apply": true,
    "tier_rule_wait_second": 15,
    "tier_rule_wait_multiply_level": false,
    "tier_rule_no_agent_no_wait": true,
    "abandoned_resume_allowed": false,
    "discard_abandoned_after": 0,
    "max_wait_time_with_no_agent": 60,
    "max_wait_time_with_no_agent_time_reached": "hangup",
    "time_base_score": "queue",
    "recording_template": null,
    "status": "active"
  }
}

PUT / DELETE /api/pbx/queues/{name}

PUT

The body accepts every field from Create except name and queue_number (immutable).

json
{
  "strategy": "longest-idle-agent",
  "tier_rule_wait_second": 20,
  "max_wait_time_with_no_agent": 90
}

Response 200 = { data: { ...17 queue fields } }.

DELETE

Soft delete + the observer detaches the queue at runtime.

json
{ "data": { "deleted": true } }

Tier-agent management

GET /api/pbx/queues/{name}/agents — List tiers

Response body fields (each item in data[])

FieldTypeDescriptionValues
extension_numberstringAgent extension number
agent_namestringAgent name <ext>@<sip-domain>
statusstringAgent presence statusavailable / available_on_demand / on_break / logged_out
statestringQueue-runtime stateidle / waiting / receiving / in_a_queue_call
tier_levelintegerPriority level (1 = highest)1-9
tier_positionintegerOrder within the same level1-99
max_no_answerintegerNumber of missed calls before auto-logout
wrap_up_timeintegerWrap-up time after each call (seconds)
json
{
  "data": [
    {
      "extension_number": "2001",
      "agent_name": "2001@app.zorio.vn",
      "status": "available",
      "state": "idle",
      "tier_level": 1,
      "tier_position": 1,
      "max_no_answer": 3,
      "wrap_up_time": 5
    }
  ]
}

POST /api/pbx/queues/{name}/agents — Add a tier

Request body fields

FieldTypeRequiredDescriptionValues
extensionstringExtension numberMust exist. Regex ^[0-9]{3,10}$
tier_levelintegeroptionalPriority level1-9 (default 1)
tier_positionintegeroptionalPosition within the level1-99 (default 1)

Automatically creates a tier-agent record if the agent does not exist. Returns 409 if the extension is already in this queue.

json
{ "extension": "2001", "tier_level": 1, "tier_position": 1 }

Response 201: { "data": { "added": true } }

PATCH /api/pbx/queues/{name}/agents/{ext} — Update a tier

Path: name (queue), ext (extension_number).

Request body fields (every field optional)

FieldTypeDescriptionValues
tier_levelintegerPriority level1-9
tier_positionintegerPosition within the level1-99
statusstringAgent presence statusavailable / available_on_demand / on_break / logged_out
json
{ "tier_level": 2, "tier_position": 1, "status": "on_break" }

Response 200: { "data": { "updated": true } }

DELETE /api/pbx/queues/{name}/agents/{ext} — Remove a tier

No request body. Response 200: { "data": { "removed": true } }

Does NOT delete the tier-agent record — only removes it from this queue (the agent can still belong to other queues).

Cấp phép theo điều khoản sử dụng của Zorio.