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.
The User resource of Programmable Chat represents a single user who is identified by an
identity
value that you provide when the User resource is created. The User resource's identity
must be unique within its Service instance.
Within Twilio Programmable Chat, the user identity
is a case-sensitive value.
We recommend following the standard URI specification and avoid the following reserved characters ! * ' ( ) ; : @ & = + $ , / ? % # [ ]
for values such as identity and friendly name.
User resources are used to assign permissions, which determine what the user can and cannot do within the service.
Users can be created within a Service instance by using the client capability token or the User resource's Create action.
When Programmable Chat encounters a new Identity in a Service instance, a new User instance is created for that identity. When an Identity exists, its corresponding User record will be used the session/request for endpoints, Access Tokens, and when the REST API is used to create a Member resource.
The User resource contains these properties.
sid
type: SID<US>The unique string that we created to identify the User resource.
^US[0-9a-fA-F]{32}$
34
34
account_sid
type: SID<AC>The SID of the Account that created the User resource.
^AC[0-9a-fA-F]{32}$
34
34
service_sid
type: SID<IS>The SID of the Service the User resource is associated with.
^IS[0-9a-fA-F]{32}$
34
34
attributes
type: stringThe JSON string that stores application-specific data. If attributes have not been set, {}
is returned.
role_sid
type: SID<RL>identity
type: stringThe application-defined string that uniquely identifies the resource's User within the Service. This value is often a username or an email address, and is case-sensitive. See access tokens for more info.
is_online
type: booleanWhether the User is actively connected to the Service instance and online. This value is only returned by Fetch actions that return a single resource and null
is always returned by a Read action. This value is null
if the Service's reachability_enabled
is false
, if the User has never been online for the Service instance, even if the Service's reachability_enabled
is true
.
is_notifiable
type: booleanWhether the User has a potentially valid Push Notification registration (APN or GCM) for the Service instance. If at least one registration exists, true
; otherwise false
. This value is only returned by Fetch actions that return a single resource and null
is always returned by a Read action. This value is null
if the Service's reachability_enabled
is false
, and if the User has never had a notification registration, even if the Service's reachability_enabled
is true
.
date_created
type: string<date-time>The date and time in GMT when the resource was created specified in ISO 8601 format.
date_updated
type: string<date-time>The date and time in GMT when the resource was last updated specified in ISO 8601 format.
links
type: object<uri-map>POST https://chat.twilio.com/v2/Services/{ServiceSid}/Users
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
ServiceSid
type: SID<IS>The SID of the Service to create the User resource under.
^IS[0-9a-fA-F]{32}$
34
34
Identity
type: stringRequiredThe identity
value that uniquely identifies the new resource's User within the Service. This value is often a username or email address. See the Identity documentation for more info.
RoleSid
type: SID<RL>The SID of the Role to assign to the new User.
^RL[0-9a-fA-F]{32}$
34
34
FriendlyName
type: stringA descriptive string that you create to describe the new resource. This value is often used for display purposes.
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Users/{Sid}
The {Sid}
value can be either the sid
or the identity
of the User resource to fetch.
ServiceSid
type: SID<IS>The SID of the Service to fetch the User resource from.
^IS[0-9a-fA-F]{32}$
34
34
Sid
type: stringThe SID of the User resource to fetch. This value can be either the sid
or the identity
of the User resource to fetch.
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Users
ServiceSid
type: SID<IS>The SID of the Service to read the User resources from.
^IS[0-9a-fA-F]{32}$
34
34
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Page
type: integerThe page index. This value is simply for client state.
0
POST https://chat.twilio.com/v2/Services/{ServiceSid}/Users/{Sid}
The {Sid}
value can be either the sid
or the identity
of the User resource to update.
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
ServiceSid
type: SID<IS>The SID of the Service to update the User resource in.
^IS[0-9a-fA-F]{32}$
34
34
Sid
type: stringThe SID of the User resource to update. This value can be either the sid
or the identity
of the User resource to update.
RoleSid
type: SID<RL>FriendlyName
type: stringA descriptive string that you create to describe the resource. It is often used for display purposes.
DELETE https://chat.twilio.com/v2/Services/{ServiceSid}/Users/{Sid}
The {Sid}
value can be either the sid
or the identity
of the User resource to delete.
ServiceSid
type: SID<IS>The SID of the Service to delete the User resource from.
^IS[0-9a-fA-F]{32}$
34
34
Sid
type: stringThe SID of the User resource to delete. This value can be either the sid
or the identity
of the User resource to delete.