> ## Documentation Index
> Fetch the complete documentation index at: https://docs.recurso.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List Usage Events

> Newest-first stream of raw usage events, for checking that metering ingestion landed.

Returns the raw events your services reported through
[Record Usage Event](/api-reference/usage/record-event) and
[Record Usage Events (Batch)](/api-reference/usage/batch), newest first.
This is the "did my events actually land?" view for debugging metering — it
is not aggregated. For billing-shaped numbers use
[Query Usage](/api-reference/usage/query) (time buckets) or
[Get Subscription Usage](/api-reference/subscriptions/usage) (current-period
totals with entitlement headroom).

The stream is tenant-scoped through the subscription: only events on
subscriptions that belong to the authenticated tenant are returned.

## Query Parameters

| Parameter     | Type          | Required | Description                                                    |
| ------------- | ------------- | -------- | -------------------------------------------------------------- |
| `customer_id` | string (UUID) | No       | Only events for this customer                                  |
| `dimension`   | string        | No       | Only events for this dimension (exact match, e.g. `api_calls`) |
| `limit`       | integer       | No       | Page size. Default `50`, capped at `200`                       |
| `offset`      | integer       | No       | Rows to skip. Default `0`                                      |

## Example Request

```bash theme={null}
curl "https://api.recurso.dev/v1/usage/events?customer_id=d5b7c1de-8a34-4a37-8f0e-b1a9f3f6f001&dimension=api_calls&limit=2" \
  -H "Authorization: Bearer $API_KEY"
```

## Response

```json theme={null}
{
  "data": [
    {
      "id": "7c1de5b7-1f6d-4a37-8f0e-b1a9f3f6f002",
      "subscription_id": "9a1f0f9e-52f1-4c11-a1b0-1f6d3f1c2a7e",
      "customer_id": "d5b7c1de-8a34-4a37-8f0e-b1a9f3f6f001",
      "dimension": "api_calls",
      "quantity": 150,
      "timestamp": "2026-07-06T23:58:01Z",
      "properties": { "region": "ap-south-1" },
      "transaction_id": "req_01J1Z8K3Q4"
    },
    {
      "id": "3f9a2b7c-8d1e-4f60-a5b4-c2d3e4f5a603",
      "subscription_id": "9a1f0f9e-52f1-4c11-a1b0-1f6d3f1c2a7e",
      "customer_id": "d5b7c1de-8a34-4a37-8f0e-b1a9f3f6f001",
      "dimension": "api_calls",
      "quantity": 42,
      "timestamp": "2026-07-06T23:57:12Z"
    }
  ]
}
```

## Fields

| Field             | Type              | Description                                                        |
| ----------------- | ----------------- | ------------------------------------------------------------------ |
| `id`              | string (UUID)     | Event ID (the `event_id` returned at ingestion)                    |
| `subscription_id` | string (UUID)     | Subscription the usage was recorded against                        |
| `customer_id`     | string (UUID)     | The subscription's customer                                        |
| `dimension`       | string            | Usage dimension / meter name                                       |
| `quantity`        | integer           | Quantity recorded on the event                                     |
| `timestamp`       | string (RFC 3339) | Ingestion time, set server-side                                    |
| `properties`      | object            | Free-form string attributes sent with the event; omitted when none |
| `transaction_id`  | string            | Caller-supplied idempotency key; omitted when none was sent        |

The list is ordered by `timestamp` descending and carries no `has_more`
flag — page with `offset` until a page comes back shorter than `limit`.

## Errors

| Status | Code                | When                                 | Fix                                          |
| ------ | ------------------- | ------------------------------------ | -------------------------------------------- |
| `400`  | `validation_failed` | `customer_id` is not a valid UUID    | Pass the customer's UUID, or drop the filter |
| `401`  | `unauthorized`      | Missing or invalid API key / session | Send `Authorization: Bearer $API_KEY`        |
| `500`  | `internal_error`    | Reading the event stream failed      | Retry; contact support if it persists        |

Errors use the standard envelope — see [Errors](/api-reference/errors).

