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

# List raw events

> Use when debugging ingestion or exporting raw event data (e.g. support or audit). Returns a paginated list; supports time range and sorting.



## OpenAPI

````yaml /api-reference/openapi.json post /events/query
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /events/query:
    post:
      tags:
        - Events
      summary: List raw events
      description: >-
        Use when debugging ingestion or exporting raw event data (e.g. support
        or audit). Returns a paginated list; supports time range and sorting.
      operationId: listRawEvents
      requestBody:
        description: Request body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetEventsRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GetEventsRequest:
      type: object
      properties:
        end_time:
          type: string
          description: |-
            End time of the events to be fetched in ISO 8601 format
            Defaults to now if not provided
          example: '2024-12-09T00:00:00Z'
          format: date-time
        event_id:
          type: string
          description: Event ID is the idempotency key for the event
        event_name:
          type: string
          description: Event name / Unique identifier for the event in your system
        external_customer_id:
          type: string
          description: Customer ID in your system that was sent with the event
        iter_first_key:
          type: string
          description: First key to iterate over the events
        iter_last_key:
          type: string
          description: Last key to iterate over the events
        offset:
          type: integer
          description: Offset to fetch the events and is set to 0 by default
        order:
          type: string
          description: >-
            Order by condition. Allowed values (case sensitive): asc, desc
            (default: desc)
          example: desc
        page_size:
          type: integer
          description: Page size to fetch the events and is set to 50 by default
        property_filters:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: >-
            Property filters to filter the events by the keys in `properties`
            field of the event
        sort:
          type: string
          description: >-
            Sort by the field. Allowed values (case sensitive): timestamp,
            event_name (default: timestamp)
          example: timestamp
        source:
          type: string
          description: Source to filter the events by the source
        start_time:
          type: string
          description: |-
            Start time of the events to be fetched in ISO 8601 format
            Defaults to last 7 days from now if not provided
          example: '2024-11-09T00:00:00Z'
          format: date-time
    GetEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
        has_more:
          type: boolean
        iter_first_key:
          type: string
        iter_last_key:
          type: string
        offset:
          type: integer
        total_count:
          type: integer
    errors.ErrorResponse:
      type: object
      properties:
        code:
          type: string
          enum:
            - not_found
            - already_exists
            - version_conflict
            - validation_error
            - invalid_operation
            - permission_denied
            - http_client_error
            - database_error
            - system_error
            - internal_error
            - service_unavailable
        details:
          type: object
          additionalProperties:
            type: object
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
    Event:
      type: object
      properties:
        customer_id:
          type: string
        environment_id:
          type: string
        event_name:
          type: string
        external_customer_id:
          type: string
        id:
          type: string
        properties:
          type: object
          additionalProperties: true
        source:
          type: string
        timestamp:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enter your API key in the format *x-api-key &lt;api-key&gt;**
      name: x-api-key
      in: header

````