Get all authorization codes

GET
/api/users/[user_id]/grants/codes
Retrieves a paginated list of authorization codes for a specific user.

Query Parameters

page
number

The page number to retrieve.

Default:
1
size
number

The number of items per page.

Default:
10
client_id
string

The client ID by which the grants should be filtered.

session_id
string

The session ID by which the grants should be filtered.

sort
string

Specifies the sort criteria in the 'sort_key:sort_order' format. The sort order value can be '1' for ascending and '-1' for descending. Acceptable sort key values are 'creation_time' and 'expiration'.

Path Parameters

user_id
string
Required

The ID of the user whose authorization codes should be retrieved.

Authentication

API-Key
header
Required

The API key is essential for accessing MonoCloud's APIs. You can find it in the Tenant Settings section of your MonoCloud dashboard. To authenticate your requests, include this key in the request header using the following format: X-API-Key: <Your_API_Key>.

Headers

accept
string
  • application/json
  • application/problem+json

Responses

200
Successfully retrieved user's authorization codes
400
Bad Request
422
Client Error
404
Not Found
401
Unauthorized
403
Forbidden

Request Example

Request
curl -X GET "https://<your-domain>/api/users/{user_id}/grants/codes?page=1&size=10&client_id=eCOGRJYpnNwwAAuCeReEW&session_id=242C561E376849F04010F88A5EE3C191&sort=creation_time:1" \
 -H "X-API-KEY: <your-api-key>" \
 -H "Accept: application/json"

Response Example

Response
200 OK
[
  {
    "creation_time": 1640975400,
"authorized_scopes": [ "openid", "profile", "email"
], "session_id": "96484D319ACC21380CCE026E54807B4D", "expiration": 1640975400, "id": "HxI56Ol4FjIyUXZBJ6J24", "client_id": "eCOGRJYpnNwwAAuCeReEW" } ]