Authentication
This endpoint requires a valid JWT token from Clerk authentication. The token must include organization membership.Query Parameters
Start date for the query range (ISO 8601 format, e.g., “2024-01-01T00:00:00.000Z”)
End date for the query range (ISO 8601 format, e.g., “2024-12-31T23:59:59.999Z”)
Whether to include stats for all users in the organization. Requires
org:admin
role.Filter results to a specific agent ID
Filter results to a specific user ID (admin only when
allInOrg
is true)Filter by a specific metadata key in user’s publicMetadata
Filter by a specific metadata value. Can be used with or without metadataKey.
Response
Total number of unique conversations
Total number of messages across all conversations
Total number of tool invocations across all messages
Total token usage across all conversations
Number of unique users who participated in conversations
Number of unique agents used in conversations
Total number of feedback responses (helpful + not helpful)
Number of positive feedback responses
Number of negative feedback responses
Examples
Error Codes
Forbidden - User lacks required permissions (e.g., non-admin trying to use
allInOrg=true
)Internal Server Error - Server encountered an unexpected condition
Notes
- All dates should be provided in ISO 8601 format
- When
allInOrg=true
, only users withorg:admin
role can access organization-wide data - Metadata filtering supports flexible querying across user’s publicMetadata JSON field
- Token counts include both input and output tokens from conversations
- Tool calls are counted across all message toolInvocations arrays