Skip to main content

Roles

Roles are a way to group users together. They can be used to grant permissions to a group of users, or to identify a group of users for other purposes, such as identifying staff members or those who have signed an NDA.

List roles

Returns all role objects.

Authentication

Service Integration with user:read scope.

Response

dataArray of Role (optional)
nullable
The roles that match the search.
Show child attributes
idstring
The unique identifier of the role.
namestring
The unique name of the role.
nextPagestring (optional)
nullable
A cursor for pagination across multiple pages of results. If this attribute is present, there are more results available. Use this value in the nextPage parameter for the next request.
GET /api/v0/rolescURL
curl https://reg.cces.dev/api/v0/roles \
-H "Authorization: Bearer <token>"
Responseapplication/json
{
"data": [
{
"id": "1234",
"name": "staff"
},
],
"nextPage": null
}

List user roles

List the roles given to the specified user.

Authentication

Service Integration with user:read scope.

Response

dataArray of UserRole (optional)
nullable
The roles of the user.
Show child attributes
idstring
The unique identifier of the role.
namestring
The name of the role.
scopestring
Whatever the role was given to the user globally, or just for the current convention.
GET /api/v0/users/:userId/rolesJSON
{
"data": [
{
"id": "1234",
"name": "admin",
"scope": "global",
}
]
}

Add role to an user

Gives the user the specified role. This request will fail if the user already has the role.

Authentication

Service Integration with user:roles:update scope.

Request

scopestring
Required
Whatever the role will be given to the user for the current convention, or across all conventions in the organization. Values can be "convention" or "global".
PUT /api/v0/users/:userId/roles/:roleIdJSON
{
"scope": "convention"
}

Remove role from an user

Removes the user from the specified role. This request will fail if the user is not in the role.

Authentication

Service Integration with user:roles:update scope.
DELETE /api/v0/users/:userId/roles/:roleId