Skip to Content
New release 12 available 🎉

Roles

GET/v1/rolesGET /v1/roles

Code samples

# You can also use wget curl -X GET /v1/roles \ -H 'Accept: text/plain' \ -H 'x-api-key: API_KEY'

GET /v1/roles

Retrieves roles based on the provided request.

Parameters

NameInTypeRequiredDescription
selectquerystringfalsenone
filterquerystringfalsenone
sortquerystringfalsenone
takequeryinteger(int32)falsenone
skipqueryinteger(int32)falsenone

Example responses

200 Response

{"success":true,"code":0,"message":"string","roles":[{"id":"string","name":"string","description":"string"}],"totalRolesCount":0}
{ "success": true, "code": 0, "message": "string", "roles": [ { "id": "string", "name": "string", "description": "string" } ], "totalRolesCount": 0 }

Responses

StatusMeaningDescriptionSchema
200OK OKManagement.GetRolesResponse

Authentication: API key (x-api-key).

GET/v1/users/{userId}/rolesGET /v1/users/{userId}/roles

Code samples

# You can also use wget curl -X GET /v1/users/{userId}/roles \ -H 'Accept: text/plain' \ -H 'x-api-key: API_KEY'

GET /v1/users/\{userId\}/roles

Retrieves the roles of a specific user based on the provided request.

Parameters

NameInTypeRequiredDescription
userIdpathstringtrueThe user ID.
selectquerystringfalsenone
filterquerystringfalsenone
sortquerystringfalsenone
takequeryinteger(int32)falsenone
skipqueryinteger(int32)falsenone

Example responses

200 Response

{"success":true,"code":0,"message":"string","roles":[{"id":"string","name":"string","description":"string"}],"totalRolesCount":0}
{ "success": true, "code": 0, "message": "string", "roles": [ { "id": "string", "name": "string", "description": "string" } ], "totalRolesCount": 0 }

Responses

StatusMeaningDescriptionSchema
200OK OKManagement.GetUserRolesResponse

Authentication: API key (x-api-key).

POST/v1/users/{userId}/rolesPOST /v1/users/{userId}/roles

Code samples

# You can also use wget curl -X POST /v1/users/{userId}/roles \ -H 'Content-Type: application/json-patch+json' \ -H 'Accept: text/plain' \ -H 'x-api-key: API_KEY'

POST /v1/users/\{userId\}/roles

Adds a user to the specified roles.

Body parameter

{ "roles": "string" }

Parameters

NameInTypeRequiredDescription
userIdpathstringtrueThe user ID.
bodybodyManagement.AddUserToRoleRequestfalseThe request containing the user ID and the roles to add.

Example responses

200 Response

{"success":true,"code":0,"message":"string"}
{ "success": true, "code": 0, "message": "string" }

Responses

StatusMeaningDescriptionSchema
200OK OKManagement.AddUserToRoleResponse

Authentication: API key (x-api-key).

DELETE/v1/users/{userId}/rolesDELETE /v1/users/{userId}/roles

Code samples

# You can also use wget curl -X DELETE /v1/users/{userId}/roles \ -H 'Content-Type: application/json-patch+json' \ -H 'Accept: text/plain' \ -H 'x-api-key: API_KEY'

DELETE /v1/users/\{userId\}/roles

Removes a user from the specified roles.

Body parameter

{ "roles": "string" }

Parameters

NameInTypeRequiredDescription
userIdpathstringtrueThe user ID.
bodybodyManagement.RemoveUserFromRoleRequestfalseThe request containing the user ID and the roles to remove.

Example responses

200 Response

{"success":true,"code":0,"message":"string"}
{ "success": true, "code": 0, "message": "string" }

Responses

StatusMeaningDescriptionSchema
200OK OKManagement.RemoveUserFromRoleResponse

Authentication: API key (x-api-key).

Last updated on