Skip to content

Create a queue (user, pbx)

post /queues

Create a call queue with its members, groups and pools in one request. POST needs name and interval; the other settings default as in the cockpit form. Responds 201 with the queue and its member id lists.

Required scope. An API key needs the queues:write scope. A user bearer token passes only for a user with the write queues permission (as in Cockpit), otherwise 403. A key that only holds the read scope cannot write: 403.

Members. users (pickup lines are users too), groups and pools are lists of ids of this PBX. Absent leaves a list alone, present makes it exactly the given ids, [] empties it. Settings use the choices of the cockpit form (see the field descriptions). The Tempus status filter of a queue is not written through the API.

Tenancy. The PBX is the caller's. An id of another PBX answers 404, the same as an id that does not exist. A write marks the PBX for a configuration push and is recorded in the change log under the API key.

Text fields. A name, label, prefix or announcement text that holds ${, $[, a line break or another control character (below 0x20, a tab excepted) is refused with 422 on that field, because the PBX dialplan would evaluate it. Free text such as comment, description and notes may hold line breaks.

HTTP: bearerAuth

User bearer token. Default authentication for customer-facing endpoints. Obtain a token by calling POST /login with your credentials, then send it on every subsequent request as Authorization: Bearer <token>. The token inherits the permissions and PBX scope of the authenticated user.

HTTP Authorization Scheme
bearer
Bearer format
Bearer <token>
HTTP: IntegrationApiKey

API key created on the Cockpit Integrations page (an "API key" integration). It is a bearer token owned by the customer's PBX and limited to the scopes selected when the key was created (e.g. phone-numbers, push-configuration).

Send it in the Authorization header:

Authorization: Bearer <api_key>

Manage keys (create / reveal / revoke) from Integrations → New integration → API key.

HTTP Authorization Scheme
bearer
accept header · string
example: application/json

Request body · required · application/json

Request schema
namestring
Name of the queue.
length: 3–64
example: Support queue
music_on_hold_idstring | null · uuid
Sound file of type `music` of this PBX, or a built-in music file.
call_flow_idstring | null · uuid
Call flow of this PBX the caller goes to when the queue is left (for example by the exit key).
ring_strategystring
How members are rung.
enum: ring_all least_recent fewest_calls random round_robin
example: round_robin
weightinteger
Priority of the queue; `0` is the default, then 10 to 100 in steps of 10.
example: 0
ring_busy_membersboolean
Whether members who are on a call are rung too.
example: 1
ring_twinningsboolean
Whether the mobile twinnings of the members are rung too.
example:
ring_emptyboolean
Whether callers can enter the queue when no member is logged in.
example:
ring_durationinteger
Seconds a member is rung (`-1` unlimited, 5 to 90, then larger steps up to 3600).
example: 30
intervalinteger
Seconds between ring attempts. Required on `POST` and `PUT`.
enum: 0 2 3 4 5 10
example: 5
wrap_up_timeinteger
Seconds a member is left alone after a call (`0`, 30, 60, then steps up to 1800).
example: 30
exit_keystring | null
Key a caller can press to leave the queue.
enum: 0 1 2 3 4 5 6 7 8 9 * # null
enable_caller_positionboolean
Whether callers hear their position in the queue.
example:
caller_position_announce_frequencyinteger
Seconds between position announcements.
enum: 5 10 20 30 40
example: 10
caller_position_languagestring
Language of the position announcement.
example: en
usersarray<string>
Ids of users that are members (pickup lines are users too).
[]string · uuid
groupsarray<string>
Ids of groups whose members are queue members.
[]string · uuid
poolsarray<string>
Ids of pools whose users are queue members.
[]string · uuid

Responses

Created. The queue with its `users`, `groups` and `pools` id lists.
Response schema
id*string · uuid
Unique identifier of the queue.
read-only
example: 550e8400-e29b-41d4-a716-446655440000
pbx_id*string · uuid
Identifier of the Pbx (tenant) that owns this queue. Always the caller's own PBX: the endpoint never returns another tenant's queues.
read-only
example: 550e8400-e29b-41d4-a716-446655440001
mapping_idstring | null
External correlation id for this queue, used to line it up with the customer's own systems. Null when no mapping has been set.
example: 1042
call_flow_idstring | null · uuid
Identifier of the call flow followed when a waiting caller leaves the queue (for example by pressing `exit_key`). Null when none is attached.
example: 550e8400-e29b-41d4-a716-446655440005
music_on_hold_idstring | null · uuid
Identifier of the sound file (type `music`) played to waiting callers. Null when no music-on-hold is configured.
example: 550e8400-e29b-41d4-a716-446655440004
name*string
Human-readable name of the queue.
length: 0–128
example: Customer Support
ring_strategy*string | null
Order in which members are rung. `ring_all` rings everyone at once; `round_robin` cycles through members in turn; `least_recent` favours the member idle the longest; `fewest_calls` favours the member who has taken the fewest calls; `random` picks at random.
enum: fewest_calls least_recent round_robin ring_all random null
example: ring_all
ring_busy_members*boolean
Whether members already on a call are still rung for new queue calls.
example:
ring_twinnings*boolean
Whether a member's twinned devices ring alongside their desk phone.
example:
ring_duration*integer · int32
Seconds to ring a member before moving to the next; -1 means unlimited.
≥ -1
example: 20
interval*integer · int32
Seconds between successive ring attempts (0 means no wait).
≥ 0
example: 5
wrap_up_time*integer · int32
Seconds an agent stays unavailable after finishing a queue call (0 means no wait).
≥ 0
example: 30
exit_keystring | null
DTMF key a waiting caller can press to leave the queue and follow the attached call flow. Null when no exit key is configured.
enum: 0 1 2 3 4 5 6 7 8 9 * # null
example: 0
ring_empty*boolean
Whether callers may enter (and keep waiting) when no member is available.
example:
weight*integer · int32
Relative priority of this queue when an agent is a member of several queues: the higher the weight, the sooner this queue's callers are served.
example: 50
enable_caller_position*boolean
Whether waiting callers hear periodic announcements of their position in the queue.
example:
caller_position_announce_frequency*integer · int32
How often, in seconds, a waiting caller's position is announced.
≥ 0
example: 10
caller_position_language*string | null
Language used for the caller position announcement.
enum: en de fr null
example: en
created_at*string | null · date-time
Timestamp when the queue was created.
read-only
example: 2024-03-01T08:29:07.000000Z
updated_at*string | null · date-time
Timestamp when the queue was last updated.
read-only
example: 2024-03-01T08:29:07.000000Z
statusesarray<object>
The Tempus statuses linked to this queue (a member carrying one of these statuses is considered reachable for it). Present ONLY when the request carries `?include=statuses`; the key is absent from the payload otherwise. Curated projection: no pivot rows are returned.
id*string · uuid
Status identifier.
example: 550e8400-e29b-41d4-a716-446655440006
name*string
Human-readable status name.
example: Available
styleobject | null
Display style of the status badge in the cockpit.
icon_classstring
Font Awesome class of the status icon.
example: fas fa-car
bg_colorstring
Background color of the status badge, as a hex triplet.
example: #FFEEB2
availabilitystring | null
Presence bucket this status maps to.
enum: available unavailable busy meeting away null
example: available
do_not_disturbboolean
Whether a user on this status is treated as do-not-disturb.
example:
payableboolean
Whether time booked under this status counts as payable.
example: 1
mapping_idstring | null
External correlation id for the status. Null when unset.
example: 16
membersarray<object>
The members of the queue: direct users, users of the attached groups and users matched by the attached pools, each listed once and sorted by last name, then first name. Pickup lines are never listed. Present ONLY when the request carries `?include=members`; the key is absent from the payload otherwise.
Each item — A member of a queue, as listed under `members` when `?include=members` is requested. A user who is in the queue through several routes (for example directly and through a group) is listed once, with every route in `sources`.
id*string · uuid
Identifier of the user.
example: 550e8400-e29b-41d4-a716-446655440020
first_name*string
First name of the user.
example: Ana
last_name*string
Last name of the user.
example: Sample
email*string · email
Email address of the user.
example: ana.sample@example.org
extension*string | null
Extension number of the user. Null when the user has no extension.
example: 201
sources*array<string>
How the user is in the queue.
[]string
enum: direct group pool
usersarray<string>
Ids of the users that are members of the queue (pickup lines are users too), in the shape `POST`, `PUT` and `PATCH /queues` accept. Present on show and on every write response, absent on the list. Use `?include=members` for the member records.
[]string · uuid
groupsarray<string>
Ids of the groups whose members are queue members. Present on show and on every write response.
[]string · uuid
poolsarray<string>
Ids of the pools whose users are queue members. Present on show and on every write response.
[]string · uuid
Authorization Token Missing. This error is returned when the authorization token is missing.
Response schema
errorstring
Error message
example: Authorization Token is missing
Forbidden. The bearer token authenticated successfully but does not carry the scope this endpoint requires. Re-create the Integrations API key with the missing scope selected (Integrations > New integration > API key). On a write with a user bearer token, the user lacks the Cockpit permission the same change needs (the message names it).
Response schema
messagestring
Unprocessable Entity. The queue failed validation. `errors` maps each rejected field to its messages and `message` repeats the first one. Nothing was written.
Response schema
messagestring
The first validation message, repeated for convenience.
errorsobject
Field name (or path into the body) to the list of messages for it.
Free-form object
Locked. A restore is running on the PBX, so changes to it are paused until the restore finishes. Nothing was saved. Retry after the number of seconds in the `Retry-After` header. Reads are not affected.
Response schema
messagestring
Too Many Requests. The rate limit for this action has been exceeded. Retry after the window indicated by the Retry-After header.
Response schema
messagestring
Server error. An unexpected condition was encountered on the server and the request could not be completed. The body is a generic JSON envelope with a `message` field. The response is logged on the server side; quote the request URL + timestamp when reporting an issue.
Response schema
messagestring
exceptionstring
Only present in non-production environments.
filestring
Only present in non-production environments.
lineinteger
Only present in non-production environments.
post https://cockpit.voxbi.com/api/v1/queues
Base URL
Request sample
curl -X POST 'https://cockpit.voxbi.com/api/v1/queues' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data '{"name":"Support queue","interval":5,"ring_strategy":"round_robin","ring_duration":30,"users":["550e8400-e29b-41d4-a716-446655440040"],"groups":[],"pools":[]}'
const response = await fetch('https://cockpit.voxbi.com/api/v1/queues', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${YOUR_TOKEN}`,
  },
  body: JSON.stringify({
    "name": "Support queue",
    "interval": 5,
    "ring_strategy": "round_robin",
    "ring_duration": 30,
    "users": [
        "550e8400-e29b-41d4-a716-446655440040"
    ],
    "groups": [],
    "pools": []
}),
});

const data = await response.json();
console.log(data);
import requests

response = requests.post('https://cockpit.voxbi.com/api/v1/queues',
    headers={'Authorization': f'Bearer {YOUR_TOKEN}'},
    json={
    "name": "Support queue",
    "interval": 5,
    "ring_strategy": "round_robin",
    "ring_duration": 30,
    "users": [
        "550e8400-e29b-41d4-a716-446655440040"
    ],
    "groups": [],
    "pools": []
}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
    'http' => [
        'method'  => 'POST',
        'header'  => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
        'content' => '{
    \"name\": \"Support queue\",
    \"interval\": 5,
    \"ring_strategy\": \"round_robin\",
    \"ring_duration\": 30,
    \"users\": [
        \"550e8400-e29b-41d4-a716-446655440040\"
    ],
    \"groups\": [],
    \"pools\": []
}',
    ],
]);

$response = file_get_contents('https://cockpit.voxbi.com/api/v1/queues', false, $context);
$data = json_decode($response, true);
print_r($data);
Sample request
{ … }
"name": "Support queue",
"interval": 5,
"ring_strategy": "round_robin",
"ring_duration": 30,
"users": [ … ],
"550e8400-e29b-41d4-a716-446655440040"
],
"groups": [],
"pools": []
}
{ … }
"id": "550e8400-e29b-41d4-a716-446655440030",
"pbx_id": "550e8400-e29b-41d4-a716-446655440001",
"mapping_id": null,
"call_flow_id": null,
"music_on_hold_id": null,
"name": "Support queue",
"ring_strategy": "round_robin",
"ring_busy_members": true,
"ring_twinnings": false,
"ring_duration": 30,
"interval": 5,
"wrap_up_time": 30,
"exit_key": null,
"ring_empty": false,
"weight": 0,
"enable_caller_position": false,
"caller_position_announce_frequency": 10,
"caller_position_language": "en",
"created_at": "2024-03-01T08:29:07Z",
"updated_at": "2024-03-01T08:29:07Z",
"users": [ … ],
"550e8400-e29b-41d4-a716-446655440040"
],
"groups": [],
"pools": []
}
{ … }
"error": "Authorization Token is missing"
}
Cache-Control string
example: private, must-revalidate
Connection string
example: keep-alive
Content-Type string
example: application/json
Vary string
example: Origin
X-RateLimit-Limit integer
Max requests allowed in the current rate-limit window.
example: 60
X-RateLimit-Remaining integer
Requests remaining in the current rate-limit window.
example: 57
{ … }
"message": "Invalid ability provided."
}
Content-Type string
example: application/json
{ … }
"message": "Name is required.",
"errors": { … }
"name": [ … ],
"Name is required."
],
"interval": [ … ]
"The interval field is required."
]
}
}
Content-Type string
example: application/json
{ … }
"message": "A restore is running on this PBX. Changes are paused until it finishes."
}
Retry-After integer
Seconds to wait before retrying the write.
example: 30
{ … }
"message": "Too Many Attempts."
}
Retry-After integer
Seconds to wait before retrying.
example: 60
Content-Type string
example: application/json
{ … }
"message": "Server Error"
}