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

# Fetch latest query run



## OpenAPI

````yaml get /api/v1/explorer/query-runs
openapi: 3.0.2
info:
  title: Allium API
  version: 0.1.0
servers:
  - url: https://api.allium.so
security: []
paths:
  /api/v1/explorer/query-runs:
    get:
      summary: Get Latest Query Run Handler
      operationId: get_latest_query_run_handler_api_v1_explorer_query_runs_get
      parameters:
        - required: true
          schema:
            title: Query Id
            type: string
          name: query_id
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryRun'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyBearer: []
components:
  schemas:
    QueryRun:
      title: QueryRun
      required:
        - run_id
        - query_id
        - query_config
        - creator_id
        - created_at
        - status
      type: object
      properties:
        run_id:
          type: string
          title: Run Id
        query_id:
          title: Query Id
          type: string
        query_config:
          $ref: '#/components/schemas/QueryConfig'
        creator_id:
          title: Creator Id
          type: string
        created_at:
          title: Created At
          type: string
          format: date-time
        completed_at:
          title: Completed At
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/QueryRunStatus'
        stats:
          $ref: '#/components/schemas/QueryRunStats'
        error:
          title: Error
          type: string
        results:
          $ref: '#/components/schemas/QueryRunResults'
        zed_token:
          title: Zed Token
          type: string
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    QueryConfig:
      title: QueryConfig
      required:
        - sql
        - limit
      type: object
      properties:
        sql:
          title: Sql
          type: string
        limit:
          title: Limit
          type: integer
        parameters:
          title: Parameters
          type: object
          additionalProperties:
            type: string
        datastore_to_use:
          $ref: '#/components/schemas/Datastore'
    QueryRunStatus:
      title: QueryRunStatus
      enum:
        - created
        - queued
        - running
        - success
        - failed
        - canceled
      type: string
      description: An enumeration.
    QueryRunStats:
      title: QueryRunStats
      required:
        - start_time
        - end_time
      type: object
      properties:
        start_time:
          title: Start Time
          type: string
          format: date-time
        end_time:
          title: End Time
          type: string
          format: date-time
        datastore:
          $ref: '#/components/schemas/Datastore'
        sql:
          title: Sql
          type: string
        row_count:
          title: Row Count
          type: integer
        data_size_bytes:
          title: Data Size Bytes
          type: integer
    QueryRunResults:
      title: QueryRunResults
      required:
        - storage_type
      type: object
      properties:
        storage_type:
          $ref: '#/components/schemas/QueryRunResultStorageType'
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
    Datastore:
      title: Datastore
      enum:
        - snowflake
        - postgres
      type: string
      description: An enumeration.
    QueryRunResultStorageType:
      title: QueryRunResultStorageType
      enum:
        - gcs
      type: string
      description: An enumeration.
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````