Menu

Flex Conversations Roles

Flex Conversations use Conversations API roles to manage participant permissions when adding participants to a Conversation or when using the Conversations SDK to connect.

The Role Resource represents what a User (e.g. agent, admin, supervisor) can do within the Conversation Service and individual Conversations. Roles are scoped to either a Service or a Conversation.

Flex Conversation Service

Users are assigned a Role at the Service level. This determines what they can do within the Conversation Service instance, such as creating and destroying 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 inviting Participants to be members of the Conversation, posting Messages, and removing other Participants from the Conversation.

Which Roles does Flex create out-of-the-box?

Flex creates the Conversation Service and adds the following Service and Conversation Roles during the initial Flex account setup.

Service Roles

Role Default Permissions
admin
  • joinConversation
  • deleteConversation
  • addParticipant
  • removeParticipant
  • editConversationAttributes
  • editOwnUserInfo
  • editAnyUserInfo
supervisor
  • joinConversation
  • addParticipant
  • removeParticipant
  • editOwnUserInfo

Conversation Roles

Role Default Permissions
guest [DEFAULT]
  • sendMessage
  • sendMediaMessage
agent
  • editConversationAttributes
  • sendMessage
  • sendMediaMessage
  • leaveConversation
  • editOwnMessage
  • editOwnMessageAttributes
  • deleteOwnMessage
admin
  • editConversationAttributes
  • sendMessage
  • sendMediaMessage
  • leaveConversation
  • editOwnMessage
  • editOwnMessageAttributes
  • deleteOwnMessage
  • editAnyMessage
  • editAnyMessageAttributes
  • deleteAnyMessage
supervisor
  • editConversationAttributes
  • sendMessage
  • sendMediaMessage
  • leaveConversation
  • editOwnMessage
  • editOwnMessageAttributes
  • deleteOwnMessage
  • editAnyMessage
  • editAnyMessageAttributes
  • deleteAnyMessage

How does Flex use these Roles?

The first time a worker logs in, Flex creates a corresponding Conversation User.

  • For workers authenticating through the Twilio Console, the corresponding Flex Conversation Service User will be created with the admin role.
  • For workers authenticating via a third-party IdP (identity provider), Flex creates a corresponding Conversation Service User according to their SSO role: agent, supervisor, or admin.

Once a worker logs in successfully, the Flex UI initializes the Conversations SDK with a token that includes the grants:

  • The token includes Flex Roles grants based on the user role (agent/supervisor/admin) that is set in the IdP.
  • The Conversation User Service Role is updated (in the Conversations Users database) based on the Flex Role grants (an agent can be promoted to a supervisor, or vice versa).

Known limitation

Regardless of what role you have as a Flex user, Flex Conversations uses the default configured role which is "guest" when adding the user to a Conversation or Chat Task.

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.

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