Menu

Expand
Rate this page:

Queue Resource

The Queue resource describes a call queue that contains individual calls, which are described by the queue’s Member resources. Your account can have more than one call queue. Each queue can be retrieved by its sid directly using fetch. Alternately, you can read the list of Queues and filter by friendly_name or any other property you prefer.

Call queues are created when you add a call to a queue that doesn’t exist and when you create one explicitly.

For information about enqueing calls, see Queueing Calls.

Queues persist. To optimize fetch operations, inactive Queues should be deleted.

Queue properties

Resource Properties in REST API format
date_updated
date_time<rfc2822> Not PII

The date and time in GMT that this resource was last updated, specified in RFC 2822 format.

current_size
integer Not PII

The number of calls currently in the queue.

friendly_name
string Not PII

A string that you assigned to describe this resource.

uri
uri Not PII

The URI of this resource, relative to https://api.twilio.com.

account_sid
sid<AC> Not PII

The SID of the Account that created this Queue resource.

average_wait_time
integer Not PII

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

sid
sid<QU> Not PII

The unique string that that we created to identify this Queue resource.

date_created
date_time<rfc2822> Not PII

The date and time in GMT that this resource was created specified in RFC 2822 format.

max_size
integer Not PII

The maximum number of calls that can be in the queue. The default is 1000 and the maximum is 5000.

Create a Queue resource

post
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues.json
Parameters
Parameters in REST API format
account_sid
Path
post sid<AC> Not PII

The SID of the Account that will create the resource.

friendly_name
Required
post string Not PII

A descriptive string that you created to describe this resource. It can be up to 64 characters long.

max_size
Optional
post integer Not PII

The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000.

Example 1
Loading Code Sample...
        
        

        Create a Queue resource

        Fetch a Queue resource

        get
        https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json
        Parameters
        Parameters in REST API format
        account_sid
        Path
        get sid<AC> Not PII

        The SID of the Account that created the Queue resource to fetch.

        sid
        Path
        get sid<QU> Not PII

        The Twilio-provided string that uniquely identifies the Queue resource to fetch

        Example 1
        Loading Code Sample...
              
              

              Fetch a Queue resource

              Read multiple Queue resources

              get
              https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues.json
              Parameters
              Parameters in REST API format
              account_sid
              Path
              get sid<AC> Not PII

              The SID of the Account that created the Queue resources to read.

              Example 1
              Loading Code Sample...
                    
                    

                    Read multiple Queue resources

                    Update a Queue resource

                    post
                    https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json
                    Parameters
                    Parameters in REST API format
                    account_sid
                    Path
                    post sid<AC> Not PII

                    The SID of the Account that created the Queue resource to update.

                    sid
                    Path
                    post sid<QU> Not PII

                    The Twilio-provided string that uniquely identifies the Queue resource to update

                    friendly_name
                    Optional
                    post string Not PII

                    A descriptive string that you created to describe this resource. It can be up to 64 characters long.

                    max_size
                    Optional
                    post integer Not PII

                    The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000.

                    Example 1
                    Loading Code Sample...
                          
                          

                          Update a Queue resource

                          Delete a Queue resource

                          delete
                          https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json
                          Parameters
                          Parameters in REST API format
                          account_sid
                          Path
                          delete sid<AC> Not PII

                          The SID of the Account that created the Queue resource to delete.

                          sid
                          Path
                          delete sid<QU> Not PII

                          The Twilio-provided string that uniquely identifies the Queue resource to delete

                          Example 1
                          Loading Code Sample...
                                
                                

                                Delete a Queue resource

                                Rate this page:

                                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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                Loading Code Sample...
                                      
                                      
                                      

                                      Thank you for your feedback!

                                      Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      thanks-feedback-gif