Get Started

REST API: Queues

The Queue instance resource allows you to query and manage the state of individual call queues. When a caller is enqueued in a named Queue via the <Enqueue> verb, a Queue with that name is created if it doesn't exist. A Queue can also be created beforehand using the API. Each individual call in the queue is represented as a Member instance resource. See the Members documentation for details.

The Queues list resource allows you to list the queues within an account.

Queue Instance Resource

This resource represents an individual Queue instance. Each Queue needs to have a unique friendly name within an account.

Resource URI

/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}

Resource Properties

A Queue resource is represented by the following properties:

Property Description
Sid A 34 character string that uniquely identifies this queue.
FriendlyName A user-provided string that identifies this queue.
CurrentSize The count of calls currently in the queue.
MaxSize The upper limit of calls allowed to be in the queue. The default is 100. The maximum is 1000.
AverageWaitTime The average wait time of the members of this queue in seconds. This is calculated at the time of the request.

HTTP GET

Returns a representation of the Queue identified by {QueueSid}.

Example

HTTP POST

The POST request allows you to change the FriendlyName or MaxSize. Changing the MaxSize of a Queue to something smaller than its current size will result in the Queue rejecting incoming requests until it shrinks below the new MaxSize.

Example

HTTP PUT

Not supported

HTTP DELETE

The DELETE method allows you to remove a Queue. Only empty queues are deletable. Deleting a queue will not prevent another queue with the same friendly name from being dynamically created.

Queue Instance Subresources

Each Queue instance resource has a Members subresource which represents the set of members currently in the queue.

Members List Subresource
/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members

Represents the set of members currently connected to the queue identified by {QueueSid}. See the Members resource documentation for properties and response formats.

Queues List Resource

Resource URI

/2010-04-01/Accounts/{AccountSid}/Queues

HTTP GET

Returns a list of queues within an account. The list includes paging information.

Example 1

HTTP POST

You can create a new Queue resource by POSTing to the Queues list resource. The FriendlyName and MaxSize parameters can be specified at creation.

Optional Parameters

You may POST the following parameters:

Parameter Description
FriendlyName A unique identifier for this queue.
MaxSize The maximum size of this queue. The default is 100. The maximum is 1000.
Example

HTTP PUT

Not supported

HTTP DELETE

Not supported