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

# List events

> Lists the latest version of each event of the tenant that occurred in the `occurredAt` window, newest first by the time when Aira recorded it. The window is required and spans at most 31 days, so that no call reads every event of the tenant. Archived events are listed only when `includeArchived` is true.

Requires the role `events:read`.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/events/
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/events/:
    get:
      tags:
        - Events
      summary: List events
      description: >-
        Lists the latest version of each event of the tenant that occurred in
        the `occurredAt` window, newest first by the time when Aira recorded it.
        The window is required and spans at most 31 days, so that no call reads
        every event of the tenant. Archived events are listed only when
        `includeArchived` is true.


        Requires the role `events:read`.
      parameters:
        - schema:
            type: string
            format: date-time
          example: '2026-10-01T00:00:00.000Z'
          in: query
          name: occurredAt.gte
          required: true
          description: >-
            Start of the window, inclusive: the list returns only the events
            that occurred at or after this instant. The window spans at most 31
            days.
        - schema:
            type: string
            format: date-time
          example: '2026-10-31T23:59:59.999Z'
          in: query
          name: occurredAt.lte
          required: true
          description: >-
            End of the window, inclusive: the list returns only the events that
            occurred at or before this instant, which is at most 31 days after
            `occurredAt.gte`.
        - schema:
            type: string
            format: date-time
          in: query
          name: createdAt.gte
          required: false
          description: >-
            The list returns only the events that Aira recorded at or after this
            instant.
        - schema:
            type: string
            format: date-time
          in: query
          name: createdAt.lte
          required: false
          description: >-
            The list returns only the events that Aira recorded at or before
            this instant.
        - schema:
            type: array
            items:
              type: string
              format: uuid
          in: query
          name: customerIds[]
          required: false
          description: >-
            The list returns only the events of these customers, by their ids in
            Aira.
        - schema:
            type: boolean
            default: false
          in: query
          name: includeSubsidiaryEvents
          required: false
          description: >-
            Whether the list also returns the events of the subsidiaries of the
            organizations that `customerIds[]` names.
        - schema:
            type: array
            items:
              type: string
          in: query
          name: eventNames[]
          required: false
          description: The list returns only the events with these event names.
        - schema:
            type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          in: query
          name: search
          required: false
          description: >-
            The list returns only the event whose idempotency key equals this
            value after Aira lowercases it, so a key with a capital letter never
            matches.
        - schema:
            type: boolean
            default: false
          in: query
          name: includeArchived
          required: false
          description: Whether the list also returns the archived events.
        - schema:
            type: integer
            default: 0
            minimum: 0
            maximum: 2147483647
          in: query
          name: offset
          required: false
          description: Number of items to skip before collecting the page.
        - schema:
            type: integer
            minimum: 1
            default: 100
            maximum: 100
          in: query
          name: limit
          required: false
          description: Maximum number of items to return per page.
      responses:
        '200':
          description: The events that match the filters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      description: >-
                        An event: one usage record that the tenant sends for a
                        customer, with an event name, properties and a time.
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: >-
                            The unique identifier of this version of the event
                            in our system.
                        idempotencyKey:
                          type: string
                          pattern: ^[a-zA-Z0-9_-]+$
                          description: >-
                            The tenant's own key for the event, the same in all
                            its versions.
                          example: 123e4567-e89b-12d3-a456-426614174000
                        eventName:
                          type: string
                          pattern: ^[a-zA-Z0-9_-]+$
                          description: >-
                            The event name, which the event filter of a resource
                            matches to count the event.
                          example: api_request
                        customerExternalId:
                          type: string
                          pattern: ^[a-zA-Z0-9_-]+$
                          description: >-
                            The external id of the customer of the event: the
                            tenant's own key for the customer.
                          example: cust_1234567890abcdef
                        properties:
                          type: object
                          description: >-
                            A dictionary of additional properties associated
                            with the event.
                          propertyNames:
                            pattern: ^[a-zA-Z](?:[a-zA-Z0-9]*|(?:_[a-zA-Z0-9]+))*$
                          required:
                            - value
                          properties:
                            value:
                              type: number
                              minimum: 0
                              description: >-
                                Numeric value associated with the event, with up
                                to 6 decimal places.
                              example: 3600
                          additionalProperties:
                            if:
                              type: number
                            then:
                              type: number
                              minimum: 0
                            else:
                              anyOf:
                                - type: boolean
                                - type: string
                          example:
                            value: 3600
                            endpoint: /api/v1/users
                            method: GET
                            status_code: 200
                        occurredAt:
                          type: string
                          format: date-time
                          description: >-
                            ISO 8601 timestamp in UTC indicating when the event
                            occurred.
                          example: '2024-01-01T12:00:00Z'
                        createdAt:
                          type: string
                          format: date-time
                          description: >-
                            ISO 8601 timestamp in UTC indicating when Aira
                            recorded this version of the event.
                        archivedAt:
                          type:
                            - 'null'
                            - string
                          format: date-time
                          description: >-
                            ISO 8601 timestamp in UTC indicating when the event
                            was archived, or null if it is active.
                        version:
                          type: integer
                          description: >-
                            The version of the event: 1 is the first record of
                            its idempotency key, and each overwrite or archive
                            adds one.
                      required:
                        - id
                        - idempotencyKey
                        - eventName
                        - customerExternalId
                        - properties
                        - occurredAt
                        - createdAt
                        - archivedAt
                        - version
                      additionalProperties: false
                    description: A list of items.
                  hasMore:
                    description: Indicates if there are more items to fetch.
                    type: boolean
                required:
                  - items
                  - hasMore
                additionalProperties: false
        '400':
          description: >-
            The request cannot succeed as sent.


            - `json_schema_validation_error`: a query parameter breaks the
            schema of the endpoint.

            - `invalid_period_range`: `occurredAt.gte` is after
            `occurredAt.lte`, or `occurredAt.lte` is more than 31 days after
            `occurredAt.gte`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - json_schema_validation_error
                      - invalid_period_range
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                json_schema_validation_error:
                  value:
                    message: '''occurredAt.gte'' must match format "date-time"'
                    code: json_schema_validation_error
                invalid_period_range:
                  value:
                    message: occurredAt.gte must not be after occurredAt.lte
                    code: invalid_period_range
        '401':
          description: >-
            The request carries no API key.


            - `no_authorization`: the request carries no API key in the
            `X-API-KEY` header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - no_authorization
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                no_authorization:
                  value:
                    message: No authorization provided
                    code: no_authorization
        '403':
          description: >-
            The API key cannot call the endpoint.


            - `bad_auth`: the API key does not hold the role that the endpoint
            requires.

            - `invalid_api_key`: the API key does not exist.

            - `deactivated_api_key`: the API key is deactivated.

            - `revoked_api_key`: the API key is revoked.

            - `expired_api_key`: the API key is past its expiry date.

            - `ip_not_allowed`: the tenant does not allow the IP of the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - bad_auth
                      - invalid_api_key
                      - deactivated_api_key
                      - revoked_api_key
                      - expired_api_key
                      - ip_not_allowed
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                bad_auth:
                  value:
                    message: role events:read can not be satisfied
                    code: bad_auth
                invalid_api_key:
                  value:
                    message: Invalid API key
                    code: invalid_api_key
                deactivated_api_key:
                  value:
                    message: Deactivated API key
                    code: deactivated_api_key
                revoked_api_key:
                  value:
                    message: Revoked API key
                    code: revoked_api_key
                expired_api_key:
                  value:
                    message: Expired API key
                    code: expired_api_key
                ip_not_allowed:
                  value:
                    message: IP not allowed
                    code: ip_not_allowed
        '429':
          description: >-
            The tenant reached one of its limits of reads.


            - `too_many_reads_per_second`: the tenant already made 50 reads in
            this second.

            - `too_many_reads_in_flight`: the tenant already has 20 reads in
            flight.
          headers:
            Retry-After:
              schema:
                type: integer
              description: The seconds to wait before the next read.
            RateLimit-Limit:
              schema:
                type: integer
              description: >-
                The limit that the read hit: 20 for the reads in flight, 50 for
                the reads per second.
            RateLimit-Remaining:
              schema:
                type: integer
              description: The reads left under that limit, which is 0.
            RateLimit-Reset:
              schema:
                type: integer
              description: >-
                The seconds to wait before the next read, as in Retry-After. The
                limit of reads per second takes new reads in the next second,
                but the limit of reads in flight takes a new read only once one
                of the reads in flight ends.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: >-
                      A sentence for a person that says what failed. It can
                      change, so a system compares the code instead.
                  code:
                    type: string
                    description: >-
                      The identifier of the error, which a system compares to
                      decide what to do. It never changes.
                    enum:
                      - too_many_reads_per_second
                      - too_many_reads_in_flight
                  details:
                    oneOf:
                      - type: object
                        additionalProperties: true
                      - type: array
                    description: >-
                      The data of the error, when it has any, such as the fields
                      that failed the validation.
                  causations:
                    type: array
                    description: >-
                      The errors that caused this one, when several did, each
                      with its own message, code and details.
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          description: A sentence for a person that says what failed.
                        code:
                          type: string
                          description: The identifier of the error.
                        details:
                          type: object
                          additionalProperties: true
                          description: The data of the error, when it has any.
                      required:
                        - message
                        - code
                      additionalProperties: false
                required:
                  - message
                  - code
                additionalProperties: false
              examples:
                too_many_reads_per_second:
                  value:
                    message: >-
                      Too many reads: a tenant can make at most 50 reads per
                      second. Retry after 1 second.
                    code: too_many_reads_per_second
                too_many_reads_in_flight:
                  value:
                    message: >-
                      Too many reads in flight: a tenant can have at most 20
                      reads in flight. Retry after 1 second.
                    code: too_many_reads_in_flight
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````

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