Custom Roles in the Digital Samba Developer API: A How-To Guide
Digital Samba comes with three predefined roles – Moderator, Speaker and Attendee – and when those don't quite fit your event, the developer API lets you build custom roles of your own. A custom role is a named set of permissions, so you decide exactly what each group of participants can do inside the room. This guide shows how to create, edit, list and delete custom roles with the Digital Samba API, with working code samples and the full list of permissions you can combine.
Table of Contents- What are custom roles?
- Permissions you can configure
- Benefits of custom roles
- Using and managing custom roles in Digital Samba's API
- Creating roles
- Editing existing roles
- Listing existing roles
- Deleting a role
- Frequently asked questions
What are custom roles?
A role in Digital Samba is a named set of permissions. Every participant joins a room with a role, and that role controls which actions they are allowed to perform – using the microphone, sharing a screen, starting a recording, removing other participants and so on.
Your team gets three predefined roles out of the box:
- Moderators – the owners of the meeting, allowed to do everything inside the room.
- Speakers – the presenters. By default they can turn on their camera and microphone and share their screen, but they can't, for example, remove participants from the meeting.
- Attendees – the audience. They watch what is being presented and can raise their hand to ask to speak, but a moderator needs to approve the request.
These cover most moderated meetings and webinars, but some events need finer control. Custom roles let you blend permissions into exactly the combination you need: give assistants some moderator powers but not all, or stop speakers from removing guests. You can create as many custom roles as you need and configure them per room. If you prefer working in a browser, you can also create and manage custom roles in the Digital Samba dashboard instead of the API.
Permissions you can configure
Each permission switches one action on or off for the role. Some permissions are role-sensitive, which means you can restrict them to a specific set of target roles. For example, you may want a Speaker to be able to mute an Attendee, but not a Moderator – you simply list the roles the permission applies to. If you set a role-sensitive permission to true instead of an array, it applies to all current and future roles.
Here is the full list of permission names from the permissions documentation, grouped by what they control.
Media and broadcasting
- broadcast – use their camera and microphone
- manage_broadcast – give and remove broadcast permission and lower raised hands (role-sensitive)
- screenshare – share their screen's video and audio
- manage_screenshare – give and remove screenshare permission (role-sensitive)
- remote_muting – remotely mute participants or turn off their camera (role-sensitive)
- ask_remote_unmute – ask participants to unmute or turn on their camera (role-sensitive)
- raise_hand – raise their hand to request broadcast permission or take turns to speak
Session and room control
- start_session – start sessions
- end_session – end the session for everyone
- control_room_entry – admit or reject participants waiting to enter the room
- invite_participant – invite participants into the session
- remove_participant – remove participants from the session (role-sensitive)
- recording – start and stop recordings
- transcribe_session – start and stop transcription for a live session
- control_room_components – enable or disable room components such as chat, Q&A and the whiteboard while a session is running
Chat and participants
- general_chat – chat openly in the general chat
- private_chat – chat privately one-to-one with other participants
- see_participants_panel – see the participants panel and receive join and leave notifications
- manage_roles – move participants between roles (role-sensitive)
Collaboration and engagement
- edit_whiteboard – draw and edit on the whiteboard
- manage_edit_whiteboard – give and remove whiteboard editing permission (role-sensitive)
- manage_breakout – start and stop breakout rooms and assign participants to them
- present_files – open files so other participants can see the slides
- answer_qa – answer questions in Q&A
- moderate_qa – delete questions and answers of other participants
- upvote_qa – upvote questions
- manage_polls – create, edit, start, end and share polls
- take_polls – vote in polls
Benefits of custom roles
Custom roles give organisers precise control over what each group can and cannot do within an event. You might allow some attendees to share their screens while limiting chat for others, which keeps sessions running smoothly and reduces disruptions.
They also let you match permissions to the event format. A webinar, a company town hall, an academic conference and an online workshop each ask different things of their speakers and audience, and a custom role can reflect that instead of forcing everyone into the same three defaults.
Finally, roles are a planning tool. Because you decide who can do what before the session starts, you can prevent predictable problems – an open microphone in a large webinar, say – rather than reacting to them live. Setting up personalised roles takes a little effort, but it gives you far more control than the out-of-the-box options.
Using and managing custom roles in Digital Samba's API
All role management happens on the /roles endpoint of the REST API. The examples below authenticate with HTTP Basic Authentication, passing your team ID as the username and your developer key as the password – you'll find both in the dashboard after signing up. In this section, we'll create, edit, list and delete a role.
Creating roles
To create a new role, send a POST request to the /roles endpoint.
Include these fields:
- name – unique internal name to reference the role in rooms and tokens
- display_name – the name people will see in the participants list
- permissions – a JSON object with the allowed permissions set to true. For role-sensitive permissions like remote_muting, you can instead pass an array of the role names this role may act on – for example, let a Speaker mute Attendees but not Moderators. If you just put true, the role can act on all current and future roles.
- description (optional) – an explanation of the role
Here's a sample POST request for role creation:
curl --request POST \
--header "Content-Type: application/json" \
--url https://api.digitalsamba.com/api/v1/roles \
--user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY \
--data '{
"name": "custom",
"display_name": "Custom",
"permissions": {
"start_session": true,
"remote_muting": ["speaker", "attendee"],
"raise_hand": true
}
}'
Response (200 OK)
{
"id": "2d9448b9-d9ee-4102-b31a-f83ab4af2af8",
"name": "custom",
"display_name": "Custom",
"description": null,
"default": false,
"created_at": "2023-03-24T13:32:05Z",
"updated_at": "2023-03-27T13:46:22Z",
"permissions": {
"ask_remote_unmute": false,
"broadcast": false,
"end_session": false,
"general_chat": false,
"manage_broadcast": false,
"manage_roles": false,
"manage_screenshare": false,
"raise_hand": true,
"recording": false,
"remote_muting": [
"speaker",
"attendee"
],
"remove_participant": false,
"screenshare": false,
"start_session": true
}
}
Note: Creating a role does not assign it to any rooms automatically. You specify the available roles for a room when you create it – see our guide on how to configure your room defaults in Digital Samba using the developer API. If all your rooms use the same roles, it's easier to set default roles in team settings, and all rooms will inherit them – here's how to configure your team settings with the Digital Samba developer API.
Editing existing roles
To edit an existing role, make a PATCH request to /roles/:idOrName. You can use either the role's ID or its name in the URL path – the name is more human-readable, and you'll find both in the response when creating a role.
You can update as many fields as you want.
This example changes the display name and grants the general chat permission:
curl --request PATCH \
--header "Content-Type: application/json" \
--url https://api.digitalsamba.com/api/v1/roles/2d9448b9-d9ee-4102-b31a-f83ab4af2af8 \
--user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY \
--data '{
"display_name": "CustomEdited",
"permissions": {
"general_chat": true
}
}'
The response contains the updated role with the changes applied:
{
"id": "2d9448b9-d9ee-4102-b31a-f83ab4af2af8",
"name": "custom",
"display_name": "CustomEdited",
"description": null,
"default": false,
"created_at": "2023-03-24T13:32:05Z",
"updated_at": "2023-03-27T15:38:14Z",
"permissions": {
"ask_remote_unmute": false,
"broadcast": false,
"end_session": false,
"general_chat": true,
"manage_broadcast": false,
"manage_roles": false,
"manage_screenshare": false,
"raise_hand": true,
"recording": false,
"remote_muting": [
"speaker",
"attendee"
],
"remove_participant": false,
"screenshare": false,
"start_session": true
}
}
Editing a role changes what it allows for everyone who holds it, in every room where it's used. If you only need to change one participant's capabilities during a session, you can dynamically modify roles using the Digital Samba SDK instead.
Listing existing roles
To see your existing roles, send a GET request to the /roles endpoint. Since there could be many roles, pagination is supported using the limit, order and after parameters – read the pagination docs to learn more. By default, a maximum of 100 roles is returned per request.
Example request (list all roles):
curl --request GET \ --url https://api.digitalsamba.com/api/v1/roles \ --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY
Example response (200 OK):
{
"total_count": 126,
"data": [
{
"id": "2d9448b9-d9ee-4102-b31a-f83ab4af2af8",
"name": "custom",
"display_name": "Custom",
"description": null,
"default": false,
"created_at": "2023-03-24T13:32:05Z",
"updated_at": "2023-03-27T13:46:22Z"
},
...............99 more roles...............
]
}
Note: The total_count is the total number of roles globally, not just the number of roles returned in the data array for that page. For example, if there are 126 total roles but a limit of 100 per page, the total_count would show 126 but the data array would only contain 100 roles.
Example request (get one role's details):
curl --request GET \ --url https://api.digitalsamba.com/api/v1/roles/2d9448b9-d9ee-4102-b31a-f83ab4af2af8 \ --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY
Example response (200 OK):
{
"id": "2d9448b9-d9ee-4102-b31a-f83ab4af2af8",
"name": "custom",
"display_name": "CustomEdited",
"description": null,
"default": false,
"created_at": "2023-03-24T13:32:05Z",
"updated_at": "2023-03-27T15:38:14Z",
"permissions": {
"ask_remote_unmute": false,
"broadcast": false,
"end_session": false,
"general_chat": true,
"manage_broadcast": false,
"manage_roles": false,
"manage_screenshare": false,
"raise_hand": true,
"recording": false,
"remote_muting": [
"speaker",
"attendee"
],
"remove_participant": false,
"screenshare": false,
"start_session": true
}
}
Deleting a role
To delete an existing role, send a DELETE request to the /roles/:idOrName endpoint. As with editing, you can use either the role's name or its ID in the request.
Note: Role deletion is a destructive operation which cannot be undone. You are not allowed to delete roles that are currently being used in a live session, and you cannot delete roles that are set as default roles in rooms.
Example request (deletes role 2d9448b9-d9ee-4102-b31a-f83ab4af2af8):
curl --request DELETE \ --url https://api.digitalsamba.com/api/v1/roles/2d9448b9-d9ee-4102-b31a-f83ab4af2af8 \ --user YOUR_TEAM_ID:YOUR_DEVELOPER_KEY
Response (204 – No Content)
The response body is empty because the role was deleted successfully, and there is no content to return.
Frequently asked questions
What is the difference between predefined and custom roles in Digital Samba?
Predefined roles – Moderator, Speaker and Attendee – come with every team and cover typical moderated meetings and webinars. Custom roles are permission sets you define yourself when the defaults don't match your event, such as a co-host who can mute attendees but can't end the session. Both kinds are assigned to rooms and participants in the same way.
How do participants get a custom role?
You reference the role by its internal name when configuring a room's available roles and when generating tokens for participants to join. You can also set default roles in team settings so every room inherits them.
What does role-sensitive permission mean?
A role-sensitive permission can be limited to a specific set of target roles rather than applying to everyone. For example, you can allow a Speaker to remove Attendees from a session but not Moderators. If you set the permission to true instead of listing target roles, it applies to all current and future roles.
Can I delete a role that is currently in use?
No. Roles that are being used in a live session cannot be deleted, and neither can roles set as default roles in rooms. Deletion is also permanent – there is no way to restore a deleted role, so check with a GET request first if you're unsure.
Do I need to write code to manage roles in Digital Samba?
No. If you prefer a visual interface, you can create and manage custom roles in the Digital Samba dashboard with the same permissions. The API is handy when you want to automate role management or keep it inside your own platform's code.
Conclusion
Custom roles in the Digital Samba developer API let you decide exactly who can broadcast, moderate, record, present and chat in your video sessions. With 28 permissions to combine – from screensharing to polls, Q&A and breakout rooms – you can build roles that fit your webinars, classes and meetings rather than bending your event around generic defaults. Create them once, set them as defaults in your team settings, and every room you spin up will behave the way you planned.
Share this
You May Also Like
These Related Stories

How to Configure Your Team Settings with the Digital Samba Developer API

How to use custom roles in Digital Samba Dashboard

