Team analytics
Programmatic access to the same credit usage data available in your dashboard and CSV export.
Credit usage
Query credit consumption over time withPOST /v1/analytics/team-credit-usage. Each response includes per-user breakdown with email addresses and per-project grouping automatically.
Example response
Filtering
Narrow down results to specific subsets of your team:| Filter | What it does | Where to get the IDs |
|---|---|---|
group_ids | Show only consumption from members of specific groups | GET /v1/analytics/team-groups |
project_references | Show only consumption within specific projects | GET /v1/analytics/team-projects |
api_key_ids | Show only consumption from specific API keys | GET /v1/analytics/team-api-keys |
Time granularity
Thegranularity parameter controls the time bucket size. Defaults to day.
| Value | Description | Best for |
|---|---|---|
day | One data point per calendar day | Short ranges (up to 30 days) |
week | One data point per ISO week (Monday–Sunday) | Medium ranges (1–3 months) |
month | One data point per calendar month | Quarterly or yearly overviews |
year | One data point per calendar year | Multi-year trend analysis |
Date range limits
- If no dates are provided, returns the last 7 days
- Enterprise: maximum 365 days
- Business: maximum 180 days
Discovery endpoints
Four companion endpoints let you list team resources and get the IDs needed for filtering credit usage:| Endpoint | Returns |
|---|---|
GET /v1/analytics/team-members | Members with email, role, and status |
GET /v1/analytics/team-api-keys | API keys with name and status |
GET /v1/analytics/team-groups | Groups with name and member count |
GET /v1/analytics/team-projects | Projects with name |
Authentication
All endpoints authenticate with theX-Magnific-API-Key header. Your team is identified automatically from the API key. See Authentication for details.
Rate limits
All Analytics API endpoints are limited to 100 requests per day (100 RPD).API reference
Credit Usage
Query credit consumption over time with filters
Team Members
List members with email, role, and status
API Keys
List API keys with name and status
Team Groups
List groups with member count
Team Projects
List projects with name
Frequently Asked Questions
What data does the Analytics API provide?
What data does the Analytics API provide?
The same data available in your Credit Usage dashboard and CSV export: date, tool (display name), user email, usage count, credits consumed, project, and group. The difference is structured JSON instead of flat CSV rows.
Does using the Analytics API cost credits?
Does using the Analytics API cost credits?
No. The Analytics API is included with your Business or Enterprise plan at no additional cost.
How do I know which IDs to use for filtering?
How do I know which IDs to use for filtering?
Call the discovery endpoints first. For example,
GET /v1/analytics/team-groups returns all your groups with their group_id. Pass those IDs into the group_ids filter when querying credit usage. The same applies to projects (project_references) and API keys (api_key_ids).What is the maximum date range?
What is the maximum date range?
Enterprise plans can query up to 365 days. Business plans can query up to 180 days. If no dates are provided, the API defaults to the last 7 days.