create

View as MarkdownOpen in Claude

Create a new queue.

Request

namestringOptional
The name of the queue.
max_sizeintegerOptional
The maximum number of callers allowed in the queue.

Response

idstringRequiredformat: "uuid"
The unique identifier of the queue.
project_idstringRequiredformat: "uuid"
The project ID associated with this queue.
friendly_namestringRequired
The friendly name of the queue.
max_sizeintegerOptional
The maximum number of callers allowed in the queue.
current_sizeintegerOptional
The current number of callers in the queue.
average_wait_timeintegerOptional
The average wait time in seconds.
uristringOptional
The URL of this queue.
date_createddatetimeOptional
Timestamp when the queue was created.
date_updateddatetimeOptional
Timestamp when the queue was last updated.

Response Example

Response
{
"id": "aae131db-214c-46f5-88b6-92004f8467cf",
"project_id": "c6c4679b-716a-456a-9e41-a03821005005",
"friendly_name": "test",
"max_size": 5,
"current_size": 0,
"average_wait_time": 0,
"uri": "/api/relay/rest/queues/aae131db-214c-46f5-88b6-92004f8467cf",
"date_created": "2024-01-15T09:30:00Z",
"date_updated": "2024-01-15T09:30:00Z"
}

Example

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
const queue = await client.queues.create({ name: "support", max_size: 50 });
console.log("Queue ID:", queue.id);