<Note>
  Non-numeric or negative `limit` / `offset` values are not rejected: `limit`
  falls back to the default of `50` (and anything above `200` is clamped to
  `200`), and a negative `offset` is treated as `0`.
</Note>


## OpenAPI

````yaml GET /v1/usage/events
openapi: 3.1.0
info:
  title: Recurso API
  version: 1.0.0
  description: |
    The Recurso billing engine REST API.

    Authenticate by passing your API key as a bearer token:

        Authorization: Bearer <api_key>

    Obtain an API key by registering a tenant via `POST /auth/register`.
    All authenticated endpoints live under the `/v1` prefix. Mutating
    endpoints support idempotency via the `Idempotency-Key` header.
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://billing.example.com
    description: >-
      Example deployment — substitute the base URL of your own Recurso
      deployment.
security:
  - bearerAuth: []
tags:
  - name: System
    description: Health, version, and API metadata
  - name: Auth
    description: Tenant registration
  - name: Plans
    description: Product catalog plans
  - name: Customers
    description: Customer management
  - name: Subscriptions
    description: Subscription lifecycle
  - name: Invoices
    description: Invoices, PDFs, and Indian GST e-invoicing
  - name: Coupons
    description: Discounts
  - name: Usage
    description: Metered usage events
  - name: Credit Notes
    description: Customer credits
  - name: Quotes
    description: Quote-to-invoice lifecycle
  - name: Webhooks
    description: Webhook endpoint management and event feed
  - name: Analytics
    description: Revenue analytics
  - name: Checkout
    description: Public hosted checkout for invoices
  - name: Payments
    description: Payment order creation
  - name: Inbound Webhooks
    description: Receivers for payment-gateway callbacks (Razorpay, Stripe)
  - name: Customer Portal
    description: Customer-facing portal — magic-link auth and session-scoped data
  - name: Developer
    description: API key management
  - name: Account
    description: Tenant account settings
  - name: Finance
    description: Ledger accounts, entries, reconciliation, and revenue recognition
  - name: Settings
    description: Tax (GST) and e-invoicing (IRP) configuration
  - name: Consents
    description: Consent records for RBI-compliant recurring billing
  - name: Referrals
    description: Customer referral program
  - name: Gifts
    description: Gift subscriptions
  - name: Mandates
    description: UPI Autopay mandates
  - name: Offline Payments
    description: Virtual accounts and manually recorded payments
  - name: Organizations
    description: Multi-entity organizations grouping several tenants
  - name: Accounting
    description: QuickBooks / Xero accounting integrations
  - name: Churn
    description: Churn risk scoring and alerts
  - name: Cancel Flows
    description: Configurable retention flows shown at cancellation time
  - name: Dunning
    description: Dunning analytics and multi-channel dunning campaigns
paths:
  /v1/usage/events:
    get:
      tags:
        - Usage
      summary: List recent raw usage events
      description: >
        Newest-first raw ingestion stream for debugging metering — "did my
        events actually land?". Optional customer_id and dimension filters;
        limit (max 200, default 50) and offset paging.
      operationId: listUsageEvents
      parameters:
        - name: customer_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: dimension
          in: query
          required: false
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            maximum: 200
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Raw usage events, newest first.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        subscription_id:
                          type: string
                          format: uuid
                        customer_id:
                          type: string
                          format: uuid
                        dimension:
                          type: string
                        quantity:
                          type: integer
                          format: int64
                        timestamp:
                          type: string
                          format: date-time
                        properties:
                          type: object
                          additionalProperties:
                            type: string
                        transaction_id:
                          type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    BadRequest:
      description: The request body or parameters are invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid credentials (API key or session cookie).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          description: Structured error detail.
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable error code.
              examples:
                - validation_failed
                - unauthorized
                - forbidden
                - not_found
                - conflict
                - rate_limited
                - internal_error
                - invalid_api_key
                - key_mode_mismatch
                - over_refund
                - invoice_not_paid
                - invoice_already_paid
            message:
              type: string
              description: Human-readable explanation.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Tenant API key obtained from `POST /auth/register` or `POST
        /v1/developer/keys`.

````