Billing

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET

Retrieve billing usage timeseries

In beta: the organization billing API is behind the organization-billing-api feature flag and answers 403 without it, so ask support for access. Its shapes may change while it is in beta.

Required API key scopes

billing:read

Query parameters

  • breakdowns
    string | null
  • cursor
    string | null
  • end_date
    string | null
  • interval
    string | null
  • limit
    integer | null
  • start_date
    string | null
  • team_ids
    string | null
  • top_projects
    integer | null
  • usage_types
    string | null

Response


Example request

GET /api/organizations/:organization_id/billing/usage/timeseries
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/organizations/:organization_id/billing/usage/timeseries/

Example response

Status 200
RESPONSE
{
"count": 0,
"next": "http://example.com",
"previous": "http://example.com",
"results": [
{
"id": 0,
"label": "string",
"data": [
0.1
],
"dates": [
"string"
],
"breakdown_type": "type",
"breakdown_value": null
}
]
}