Get aggregated usage

Get aggregated usage for a specific meter over a time range. Returns the computed value using the meter's aggregation method. --- **Related endpoints** - `POST /usage-events` — Ingest usage events - `GET /usage-events` — Query usage events - `POST /usage-events/dry-run` — Dry-run usage events **Common errors** - `400 invalid_request` — malformed payload or failed validation. - `401 authentication_error` — missing, invalid, expired, or revoked credential. Codes: `authentication_failed`, `invalid_api_key`, `expired_api_key`, `api_key_revoked`, `session_invalid`, `merchant_required`. Carries a `WWW-Authenticate: Bearer` challenge.

GET
/usage-events/aggregate/{meterId}

Get aggregated usage for a specific meter over a time range. Returns the computed value using the meter's aggregation method.


Related endpoints

  • POST /usage-events — Ingest usage events
  • GET /usage-events — Query usage events
  • POST /usage-events/dry-run — Dry-run usage events

Common errors

  • 400 invalid_request — malformed payload or failed validation.
  • 401 authentication_error — missing, invalid, expired, or revoked credential. Codes: authentication_failed, invalid_api_key, expired_api_key, api_key_revoked, session_invalid, merchant_required. Carries a WWW-Authenticate: Bearer challenge.
x-api-key<token>

Your RevKeen merchant API key. Create and manage keys in Dashboard → Settings → Developer. Use rk_sandbox_* for staging/test and rk_live_* for production. The same key may be sent as Authorization: Bearer <key> if that suits your HTTP client better. A missing, invalid, expired, or revoked key returns 401 with a WWW-Authenticate: Bearer challenge; a valid key without the required scope returns 403.

In: header

Path Parameters

meterId*string

Meter ID

Query Parameters

start_time*string

Start of time range (ISO 8601)

Formatdate-time
end_time*string

End of time range (ISO 8601)

Formatdate-time
customer_id?string

Filter by customer ID

external_customer_id?string

Filter by external customer ID

subscription_id?string

Filter by subscription ID

Response Body

application/json

application/json

application/json

application/json

Stuck on an error response? Ask the RevKeen assistant to explain it.
curl "https://api.revkeen.com/v2/usage-events/aggregate/mtr_abc123?start_time=2026-03-01T00%3A00%3A00Z&end_time=2026-03-31T23%3A59%3A59Z" \
  -H "x-api-key: $REVKEEN_API_KEY"
{  "object": "usage_aggregate",  "meter_id": "string",  "start_time": "2019-08-24T14:15:22Z",  "end_time": "2019-08-24T14:15:22Z",  "value": 0,  "event_count": 0}

Get current usage balance GET

Returns the current usage balance for a customer or subscription in the active billing period. Shows per-meter breakdown with included allowance, overage, estimated charges, and margin data. A subscription has one currency; metered usage attributed to the subscription is assumed to be in that same currency. RevKeen does not perform FX conversion in the metering layer. --- **Common errors** - `400 invalid_request` — malformed payload or failed validation. - `401 authentication_error` — missing, invalid, expired, or revoked credential. Codes: `authentication_failed`, `invalid_api_key`, `expired_api_key`, `api_key_revoked`, `session_invalid`, `merchant_required`. Carries a `WWW-Authenticate: Bearer` challenge.

Dry-run usage events POST

Validate usage events without persisting them. Returns acceptance/rejection reasons that mirror real ingestion rules. --- **Related endpoints** - `POST /usage-events` — Ingest usage events - `GET /usage-events` — Query usage events - `GET /usage-events/aggregate/{meterId}` — Get aggregated usage **Common errors** - `400 invalid_request` — malformed payload or failed validation. - `401 authentication_error` — missing, invalid, expired, or revoked credential. Codes: `authentication_failed`, `invalid_api_key`, `expired_api_key`, `api_key_revoked`, `session_invalid`, `merchant_required`. Carries a `WWW-Authenticate: Bearer` challenge. **Idempotency** Pass an `Idempotency-Key` header (UUID v4 recommended) to make retries safe. Keys are valid for 24 hours; see [the idempotency guide](/docs/fundamentals/idempotency).