Ask
Type to search
Endpoints

Roles

Roles as the core part of Vrite’s Role-Based Access Control (RBAC) model, help you manage users and their permissions in a workspace. With the API you can create and manage available roles.

Retrieve Role

Retrieves details of the role specified by ID.

GET
/roles
Query Parameters
idstring

ID of the role

Response object
idstring

ID of the role

namestring

Name of the role

descriptionstring

Description of the role

permissionsstring[]

Permissions assigned to the role

baseTypestring

Type of the base role

vieweradmin

Request
Response
{
  "id": "62c23534d77c31b2e067f5dc",
  "name": "string",
  "description": "string",
  "permissions": [
    "editContent"
  ],
  "baseType": "viewer"
}

List Roles

Lists existing roles. Supports pagination.

GET
/roles/list
Query Parameters
perPagenumber
20

Number of roles per page

pagenumber
1

Page number to fetch

lastIdstring

Last role ID to start fetching roles from

Response object[]
idstring

ID of the role

namestring

Name of the role

descriptionstring

Description of the role

permissionsstring[]

Permissions assigned to the role

baseTypestring

Type of the base role

vieweradmin

Request
Response
[
  {
    "id": "ea8522a23602d1511c6aa164",
    "name": "string",
    "description": "string",
    "permissions": [
      "editContent"
    ],
    "baseType": "viewer"
  }
]

Create Role

Creates a role with the specified name, description, and permissions set.

POST
/roles
Body Parameters
namestring
Required

Name of the role

descriptionstring

Description of the role

permissionsstring[]
Required

Permissions assigned to the role

Response object
idstring

ID of the role

Request
Response
{
  "id": "3bbab29594c80288094e35c0"
}

Update Role

Updates the name, description, and permissions of the role matched by ID, using the provided data.

PUT
/roles
Body Parameters
idstring
Required

ID of the role

namestring

Name of the role

descriptionstring

Description of the role

permissionsstring[]

Permissions assigned to the role

Response 200
Request

Delete Role

Deletes the role specified by ID. Any member of the workspace that was assigned this role will be converted to the base Viewer role.

DELETE
/roles
Query Parameters
idstring
Required

ID of the role

Response 200
Request