Skip to contentSkip to navigationSkip to topbar
On this page

Invites Resource


(error)

Danger

Programmable Chat has been deprecated and is no longer supported. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the EOL process here(link takes you to an external page).

If you're starting a new project, please visit the Conversations Docs to begin. If you've already built on Programmable Chat, please visit our Migration Guide to learn about how to switch.

(error)

Danger

This is reference documentation for the v1 REST API, which has been deprecated. You should use the current v2 REST API.

The Invite resource of Programmable Chat represents all pending invitations to Users within the Service instance to become a Member of the Channel.


Actions

actions page anchor

Each invite has these properties:

Property nameTypeRequiredDescriptionChild properties
sidSID<IN>

Optional

Not PII

The unique string that we created to identify the Invite resource.

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

account_sidSID<AC>

Optional

The SID of the Account that created the Invite resource.

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

channel_sidSID<CH>

Optional

The SID of the Channel the resource belongs to.

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

service_sidSID<IS>

Optional

The SID of the Service the resource is associated with.

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

identitystring

Optional

PII MTL: 30 days

The application-defined string that uniquely identifies the resource's User within the Service. See access tokens for more info.


date_createdstring<date-time>

Optional

The date and time in GMT when the resource was created specified in RFC 2822(link takes you to an external page) format.


date_updatedstring<date-time>

Optional

The date and time in GMT when the resource was last updated specified in RFC 2822(link takes you to an external page) format.


role_sidSID<RL>

Optional

The SID of the Role assigned to the resource.

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

created_bystring

Optional

The identity of the User that created the invite.


urlstring<uri>

Optional

The absolute URL of the Invite resource.


List All Invites of a Channel

action-list page anchor
1
GET /Services/{Instance SID}/Channels/{Channel SID}/Members
2
List all Invites of a ChannelLink to code sample: List all Invites of a Channel
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listInvite() {
11
const invites = await client.chat.v1
12
.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.channels("ChannelSid")
14
.invites.list({ limit: 20 });
15
16
invites.forEach((i) => console.log(i.sid));
17
}
18
19
listInvite();

Output

1
{
2
"invites": [],
3
"meta": {
4
"first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0",
5
"key": "invites",
6
"next_page_url": null,
7
"page": 0,
8
"page_size": 50,
9
"previous_page_url": null,
10
"url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0"
11
}
12
}