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.
The date and time in GMT that this resource was last updated, specified in RFC 2822 format.
The SID of the Account that created this Queue resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The average wait time in seconds of the members in this queue. This is calculated at the time of the request.
0
The unique string that that we created to identify this Queue resource.
^QU[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in GMT that this resource was created specified in RFC 2822 format.
The maximum number of calls that can be in the queue. The default is 1000 and the maximum is 5000.
0
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues.json
application/x-www-form-urlencoded
A descriptive string that you created to describe this resource. It can be up to 64 characters long.
The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createQueue() {11const queue = await client.queues.create({ friendlyName: "FriendlyName" });1213console.log(queue.dateUpdated);14}1516createQueue();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"average_wait_time": 0,4"current_size": 0,5"date_created": "Tue, 04 Aug 2015 18:39:09 +0000",6"date_updated": "Tue, 04 Aug 2015 18:39:09 +0000",7"friendly_name": "FriendlyName",8"max_size": 100,9"sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",10"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",11"subresource_uris": {12"members": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json"13}14}
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json
The SID of the Account that created the Queue resource to fetch.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Queue resource to fetch
^QU[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchQueue() {11const queue = await client12.queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(queue.dateUpdated);16}1718fetchQueue();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"average_wait_time": 0,4"current_size": 0,5"date_created": "Tue, 04 Aug 2015 18:39:09 +0000",6"date_updated": "Tue, 04 Aug 2015 18:39:09 +0000",7"friendly_name": "0.361280134646222",8"max_size": 100,9"sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",10"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",11"subresource_uris": {12"members": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json"13}14}
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues.json
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listQueue() {11const queues = await client.queues.list({ limit: 20 });1213queues.forEach((q) => console.log(q.dateUpdated));14}1516listQueue();
1{2"end": 0,3"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0",4"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=1&PageToken=PAQUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"page": 0,6"page_size": 1,7"previous_page_uri": null,8"queues": [9{10"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"average_wait_time": 0,12"current_size": 0,13"date_created": "Tue, 04 Aug 2015 18:39:09 +0000",14"date_updated": "Tue, 04 Aug 2015 18:39:09 +0000",15"friendly_name": "0.361280134646222",16"max_size": 100,17"sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",19"subresource_uris": {20"members": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json"21}22}23],24"start": 0,25"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0"26}
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json
The SID of the Account that created the Queue resource to update.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Queue resource to update
^QU[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A descriptive string that you created to describe this resource. It can be up to 64 characters long.
The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateQueue() {11const queue = await client12.queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ friendlyName: "FriendlyName" });1415console.log(queue.dateUpdated);16}1718updateQueue();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"average_wait_time": 0,4"current_size": 0,5"date_created": "Tue, 04 Aug 2015 18:39:09 +0000",6"date_updated": "Tue, 04 Aug 2015 18:39:09 +0000",7"friendly_name": "FriendlyName",8"max_size": 100,9"sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",10"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",11"subresource_uris": {12"members": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json"13}14}
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{Sid}.json
The SID of the Account that created the Queue resource to delete.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Queue resource to delete
^QU[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteQueue() {11await client.queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").remove();12}1314deleteQueue();