Skip to main content

Queues & selections

Manage call queues and their selections (the rules that pick which agents/groups/tags a queue routes to). Available as mgr.queues / mgr.Queues / mgr.queues, with a nested selections sub-resource.

Queues

for await (const queue of mgr.queues.list()) console.log(queue.id);
const created = await mgr.queues.create({ /* RestCreateQueueBody */ });
const queue = await mgr.queues.get(created.item.id);
await mgr.queues.update(queue.item.id, { /* RestUpdateQueueBody */ });
await mgr.queues.delete(queue.item.id);

Selections

Selections live under queues.selections / Queues.Selections / queues.selections and are addressed by queue id. Each selection has agent, group, and tag membership.

const sel = mgr.queues.selections;
for await (const s of sel.list(queueId)) console.log(s.id);
const created = await sel.create(queueId, { /* RestCreateQueueSelectionBody */ });

await sel.addAgent(queueId, created.item.id, agentId);
await sel.removeAgent(queueId, created.item.id, agentId);
await sel.addGroup(queueId, created.item.id, groupId);
await sel.addTag(queueId, created.item.id, tagId);

// Resolve the agents a queue currently selects:
const selected = await sel.selectAgents(queueId);

Bulk update & global selections

Update several queues at once, list the global queue-selection catalog, or set the priority order of a queue's selections.

await mgr.queues.bulkUpdate({ /* QueueBulkUpdateRequest */ });
const globals = await mgr.queues.globalSelections();
await mgr.queues.selections.setPriority(queueId, [{ /* QueueSelectionPriorityItem */ }]);

Reference