Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Member Resource


The Member resource is a subresource of the Queue resource and represents a single call in a call queue.

All members in a call queue can be identified by their unique CallSid, and the member at the front of the queue can be identified by the Front sid.


Member Properties

Property nameTypePIIDescription
call_sidSID<CA>
Not PII

The SID of the Call the Member resource is associated with.

Pattern: ^CA[0-9a-fA-F]{32}$Min length: 34Max length: 34

date_enqueuedstring<date-time-rfc-2822>

The date that the member was enqueued, given in RFC 2822 format.


positioninteger

This member's current position in the queue.


uristring

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


wait_timeinteger

The number of seconds the member has been in the queue.


queue_sidSID<QU>

The SID of the Queue the member is in.

Pattern: ^QU[0-9a-fA-F]{32}$Min length: 34Max length: 34

Fetch a Member resource

GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members/{CallSid}.json

You can address the member to fetch by its unique CallSid or by the Front sid to fetch the member at the front of the queue.

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the Member resource(s) to fetch.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

QueueSidSID<QU>required

The SID of the Queue in which to find the members to fetch.

Pattern: ^QU[0-9a-fA-F]{32}$Min length: 34Max length: 34

CallSidstringrequired

The Call SID of the resource(s) to fetch.

Fetch a Member resource

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function fetchMember() {
_19
const member = await client
_19
.queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19
.members("CallSid")
_19
.fetch();
_19
_19
console.log(member.callSid);
_19
}
_19
_19
fetchMember();

Output

_10
{
_10
"queue_sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"call_sid": "CallSid",
_10
"date_enqueued": "Tue, 07 Aug 2012 22:57:41 +0000",
_10
"position": 1,
_10
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_10
"wait_time": 143
_10
}

Fetch the Member resource at the front of the queue

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function fetchMember() {
_19
const member = await client
_19
.queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19
.members("Front")
_19
.fetch();
_19
_19
console.log(member.callSid);
_19
}
_19
_19
fetchMember();

Output

_10
{
_10
"queue_sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"call_sid": "Front",
_10
"date_enqueued": "Tue, 07 Aug 2012 22:57:41 +0000",
_10
"position": 1,
_10
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_10
"wait_time": 143
_10
}


Read multiple Member resources

GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members.json

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the Member resource(s) to read.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

QueueSidSID<QU>required

The SID of the Queue in which to find the members

Pattern: ^QU[0-9a-fA-F]{32}$Min length: 34Max length: 34

Query parameters

Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Read multiple Member resources

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function listMember() {
_18
const members = await client
_18
.queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.members.list({ limit: 20 });
_18
_18
members.forEach((m) => console.log(m.callSid));
_18
}
_18
_18
listMember();

Output

_20
{
_20
"end": 0,
_20
"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0",
_20
"next_page_uri": null,
_20
"page": 0,
_20
"page_size": 50,
_20
"previous_page_uri": null,
_20
"queue_members": [
_20
{
_20
"queue_sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_20
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_20
"date_enqueued": "Mon, 17 Dec 2018 18:36:39 +0000",
_20
"position": 1,
_20
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_20
"wait_time": 124
_20
}
_20
],
_20
"start": 0,
_20
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0"
_20
}


Update a Member resource

POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members/{CallSid}.json

Updating a Member resource dequeues the member to begin executing the TwiML document at that URL.

You can address the member to dequeue by its unique CallSid or by the Front sid.

If you successfully dequeue a member by its unique CallSid, it will no longer be queued so a second update action on that same member will fail.

When dequeueing a member by using the Front SID, that member will be dequeued and the next member in the queue will take its place.

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the Member resource(s) to update.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

QueueSidSID<QU>required

The SID of the Queue in which to find the members to update.

Pattern: ^QU[0-9a-fA-F]{32}$Min length: 34Max length: 34

CallSidstringrequired

The Call SID of the resource(s) to update.

Request body parameters

Property nameTypeRequiredPIIDescription
Urlstring<uri>required

The absolute URL of the Queue resource.


Methodenum<http-method>Optional

How to pass the update request data. Can be GET or POST and the default is POST. POST sends the data as encoded form data and GET sends the data as query parameters.

Possible values:
GETPOST

Update a Member resource

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function updateMember() {
_19
const member = await client
_19
.queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19
.members("CallSid")
_19
.update({ url: "https://www.example.com" });
_19
_19
console.log(member.callSid);
_19
}
_19
_19
updateMember();

Output

_10
{
_10
"queue_sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"call_sid": "CallSid",
_10
"date_enqueued": "Thu, 06 Dec 2018 18:42:47 +0000",
_10
"position": 1,
_10
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_10
"wait_time": 143
_10
}

Update the Member resource at the front of the queue

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function updateMember() {
_19
const member = await client
_19
.queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19
.members("Front")
_19
.update({ url: "https://www.example.com" });
_19
_19
console.log(member.callSid);
_19
}
_19
_19
updateMember();

Output

_10
{
_10
"queue_sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"call_sid": "Front",
_10
"date_enqueued": "Thu, 06 Dec 2018 18:42:47 +0000",
_10
"position": 1,
_10
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
_10
"wait_time": 143
_10
}


Rate this page: