Skip to main content
POST
Get team credit usage over time

Authorizations

x-magnific-api-key
string
header
required

Your Magnific API key. Required for authentication. Learn how to obtain an API key

Body

application/json
granularity
enum<string>
default:day

Time bucket granularity for aggregation. Defaults to day if omitted.

Available options:
day,
week,
month,
year
Example:

"month"

start_date
string<date>

Start date for the query range (YYYY-MM-DD). Defaults to 7 days ago.

Example:

"2026-01-01T00:00:00.000Z"

end_date
string<date>

End date for the query range (YYYY-MM-DD). Defaults to today.

Example:

"2026-03-31T00:00:00.000Z"

project_references
string<uuid>[]

Filter by specific project references.

Example:
api_key_ids
string[]

Filter by specific API key IDs.

Example:
group_ids
integer[]

Filter by specific team group IDs. Members of these groups are included in the results.

Required range: x >= 1
Example:
user_emails
string<email>[]

Filter by the email addresses of team members (case-insensitive). Returns the consumption made by those people directly; usage generated through API keys they created carries no email and is not included — filter it with api_key_ids.

Combined with group_ids, the results include both the listed people and the members of those groups. Emails that do not belong to the caller's team are ignored, and when none of them does the response is empty. Callers without an Owner or Admin role only get data for their own email.

Maximum array length: 100
Example:

Response

OK

data
object[]