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

# Ingest billable events

> Ingest several billable events in batch (limited to max 5000 events per request). This endpoint is idempotent, an event with the same id, will be updated if it already exists.



## OpenAPI

````yaml post /v1/events/batch
openapi: 3.1.0
info:
  title: Hyperline Ingest API
  version: 0.0.0
servers:
  - url: https://ingest.hyperline.co
  - url: https://sandbox.ingest.hyperline.co
security: []
paths:
  /v1/events/batch:
    post:
      tags:
        - Usage > Billable events
      summary: Ingest billable events
      description: >-
        Ingest several billable events in batch (limited to max 5000 events per
        request). This endpoint is idempotent, an event with the same id, will
        be updated if it already exists.
      operationId: ingestBillableEvents
      requestBody:
        description: Events payload
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/BillableEvent'
              minItems: 1
              maxItems: 5000
      responses:
        '201':
          description: Events ingested
          content:
            application/json:
              schema:
                type: object
                properties:
                  events_created:
                    type: array
                    items:
                      $ref: '#/components/schemas/BillableEvent'
                  events_failed:
                    type: array
                    items:
                      $ref: '#/components/schemas/BillableEvent'
                required:
                  - events_created
                  - events_failed
        '503':
          description: >-
            Ingestion is temporarily overloaded. The request was not processed:
            retry after the delay given by the `Retry-After` header, with
            exponential backoff and jitter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestionOverloadedError'
      security:
        - bearer: []
components:
  schemas:
    BillableEvent:
      type: object
      properties:
        customer_id:
          type: string
          description: Hyperline ID or external ID of the existing customer.
          example: cus_CrqwefTRWBWRT
        event_type:
          type: string
          minLength: 1
          description: >-
            Type corresponding to the event. When creating a dynamic product,
            this type will be used to map the related events to specific prices.
          example: api_call
        timestamp:
          type: string
          format: date-time
          description: >-
            UTC date time string in the [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format, or
            milliseconds since the epoch. The event timestamp is used to
            retrieve the events related to a specific billing period.
          example: '2024-12-20T16:04:11Z'
        record:
          allOf:
            - type: object
              properties:
                id:
                  anyOf:
                    - type: string
                    - type: number
                  description: >-
                    A unique identifier for your event, used to identify the
                    event in your system and prevent duplicates.
              required:
                - id
            - type: object
              additionalProperties:
                anyOf:
                  - type: string
                  - type: number
                  - type: boolean
                  - type: 'null'
                  - type: 'null'
          description: Payload of the event containing an ID and any additional metadata.
          example:
            id: D32NAA8
            durationInMs: 32
            isVerified: true
      required:
        - customer_id
        - event_type
        - timestamp
        - record
    IngestionOverloadedError:
      type: object
      properties:
        statusCode:
          type: number
          enum:
            - 503
          example: 503
        type:
          type: string
          enum:
            - ServiceUnavailable
          example: ServiceUnavailable
        message:
          type: string
          description: Human-readable reason for the rejection.
          example: Event ingestion is temporarily overloaded, retry in 30 seconds
        retryAfterSeconds:
          type: integer
          description: >-
            Seconds to wait before retrying, same value as the `Retry-After`
            header.
          example: 30
      required:
        - statusCode
        - type
        - message
        - retryAfterSeconds
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.