Skip to main content

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

ParameterInTypeRequired / OptionalDescription
instanceIdpathstringrequiredThe ID of your Identity Cloud instance
userIdpathstringrequiredThe ID of the user
limitqueryintegeroptionalThe maximum size limit of the token-based pagination results Default 1000
continuationTokenquerystringoptionalThe 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.

ParameterTypeDescription
itemsarray of authorizationsThe collection of authorizations
_paginationobjectThe pagination object. For more information, see Token-based pagination.

Authorization

ParameterTypeDescription
role.createdstringThe creation date of the role in ISO 8061 timestamp format YYYY-MM-DDThh:mm:ssZ
role.namestringThe name of the role
role.descriptionstringThe description of the role
role.lastModifiedstringThe last modification date of the role modification in ISO 8061 timestamp format YYYY-MM-DDThh:mm:ssZ
role.versionintegerThe version of the role data, used for optimistic locking
createdstringThe creation date of the authorization in ISO 8061 timestamp format YYYY-MM-DDThh:mm:ssZ
roleIdstringThe identifier of the role
authorizationIdstringThe 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.