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

# Ingest events

> Ingest usage events for metering and billing purposes.

Events are deduplicated by `(event_id, customer_id)` — re-sending the same pair will not be
double-counted. If timestamps differ across duplicates, the event with the latest timestamp is used.

By default, any invalid event rejects the entire batch. Set `allow_partial_failures` to `true` to ingest valid events and receive per-event failure details in the response body.



## OpenAPI

````yaml https://api.meteroid.com/api-docs/openapi.json post /api/v1/events/ingest
openapi: 3.1.0
info:
  title: meteroid
  description: ''
  license:
    name: LicenseRef-Proprietary
    identifier: LicenseRef-Proprietary
  version: 0.1.0
servers: []
security: []
tags:
  - name: Meteroid
    description: Meteroid API
  - name: Add-ons
  - name: Batch Jobs
  - name: Checkout Sessions
  - name: Connect
    description: Manage connected accounts (Express & Standard)
  - name: Coupons
  - name: Credit Notes
  - name: Customers
  - name: Entitlements
  - name: Events
  - name: Features
  - name: Invoices
  - name: Metrics
  - name: OAuth
    description: OAuth 2.0 token endpoints (public, client-credentials auth)
  - name: OAuth Apps
    description: Manage OAuth applications for Connect integrations
  - name: Plans
  - name: Product Families
  - name: Products
  - name: Subscriptions
  - name: Usage
paths:
  /api/v1/events/ingest:
    post:
      tags:
        - Events
      summary: Ingest events
      description: >-
        Ingest usage events for metering and billing purposes.


        Events are deduplicated by `(event_id, customer_id)` — re-sending the
        same pair will not be

        double-counted. If timestamps differ across duplicates, the event with
        the latest timestamp is used.


        By default, any invalid event rejects the entire batch. Set
        `allow_partial_failures` to `true` to ingest valid events and receive
        per-event failure details in the response body.
      operationId: ingest_events
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestEventsRequest'
        required: true
      responses:
        '200':
          description: Events ingested successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestEventsResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    IngestEventsRequest:
      type: object
      required:
        - events
      properties:
        allow_backfilling:
          type:
            - boolean
            - 'null'
          description: >-
            Allow events with timestamps more than 1 day in the past. Defaults
            to `false`.
        allow_partial_failures:
          type:
            - boolean
            - 'null'
          description: >-
            Accept the batch even if some events fail validation. Defaults to
            `false`.

            When `true`, valid events are ingested and failures are reported in
            the response body.

            When `false` (default), any invalid event rejects the entire batch.
        events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
          description: 1–100 events per request.
    IngestEventsResponse:
      type: object
      properties:
        failures:
          type: array
          items:
            $ref: '#/components/schemas/IngestFailure'
          description: Events that failed to ingest. Omitted when no failures.
    RestErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
    Event:
      type: object
      required:
        - event_id
        - code
        - customer_id
        - timestamp
      properties:
        code:
          type: string
          description: Billable metric code. Max 512 characters.
        customer_id:
          type: string
          description: Meteroid customer ID or external customer alias.
        event_id:
          type: string
          description: >-
            Unique event identifier. Max 255 characters. A UUID or ULID is
            recommended.
        properties:
          type: object
          description: >-
            Arbitrary string key-value pairs used by billable metrics for
            filtering and aggregation.
          additionalProperties:
            type: string
          propertyNames:
            type: string
          example:
            region: us-east-1
            tier: pro
            bytes: '1048576'
        timestamp:
          type: string
          description: >-
            RFC 3339 timestamp. Defaults to ingestion time if omitted.

            Must be between 24 hours ago and 1 hour from now. Set
            `allow_backfilling` to remove the past limit.
          example: '2026-01-15T10:30:00Z'
    IngestFailure:
      type: object
      required:
        - event_id
        - reason
      properties:
        event_id:
          type: string
        reason:
          type: string
    ErrorCode:
      type: string
      enum:
        - BAD_REQUEST
        - NOT_FOUND
        - CONFLICT
        - FORBIDDEN
        - UNAUTHORIZED
        - TOO_MANY_REQUESTS
        - INTERNAL_SERVER_ERROR
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````