RudderStack Organization Usage API Beta

Get organization-level event usage metrics by workspace, source, and time bucket.

The Organization Usage API lets you get organization-level event usage counts grouped by workspace, source, and time bucket.

You can use this API to reconcile your organization’s event usage and billing numbers across Event Stream, Reverse ETL, and ETL sources.

Prerequisites

Authentication

The Organization Usage API uses Bearer authentication in the following format:

Authorization: Bearer <SERVICE_ACCESS_TOKEN>
This endpoint requires an organization-level Service Access Token. Workspace-level Service Access Tokens and Personal Access Tokens are not supported for this endpoint and return 401 Unauthorized.

Base URL

Use the base URL for your API requests depending on your region:

https://api.rudderstack.com/v2

Get organization event usage metrics

You can get organization-level event usage metrics using the following endpoint:

GET /organizations/usage/event-metrics

Query parameters

granularity
Required
String
Time bucket size for event counts. It accepts one of the following values: day, week, or month.
start
Required
String (date)
Start date for the usage window in YYYY-MM-DD format, interpreted as midnight UTC. Must fall within the maximum lookback window for the specified granularity.


Maximum lookback window

If start is older than the window for the specified granularity (relative to the current time in UTC), the API returns 400 Bad Request.

granularityMaximum lookback
day60 days
week9 weeks
month24 months

Buckets are left-aligned: the bucket value is the bucket’s start time, not its end time.

Rows with deleted: true represent sources that have since been deleted but still contributed events in the requested window. These rows are included in the results, not filtered out.

Example request

http
GET /v2/organizations/usage/event-metrics?granularity=day&start=2024-07-01 HTTP/1.1
Host: api.rudderstack.com
Accept: application/json
Authorization: Bearer <SERVICE_ACCESS_TOKEN>

Example response

json
{
  "data": [
    {
      "workspaceId": "abc123",
      "sourceId": "src_xyz",
      "sourceName": "JavaScript",
      "sourceCategory": "eventStream",
      "sourceDefinitionId": "def_001",
      "bucket": "2024-07-01",
      "count": 15230,
      "deleted": false
    },
    {
      "workspaceId": "abc123",
      "sourceId": "src_wh",
      "sourceName": "Warehouse Action",
      "sourceCategory": "reverseEtl",
      "sourceDefinitionId": "def_002",
      "bucket": "2024-07-01",
      "count": 4200,
      "deleted": false
    }
  ],
  "summary": {
    "totalEvents": 19430,
    "eventStream": 15230,
    "reverseEtl": 4200,
    "etl": 0
  }
}

Response object parameters

data
Required
Array
Contains the event usage metric rows, grouped by workspace, source, and bucket.
workspaceId
Required
String
Unique identifier of the workspace that owns the source.
sourceId
Required
String
Unique identifier of the source.
sourceName
Required
String
Display name of the source.
sourceCategory
Required
String
Source category. Known values are eventStream, reverseEtl, and etl.
sourceDefinitionId
Required
String
Unique identifier of the source definition.
bucket
Required
String (date)
UTC date for the usage time bucket, returned as the left edge or start time of the bucket.
count
Required
Number
Event count for the source and bucket.
deleted
Required
Boolean
Indicates whether the source has since been deleted. Deleted sources are included when they contributed events in the requested window.
summary
Required
Object
Contains the aggregate event counts for the response.
totalEvents
Required
Number
Sum of all returned event counts.
eventStream
Required
Number
Sum of event counts for Event Stream sources.
reverseEtl
Required
Number
Sum of event counts for Reverse ETL sources.
etl
Required
Number
Sum of event counts for ETL sources.

Response codes

CodeDescription
200Returns organization-level event usage counts grouped by workspace, source, and time bucket.
400Invalid query parameters. This includes missing or invalid granularity, missing or invalid start, and a start date older than the maximum lookback window for the specified granularity.
401Missing, invalid, or unsupported access token. Use an organization-level Service Access Token for this endpoint.
500Upstream or internal error.

Example 400 response when start exceeds the lookback window for granularity=day:

json
{
  "code": "bad-request",
  "error": "start date too far in the past for '1 day' granularity",
  "details": {}
}

The error text uses '1 day', '1 week', or '1 month' even though the granularity query parameter is day, week, or month.

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.