Get user roles
The endpoint returns the list of roles assigned to a user.
HTTP request
GET https://$instanceId.id.nevis.cloud/nevis/api/v1/users/$userId/authorizations
Parameters
Parameter | In | Type | Required / Optional | Description |
---|---|---|---|---|
instanceId | path | string | required | The ID of your Identity Cloud instance |
userId | path | string | required | The ID of the user |
limit | query | integer | optional | The maximum size limit of the token-based pagination results Default 1000 |
continuationToken | query | string | optional | The token to retrieve the next set of the token-based pagination results |
Example request
Set the ID of the user.
userId=your-user-id-123
curl "https://$instanceId.id.nevis.cloud/nevis/api/v1/users/$userId/authorizations?limit=10" \
--header "Authorization: Bearer $accessKey"
HTTP response
On success
HTTP/1.1 200
is returned on success.
Parameter | Type | Description |
---|---|---|
items | array of authorizations | The collection of authorizations |
_pagination | object | The pagination object. For more information, see Token-based pagination. |
Authorization
Parameter | Type | Description |
---|---|---|
role.created | string | The creation date of the role in ISO 8061 timestamp format YYYY-MM-DDThh:mm:ssZ |
role.name | string | The name of the role |
role.description | string | The description of the role |
role.lastModified | string | The last modification date of the role modification in ISO 8061 timestamp format YYYY-MM-DDThh:mm:ssZ |
role.version | integer | The version of the role data, used for optimistic locking |
created | string | The creation date of the authorization in ISO 8061 timestamp format YYYY-MM-DDThh:mm:ssZ |
roleId | string | The identifier of the role |
authorizationId | string | The identifier of the authorization |
Example response
{
"items": [
{
"role": {
"created": "2023-01-05T14:18:48Z",
"name": "Admin",
"description": "Administrator role",
"lastModified": "2023-01-05T14:18:48Z",
"version": 1
},
"created": "2023-01-06T07:18:29Z",
"roleId": "cc000726-b61e-4c4c-88f0-e8b49bdf50a4",
"authorizationId": "60e131a8-5d78-4975-b569-26a1b3b58fcd"
},
{
"role": {
"created": "2023-01-05T14:18:49Z",
"name": "User",
"description": "User role",
"lastModified": "2023-01-05T14:18:49Z",
"version": 1
},
"created": "2023-01-06T07:18:29Z",
"roleId": "test-apps-role",
"authorizationId": "ba1465dc-8169-47c9-83cc-1d7759cdc486"
}
],
"_pagination": {
"limit": 1000,
"continuationToken": "1672989509000_ba1465dc-8169-47c9-83cc-1d7759cdc486"
}
}
On failure
HTTP/1.1 404
is returned if no user is found with the given userId
.
HTTP/1.1 401
is returned if the authorization fails due to an invalid access key.
HTTP/1.1 500
is returned if an unexpected error occurs.