In Twilio Conversations, the Role Resource represents what a User can do within the Service and individual Conversations. Roles are scoped to either a Service or a Conversation.
Users are assigned a Role at the Service level. This determines what they can do within the chat Service instance, such as create and destroy Conversations within the Service.
Participants are assigned a Role at the Conversation level. This determines what they are able to do within a particular Conversation, such as invite Participants to be members of the Conversation, post Messages, and remove other Participants from the Conversation.
See Permission Values for information about the permissions that can be assigned in each scope.
Do not use Personally Identifiable Information (PII) for the friendlyName field.
Avoid using a person's name, home address, email, phone number, or other PII in the friendlyName
field. Use some form of pseudonymized identifier, instead.
You can learn more about how we process your data in our privacy policy.
All URLs in the reference documentation use the following base URL:
_10https://conversations.twilio.com/v1
Using the REST API, you can interact with Role resources in the default Conversation Service instance via a "shortened" URL that does not include the Conversation Service instance SID ("ISXXX..."). If you are only using one Conversation Service (the default), you do not need to include the Conversation Service SID in your URL, e.g.
_10GET /v1/Roles/
For Conversations applications that build on more than one Conversation Service instance, you will need to specify the Conversation Service SID in the REST API call.
_10GET /v1/Services/<Service SID, ISXXX...>/Roles/
Each Role resource contains these properties.
The SID of the Conversation Service the Role resource is associated with.
The type of role. Can be: conversation
for Conversation roles or service
for Conversation Service roles.
conversation
service
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
An absolute API resource URL for this user role.
POST https://conversations.twilio.com/v1/Roles
A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
The type of role. Can be: conversation
for Conversation roles or service
for Conversation Service roles.
conversation
service
A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's type
.
GET https://conversations.twilio.com/v1/Roles/{Sid}
GET https://conversations.twilio.com/v1/Roles
How many resources to return in each list page. The default is 50, and the maximum is 1000.
POST https://conversations.twilio.com/v1/Roles/{Sid}
A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's type
.
DELETE https://conversations.twilio.com/v1/Roles/{Sid}
These are the available permissions
entries for roles where type
= service.
Permission | Enables User to: |
---|---|
addParticipant | Add other users as Participants of a Conversation |
createConversation | Create new Conversations |
deleteAnyMessage | Delete any Message in the Service |
deleteConversation | Delete Conversations |
editAnyMessage | Edit any Message in the Service |
editAnyMessageAttributes | Edit any Message attributes in the Service |
editAnyUserInfo | Edit other User's User Info properties |
editConversationAttributes | Update the optional attributes metadata field on a Conversation |
editConversationName | Change the name of a Conversation |
editOwnMessage | Edit their own Messages in the Service |
editOwnMessageAttributes | Edit the own Message attributes in the Service |
editOwnUserInfo | Edit their own User Info properties |
joinConversation | Join Conversations |
removeParticipant | Remove Participants from a Conversation |
These are the available permissions
entries for roles where type
= conversation.
Permission | Enables User to: |
---|---|
addParticipant | Add other users as Participants of a Conversation |
deleteAnyMessage | Delete any Message in the Service |
deleteOwnMessage | Delete their own Messages in the Service |
deleteConversation | Delete Conversations |
editAnyMessage | Edit any Message in the Service |
editAnyMessageAttributes | Edit any Message attributes in the Service |
editAnyUserInfo | Edit other User's User Info properties |
editConversationAttributes | Update the optional attributes metadata field on a Conversation |
editConversationName | Change the name of a Conversation |
editOwnMessage | Edit their own Messages in the Service |
editOwnMessageAttributes | Edit the own Message attributes in the Service |
editOwnUserInfo | Edit their own User Info properties |
leaveConversation | Leave a Conversation |
removeParticipant | Remove Participants from a Conversation |
sendMediaMessage | Send media Messages to Conversations |
sendMessage | Send Messages to Conversations |