All role management endpoints require a valid JWT Bearer token. Unless stated otherwise, the authenticated user must have the Administrator role in the target company.
Default roles
When you create a company, Userverse automatically provisions two roles:| Role | Description |
|---|---|
| Administrator | Full access to manage users and data. |
| Viewer | Read-only access to company data. |
Create a role
Send aPOST request to /company/{company_id}/role.
Unique name for the new role within the company.
Human-readable description of what the role allows.
201 Created with the new role.
Update a role
Send aPATCH request to /company/{company_id}/role/{name}, where {name} is the current name of the role you want to update. Both fields are optional.
New name for the role.
Updated description.
200 OK with the updated role record.
List roles
Send aGET request to /company/{company_id}/roles to retrieve a paginated list of all roles for a company.
| Parameter | Type | Description |
|---|---|---|
name | string | Filter by role name. |
description | string | Filter by role description. |
200 OK with a paginated list of role records.
Delete a role
Send aDELETE request to /company/{company_id}/role. Because deleting a role would leave assigned members without a role, you must provide a replacement role — all users currently assigned the deleted role are automatically reassigned to it.
Name of the role to delete. Cannot be
Administrator or Viewer.Name of an existing role to reassign affected users to.
200 OK confirming the role was deleted and members were reassigned.
Related guides
Company management
Create companies and manage their members.
User management
Register, log in, and update user profiles.