API reference

Download spec
get

Get billing usage

Returns metered feature usage for the team's billing period. Defaults to the current period; use `range=previous` or `range=custom` with `start` and `end` to query other windows.

Required API key scope
billing:read
/api/v1/team/billing/usage

Code samples

curl --request GET \
  --url 'https://api.emailguard.co/api/v1/team/billing/usage?range=example&start=example&end=example' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Parameters

Query parameters

NameTypeDescription
rangestring

Period selector: current, previous, or custom

startstring

Custom range start (RFC3339 or YYYY-MM-DD); required when range=custom

endstring

Custom range end (RFC3339 or YYYY-MM-DD); required when range=custom

Responses

200
OK
OK
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

dataunknown[]
messagestring

Human-readable detail when the code is not OK.

400
Bad Request
Bad Request
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

messagestring

Human-readable detail when the code is not OK.

401
Unauthorized
Unauthorized
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

messagestring

Human-readable detail when the code is not OK.

403
Forbidden
Forbidden
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

messagestring

Human-readable detail when the code is not OK.

404
Not Found
Not Found
codestringrequired

Machine-readable status code (for example OK or INVALID_BODY).

messagestring

Human-readable detail when the code is not OK.