Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

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:

average_wait_time
integer Not PII

The average wait time of the members of this queue in seconds. This is calculated at the time of the request.

current_size
integer Not PII

The count of calls currently in the queue.

friendly_name
string Not PII

A user-provided string that identifies this queue.

max_size
integer Not PII

The upper limit of calls allowed to be in the queue. The default is 100. The maximum is 1000.

sid
sid<QU> Not PII

A 34 character string that uniquely identifies this queue.

Instance HTTP GET

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

Get a Call Queue

Use the QueueSid to look up a call queue.

Loading Code Sample...
      
      
          
          
          
          
        

      Instance 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.

      Update a Queue

      Change the MaxSize of a call queue via the API.

      Loading Code Sample...
          
          
              
              
              
              
            

          Instance HTTP PUT

          Not supported

          Instance HTTP DELETE

          The DELETE method allows you to remove a Queue. Only empty queues can be deleted. 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

          List Resource URI

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

          List HTTP GET

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

          Get all Queues

          Get a list of all queues within an account.

          Loading Code Sample...
              
              
                  
                  
                  
                  
                

              List 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:

              FriendlyName
              Required
              post string Not PII

              A user-provided string that identifies this queue.

              MaxSize
              Optional
              post integer Not PII

              The upper limit of calls allowed to be in the queue. The default is 100. The maximum is 1000.

              Create a New Queue

              POST to create a new queue resource with the FriendlyName 'newqueue.'

              Loading Code Sample...
                  
                  
                      
                      
                      
                      
                    

                  List HTTP PUT

                  Not supported

                  List HTTP DELETE

                  Not supported

                  Need some help?

                  We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

                  Loading Code Sample...