Usage API

Monitor your usage and check quota limits for events and storage.

POST
/rest/v1/rpc/get_usage_monthly
Get monthly usage data including events enqueued, events stored, bytes stored, and quota information.

Authentication

Requires JWT token (Bearer token). Tenant ID is extracted from the JWT token.

Parameters

NameTypeRequiredDescription
p_monthstringOptionalMonth in format YYYY-MM-DD or YYYY-MM-01. If not provided, returns current month.

Request Body

interface GetUsageRequest {
  p_month?: string  // Format: YYYY-MM-DD or YYYY-MM-01
}
Example
{
  "p_month": "2025-01-01"
}

Responses

200Usage data for the specified month
{
  "tenant_id": "tenant-123",
  "month_start": "2025-01-01T00:00:00Z",
  "events_enqueued": 125000,
  "bytes_enqueued": 52428800,
  "events_stored": 120000,
  "bytes_stored": 50331648,
  "last_update_at": "2025-01-15T10:30:00Z",
  "monthly_events_limit": 1000000,
  "monthly_bytes_limit": 107374182400,
  "events_remaining": 880000,
  "bytes_remaining": 107323850752,
  "usage_percent": 12.0
}
404Usage data not found for the specified month

Usage Data Fields

FieldTypeDescription
events_enqueuednumberTotal events queued this month
events_storednumberTotal events successfully stored
bytes_enqueuednumberTotal bytes queued this month
bytes_storednumberTotal bytes successfully stored
monthly_events_limitnumberMonthly event limit for your plan
monthly_bytes_limitnumberMonthly storage limit in bytes
events_remainingnumberRemaining events in quota
bytes_remainingnumberRemaining storage in quota
usage_percentnumberPercentage of quota used (0-100)

Quota Limits by Plan

  • Free: 10,000 events/month, 1GB storage
  • Pro: 1,000,000 events/month, 100GB storage
  • Enterprise: Custom limits