Users and Usage Statistics API
This document details the public API endpoints for managing user accounts and retrieving system-wide usage statistics. These tools allow you to integrate user data into your applications and monitor environment activity.
For documentation regarding the v1 versions, please refer to the User v1 and User Information v1 guides.
Core Resource Path
The primary path for user-related resources is:
api/v2/users
Endpoints
| URL | HTTP Method | Description |
|---|---|---|
/users |
GET | Retrieves a list of users. Supports query parameters such as limit for pagination. See Example 2 |
/users/{userId} |
GET | Retrieves all the details of a specific user by their ID. See Example 3 |
/usage-statistics/active-users |
GET | Returns the count of currently active users to monitor environment size. See Example 1 |
Examples
The following examples use curl. Ensure you replace {userId}, {limit}, and [Main API Domain] with your actual environment data. Most requests require a valid Bearer token and an environment-id.
Example 1: Getting Active Users Count
Check for the current users that are active.
Request:
curl -X GET "[Main API Domain]/api/v2/usage-statistics/active-users" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "environment-id: YOUR_ENVIRONMENT_ID"
Response:
{
"status": "ok",
"data": {
"activeUsers": 2
}
}
Example 2: Listing Users with a Limit
Use the limit query parameter to manage large datasets via pagination.
Request:
curl -X GET "[Main API Domain]/api/v2/users?limit=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "environment-id: YOUR_ENVIRONMENT_ID"
Response:
{
"status": "ok",
"data": [
{
"_id": "68303113fa82b1ec8b3d7c14",
"username": "testuser@example.com",
"profile": { ... },
"_createdOn": "2025-05-23T08:25:55.991Z"
}
],
"pagination": {
"hasPrevious": false,
"hasNext": true,
"next": "limit=1&after=68303113fa82b1ec8b3d7c14"
}
}
Example 3: Getting Details for a Specific User
Retrieve the complete object for a single user by providing their unique ID.
Request:
curl -X GET "[Main API Domain]/api/v2/users/68303113fa82b1ec8b3d7c14" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "environment-id: YOUR_ENVIRONMENT_ID"
Response:
{
"status": "ok",
"data": [
{
"_id": "68303113fa82b1ec8b3d7c14",
"username": "testuser@example.com",
"profile": { ... },
"_lastModifiedOn": "2025-05-23T08:25:55.992Z"
}
]
}