Get all user's groups

GET
/api/users/[user_id]/groups
Retrieves a paginated list of groups that the specified user is assigned to.

Query Parameters

page
number

The page number to retrieve.

Default: 1
size
number

The number of items per page.

Default: 10
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. The acceptable sort key is 'creation_time'.

Path Parameters

user_id
string
Required

The ID of the user whose group assignments should be retrieved.

Authentication

X-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 group assignments
404
Not Found
422
Client Error
401
Unauthorized
403
Forbidden

Request Example

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

Response Example

Response
200 OK
[
  {
    "creation_time": 1640975400,
    "group_id": "70b712ac-d96d-476b-b39b-249ad11de1a2",
    "user_id": "UOtBaOybB6dTpIJNrnkRw",
    "group_name": "Administrators"
  }
]