Menu

Expand
Rate this page:

Member Resource

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.

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.

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.

Member properties

Each Member resource contains these properties.

Resource Properties in REST API format
sid
sid<MB> Not PII

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

account_sid
sid<AC> Not PII

The SID of the Account that created the Member resource.

channel_sid
sid<CH> Not PII

The SID of the Channel the Member resource belongs to.

service_sid
sid<IS> Not PII

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

identity

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

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

role_sid
sid<RL> Not PII

The SID of the Role assigned to the member.

last_consumed_message_index
integer? Not PII

The index of the last Message in the Channel that the Member has read.

last_consumption_timestamp
date_time<iso8601> Not PII

The ISO 8601 timestamp of the last Message read event for the Member within the Channel.

url
url Not PII

The absolute URL of the Member resource.

attributes

The JSON string that stores application-specific data. If attributes have not been set, {} is returned.

Create a Member resource

post
https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members

The {ChannelSid} value can be the Channel's sid or its unique_name.

Parameters
Parameters in REST API format
service_sid
Path
post sid<IS> Not PII

The SID of the Service to create the Member resource under.

channel_sid
Path
post sid_like<CH> Not PII

The SID of the Channel the new Member resource belongs to. This value can be the Channel resource's sid or unique_name.

identity
Required
post string PII MTL: 30 DAYS

The identity value that uniquely identifies the new resource's User within the Service. See access tokens for more info.

role_sid
Optional
post sid<RL> Not PII

The SID of the Role to assign to the member. The default roles are those specified on the Service.

last_consumed_message_index
Optional
post integer? Not PII

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.

last_consumption_timestamp
Optional
post date_time<iso8601> Not PII

The ISO 8601 timestamp of the last Message read event for the Member within the Channel.

date_created
Optional
post date_time<iso8601> Not PII

The date, specified in ISO 8601 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.

date_updated
Optional
post date_time<iso8601> Not PII

The date, specified in ISO 8601 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.

attributes
Optional
post string PII MTL: 30 DAYS

A valid JSON string that contains application-specific data.

x_twilio_webhook_enabled
Header
post ienum:webhook_enabled_type Not PII

The X-Twilio-Webhook-Enabled HTTP request header

Example 1
Loading Code Sample...
        
        

        Create a Member resource

        Fetch a Member resource

        get
        https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members/{Sid}

        The {ChannelSid} value can be the Channel's sid or its unique_nameand the {Sid} value can be either the sid or the identity of the Member resource to fetch.

        Parameters
        Parameters in REST API format
        service_sid
        Path
        get sid<IS> Not PII

        The SID of the Service to fetch the Member resource from.

        channel_sid
        Path
        get sid_like<CH> Not PII

        The SID of the Channel the Member resource to fetch belongs to. This value can be the Channel resource's sid or unique_name.

        sid
        Path
        get sid_like<MB> Not PII

        The SID of the Member resource to fetch. This value can be either the Member's sid or its identity value.

        Example 1
        Loading Code Sample...
              
              

              Fetch a Member resource

              Read multiple Member resources

              get
              https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Members

              The {ChannelSid} value can be the Channel's sid or its unique_name.

              Parameters
              Parameters in REST API format
              service_sid
              Path
              get sid<IS> Not PII

              The SID of the Service to read the Member resources from.

              channel_sid
              Path
              get sid_like<CH> Not PII

              The SID of the Channel the Member resources to read belong to. This value can be the Channel resource's sid or unique_name.

              identity
              Optional
              get string[] PII MTL: 30 DAYS

              The User's identity value of the Member resources to read. See access tokens for more details.

              Example 1
              Loading Code Sample...
                    
                    

                    Read multiple Member resources

                    Update a Member resource

                    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.

                    Parameters
                    Parameters in REST API format
                    service_sid
                    Path
                    post sid<IS> Not PII

                    The SID of the Service to update the Member resource in.

                    channel_sid
                    Path
                    post sid_like<CH> Not PII

                    The SID of the Channel the Member resource to update belongs to. This value can be the Channel resource's sid or unique_name.

                    sid
                    Path
                    post sid_like<MB> Not PII

                    The SID of the Member resource to update. This value can be either the Member's sid or its identity value.

                    role_sid
                    Optional
                    post sid<RL> Not PII

                    The SID of the Role to assign to the member. The default roles are those specified on the Service.

                    last_consumed_message_index
                    Optional
                    post integer? Not PII

                    The index of the last Message that the Member has read within the Channel.

                    last_consumption_timestamp
                    Optional
                    post date_time<iso8601> Not PII

                    The ISO 8601 timestamp of the last Message read event for the Member within the Channel.

                    date_created
                    Optional
                    post date_time<iso8601> Not PII

                    The date, specified in ISO 8601 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.

                    date_updated
                    Optional
                    post date_time<iso8601> Not PII

                    The date, specified in ISO 8601 format, to assign to the resource as the date it was last updated.

                    attributes
                    Optional
                    post string PII MTL: 30 DAYS

                    A valid JSON string that contains application-specific data.

                    x_twilio_webhook_enabled
                    Header
                    post ienum:webhook_enabled_type Not PII

                    The X-Twilio-Webhook-Enabled HTTP request header

                    Example 1
                    Loading Code Sample...
                          
                          

                          Update a Member resource

                          Delete a Member resource

                          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.

                          Parameters
                          Parameters in REST API format
                          service_sid
                          Path
                          delete sid<IS> Not PII

                          The SID of the Service to delete the Member resource from.

                          channel_sid
                          Path
                          delete sid_like<CH> Not PII

                          The SID of the Channel the Member resource to delete belongs to. This value can be the Channel resource's sid or unique_name.

                          sid
                          Path
                          delete sid_like<MB> Not PII

                          The SID of the Member resource to delete. This value can be either the Member's sid or its identity value.

                          x_twilio_webhook_enabled
                          Header
                          delete ienum:webhook_enabled_type Not PII

                          The X-Twilio-Webhook-Enabled HTTP request header

                          Example 1
                          Loading Code Sample...
                                
                                

                                Delete a Member resource

                                Rate this page:

                                Need some help?

                                We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                Loading Code Sample...
                                      
                                      
                                      

                                      Thank you for your feedback!

                                      Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      thanks-feedback-gif