Create a new user role in your service
A Service Role resource represents a set of permissions granted to a user within a service or a conversation.
Create a new user role in your service
Path parameters
-
The SID of the Conversation Service to create the Role resource under.
Body
-
A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
-
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
. -
The type of role. Can be:
conversation
for Conversation roles orservice
for Conversation Service roles.Values are
conversation
orservice
.
POST /v1/Services/{ChatServiceSid}/Roles
curl \
-X POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Roles \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'FriendlyName=string&Permission=string&Type=conversation'
Request example
{
"FriendlyName": "string",
"Permission": [
"string"
],
"Type": "conversation"
}
Request examples
{
"FriendlyName": "string",
"Permission": [
"string"
],
"Type": "conversation"
}
Response examples (201)
{
"account_sid": "string",
"chat_service_sid": "string",
"date_created": "2023-05-04T09:42:00+00:00",
"date_updated": "2023-05-04T09:42:00+00:00",
"friendly_name": "string",
"permissions": [
"string"
],
"sid": "string",
"type": "conversation",
"url": "https://example.com"
}
Response examples (201)
{
"account_sid": "string",
"chat_service_sid": "string",
"date_created": "2024-05-04T09:42:00+00:00",
"date_updated": "2024-05-04T09:42:00+00:00",
"friendly_name": "string",
"permissions": [
"string"
],
"sid": "string",
"type": "conversation",
"url": "https://example.com"
}