ConversationsRole

Create Service Role

POST
/v1/Services/{ChatServiceSid}/Roles

Create a new user role in your service

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Path Parameters

ChatServiceSid*string

The SID of the Conversation Service to create the Role resource under.

Match^IS[0-9a-fA-F]{32}$
Length34 <= length <= 34

Request Body

application/x-www-form-urlencoded

FriendlyName*string

A descriptive string that you create to describe the new resource. It can be up to 64 characters long.

Type*ServiceRoleRoleType

The type of role. Can be: conversation for Conversation roles or service for Conversation Service roles.

Value in

  • "conversation"
  • "service"
Permission*array<string>

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.

Response Body

application/json

curl -X POST "https://example.com/v1/Services/stringstringstringstringstringstri/Roles" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'FriendlyName=Conversation+Role&Type=conversation&Permission=sendMessage'
{  "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "friendly_name": "Conversation Role",  "type": "conversation",  "permissions": [    "sendMessage",    "leaveConversation",    "editOwnMessage",    "deleteOwnMessage"  ],  "date_created": "2016-03-03T19:47:15Z",  "date_updated": "2016-03-03T19:47:15Z",  "url": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}