User Usage Statistics
Get API usage statistics aggregated at the user level. Useful for billing and monitoring.
Get User Usage
Get usage summary for a specific user account.
Request
http
GET /v1/admin/users/:id/usage
Authorization: Bearer {admin_key}Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
start_date | ISO 8601 | 30 days ago | Start of period |
end_date | ISO 8601 | Now | End of period |
Example
bash
curl -X GET "https://api.insight.iagon.com/v1/admin/users/550e8400-e29b-41d4-a716-446655440000/usage?start_date=2026-01-01&end_date=2026-01-31" \
-H "Authorization: Bearer YOUR_ADMIN_KEY"Response (200 OK)
json
{
"success": true,
"data": {
"user_account_id": "550e8400-e29b-41d4-a716-446655440000",
"user_name": "Acme Corporation",
"external_id": "cust_abc123",
"total_requests": 152400,
"successful_requests": 150200,
"failed_requests": 2200,
"avg_response_time_ms": 45,
"credential_count": 3,
"period_start": "2026-01-01T00:00:00Z",
"period_end": "2026-01-31T23:59:59Z"
}
}Get All Users Usage
Get usage summary for all your users. Perfect for billing dashboards.
Request
http
GET /v1/admin/users/usage/summary
Authorization: Bearer {admin_key}Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Results per page (1-100) |
offset | integer | 0 | Pagination offset |
start_date | ISO 8601 | 30 days ago | Start of period |
end_date | ISO 8601 | Now | End of period |
Example
bash
curl -X GET "https://api.insight.iagon.com/v1/admin/users/usage/summary?start_date=2026-01-01" \
-H "Authorization: Bearer YOUR_ADMIN_KEY"Response (200 OK)
json
{
"success": true,
"data": [
{
"user_account_id": "550e8400-e29b-41d4-a716-446655440000",
"user_name": "Acme Corporation",
"external_id": "cust_abc123",
"total_requests": 152400,
"successful_requests": 150200,
"failed_requests": 2200,
"avg_response_time_ms": 45,
"credential_count": 3,
"period_start": "2026-01-01T00:00:00Z",
"period_end": "2026-01-31T23:59:59Z"
},
{
"user_account_id": "550e8400-e29b-41d4-a716-446655440002",
"user_name": "Beta Inc",
"external_id": "cust_xyz789",
"total_requests": 8500,
"successful_requests": 8400,
"failed_requests": 100,
"avg_response_time_ms": 38,
"credential_count": 1,
"period_start": "2026-01-01T00:00:00Z",
"period_end": "2026-01-31T23:59:59Z"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 2,
"hasMore": false
}
}Usage Summary Fields
| Field | Description |
|---|---|
total_requests | Total API calls made |
successful_requests | Requests with 2xx/3xx status |
failed_requests | Requests with 4xx/5xx status |
avg_response_time_ms | Average response time |
credential_count | Number of active API keys |
Notes
- Results sorted by
total_requestsdescending (highest usage first) - Only includes active users (not suspended)
- Aggregates usage across all credentials for each user
- Use
external_idto match with your billing system
