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:Time granularity
Thegranularity parameter controls the time bucket size. Defaults to day.
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:
Cache discovery results — team composition changes infrequently.
Project budgets
On Enterprise plans,GET /v1/analytics/team-projects also returns each project’s credit budget: what it holds (assigned), what it has spent (consumed) and what it can still spend (available). A project without an active budget returns budget: null — it spends from its group or the organization pool instead. On Business plans budget is always null.
budget.available, already computed server-side as assigned - consumed — never derive it from credit-usage rows, which follow different filters and time buckets. To alert before a project runs out, poll this endpoint and compare available against a threshold:
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 10,000 requests per day (10,000 RPD) per API key on the Business and Enterprise plans, the only plans where the Analytics API is available.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 and subgroups with member count
Team Projects
List projects with name and credit budget
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 category and specific tool, user email, usage count, credits consumed, project, and group. The difference is structured JSON instead of flat CSV rows.
Why do some rows look identical?
Why do some rows look identical?
They are not duplicates.
tool is a category, and many tools share one — so two rows can show the same tool, user, project and date with the same counts and still be different consumptions. Tell them apart with tool_name, which identifies the specific tool that was billed, and add their credits together. De-duplicating them undercounts your real usage.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). To filter by people, pass their addresses in user_emails; GET /v1/analytics/team-members lists the emails of your team.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.
How do I monitor how much budget a project has left?
How do I monitor how much budget a project has left?
Call
GET /v1/analytics/team-projects (Enterprise plans) and read each project’s budget.available — it is already computed as assigned - consumed. A project with budget: null has no active budget and spends from its group or the organization pool, which is not the same as a budget of zero: a zero budget can pay for nothing. See Project budgets for a polling example that alerts before a project runs out.