Member Resource
A Member resource of Programmable Chat represents the membership of a User to a Channel within a Service instance.
We recommend following the standard URI specification and avoid the following reserved characters ! * ' ( ) ; : @ & = + $ , / ? % # [ ]
for values such as identity and friendly name.
Each Member resource contains these properties.
Property name Type PII Description
The unique string that we created to identify the Member resource.
Pattern: ^MB[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Member resource.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Channel the Member resource belongs to.
Pattern: ^CH[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Service the Member resource is associated with.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The application-defined string that uniquely identifies the resource's User within the Service . See access tokens for more info.
date_created string<date-time> date_updated string<date-time> The SID of the Role assigned to the member.
Pattern: ^RL[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
last_consumed_message_index integer The index of the last Message in the Channel that the Member has read.
last_consumption_timestamp string<date-time> The absolute URL of the Member resource.
The JSON string that stores application-specific data. If attributes have not been set, {}
is returned.
POST https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
Property name Type Required PII Description
ServiceSid SID<IS> required The SID of the Service to create the Member resource under.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Channel the new Member resource belongs to. This value can be the Channel resource's sid
or unique_name
.
Property name Type Required PII Description
The identity
value that uniquely identifies the new resource's User within the Service . See access tokens for more info.
The SID of the Role to assign to the member. The default roles are those specified on the Service .
Pattern: ^RL[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
LastConsumedMessageIndex integer Optional The index of the last Message in the Channel that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source.
LastConsumptionTimestamp string<date-time> Optional DateCreated string<date-time> Optional The date, specified in ISO 8601(link takes you to an external page) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source.
DateUpdated string<date-time> Optional The date, specified in ISO 8601(link takes you to an external page) format, to assign to the resource as the date it was last updated. The default value is null
. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated.
A valid JSON string that contains application-specific data.
_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 // 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 async function createMember() {
_19 const member = await client.chat.v2
_19 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 .channels("ChannelSid")
_19 .members.create({ identity: "Identity" });
_19 console.log(member.sid);
_14 "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "channel_sid": "ChannelSid",
_14 "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "identity": "Identity",
_14 "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "last_consumed_message_index": null,
_14 "last_consumption_timestamp": null,
_14 "date_created": "2016-03-24T21:05:50Z",
_14 "date_updated": "2016-03-24T21:05:50Z",
_14 "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}
The {ChannelSid}
value can be the Channel's sid
or its unique_name
and the {Sid}
value can be either the sid
or the identity
of the Member resource to fetch.
Property name Type Required PII Description
ServiceSid SID<IS> required The SID of the Service to fetch the Member resource from.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Channel the Member resource to fetch belongs to. This value can be the Channel resource's sid
or unique_name
.
The SID of the Member resource to fetch. This value can be either the Member's sid
or its identity
value.
_20 // Download the helper library from https://www.twilio.com/docs/node/install
_20 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20 // Find your Account SID and Auth Token at twilio.com/console
_20 // and set the environment variables. See http://twil.io/secure
_20 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20 const authToken = process.env.TWILIO_AUTH_TOKEN;
_20 const client = twilio(accountSid, authToken);
_20 async function fetchMember() {
_20 const member = await client.chat.v2
_20 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_20 .channels("ChannelSid")
_20 console.log(member.sid);
_14 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "channel_sid": "ChannelSid",
_14 "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "last_consumed_message_index": null,
_14 "last_consumption_timestamp": null,
_14 "date_created": "2016-03-24T21:05:50Z",
_14 "date_updated": "2016-03-24T21:05:50Z",
_14 "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members
The {ChannelSid}
value can be the Channel's sid
or its unique_name
.
Property name Type Required PII Description
ServiceSid SID<IS> required The SID of the Service to read the Member resources from.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Channel the Member resources to read belong to. This value can be the Channel resource's sid
or unique_name
.
Property name Type Required PII Description
Identity array[string] Optional The User 's identity
value of the Member resources to read. See access tokens for more details.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
_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 // 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 async function listMember() {
_19 const members = await client.chat.v2
_19 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 .channels("ChannelSid")
_19 .members.list({ limit: 20 });
_19 members.forEach((m) => console.log(m.sid));
_27 "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0",
_27 "previous_page_url": null,
_27 "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0",
_27 "next_page_url": null,
_27 "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "last_consumed_message_index": null,
_27 "last_consumption_timestamp": null,
_27 "date_created": "2016-03-24T21:05:50Z",
_27 "date_updated": "2016-03-24T21:05:50Z",
_27 "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
POST https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}
The {Sid}
value can be either the sid
or the identity
of the Member resource to update and the {ChannelSid}
value can be the Channel's sid
or its unique_name
.
Property name Type Required PII Description
ServiceSid SID<IS> required The SID of the Service to update the Member resource in.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Channel the Member resource to update belongs to. This value can be the Channel resource's sid
or unique_name
.
The SID of the Member resource to update. This value can be either the Member's sid
or its identity
value.
Property name Type Required PII Description
The SID of the Role to assign to the member. The default roles are those specified on the Service .
Pattern: ^RL[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
LastConsumedMessageIndex integer Optional The index of the last Message that the Member has read within the Channel .
LastConsumptionTimestamp string<date-time> Optional DateCreated string<date-time> Optional The date, specified in ISO 8601(link takes you to an external page) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source.
DateUpdated string<date-time> Optional A valid JSON string that contains application-specific data.
_20 // Download the helper library from https://www.twilio.com/docs/node/install
_20 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20 // Find your Account SID and Auth Token at twilio.com/console
_20 // and set the environment variables. See http://twil.io/secure
_20 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20 const authToken = process.env.TWILIO_AUTH_TOKEN;
_20 const client = twilio(accountSid, authToken);
_20 async function updateMember() {
_20 const member = await client.chat.v2
_20 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_20 .channels("ChannelSid")
_20 .update({ roleSid: "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" });
_20 console.log(member.sid);
_14 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "channel_sid": "ChannelSid",
_14 "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "last_consumed_message_index": 20,
_14 "last_consumption_timestamp": "2016-03-24T21:05:52Z",
_14 "date_created": "2016-03-24T21:05:50Z",
_14 "date_updated": "2016-03-24T21:05:51Z",
_14 "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
DELETE https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}
The {Sid}
value can be either the sid
or the identity
of the Member resource to delete and the {ChannelSid}
value can be the Channel's sid
or its unique_name
.
Property name Type Required PII Description
ServiceSid SID<IS> required The SID of the Service to delete the Member resource from.
Pattern: ^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Channel the Member resource to delete belongs to. This value can be the Channel resource's sid
or unique_name
.
The SID of the Member resource to delete. This value can be either the Member's sid
or its identity
value.
_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 // 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 async function deleteMember() {
_18 .services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 .channels("ChannelSid")