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

member-properties page anchor
Resource properties
call_sidtype: SID<CA>Not PII

date_enqueuedtype: string<DATE TIME RFC 2822>Not PII

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


positiontype: integerNot PII

This member's current position in the queue.


uritype: stringNot PII

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


wait_timetype: integerNot PII

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


queue_sidtype: SID<QU>Not PII

The SID of the Queue the member is in.


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.

Parameters

fetch-parameters page anchor
URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the Member resource(s) to fetch.


QueueSidtype: SID<QU>Not PII
Path Parameter

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


CallSidtype: stringNot PII
Path Parameter

The Call(link takes you to an external page) SID of the resource(s) to fetch.

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

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.members('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.fetch()
_11
.then(member => console.log(member.callSid));

Output

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

Fetch the Member resource at the front of the queue

fetch-the-member-resource-at-the-front-of-the-queue page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.members('Front')
_11
.fetch()
_11
.then(member => console.log(member.callSid));

Output

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


Read multiple Member resources

read-multiple-member-resources page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}/Members.json

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the Member resource(s) to read.


QueueSidtype: SID<QU>Not PII
Path Parameter

The SID of the Queue in which to find the members


PageSizetype: integerNot PII
Query Parameter

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


Pagetype: integerNot PII
Query Parameter

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


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

Read multiple Member resources

read-multiple-member-resources-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.members
_11
.list({limit: 20})
_11
.then(members => members.forEach(m => console.log(m.callSid)));

Output

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


Update a Member resource

update-a-member-resource page anchor
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.

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the Member resource(s) to update.


QueueSidtype: SID<QU>Not PII
Path Parameter

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


CallSidtype: stringNot PII
Path Parameter

The Call(link takes you to an external page) SID of the resource(s) to update.


Request body parameters
Urltype: string<URI>Not PII
Required

The absolute URL of the Queue resource.


Methodtype: enum<HTTP METHOD>Not PII

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:
HEADGETPOSTPATCHPUTDELETE
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.members('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.update({url: 'https://example.com'})
_11
.then(member => console.log(member.callSid));

Output

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

Update the Member resource at the front of the queue

update-the-member-resource-at-the-front-of-the-queue page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.members('Front')
_11
.update({url: 'https://example.com'})
_11
.then(member => console.log(member.callSid));

Output

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


Rate this page: