> ## 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.

# Run query

Trigger execution of a saved Explorer query. You will need to [create a query](/app/run-queries) through the Allium App before calling this endpoint.

## Key Parameters

* **Parameterized queries** - Use the `parameters` field to specify parameter values when running a parameterized query
* **Row limit** - Optionally specify a maximum number of rows to return
* **Compute profile** - Optionally specify a [compute profile](/app/query-management/compute-profiles) to run the query on

## Data Export Limit

<Info>
  **Maximum Rows: 250,000**

  We currently allow up to **250,000 rows of data** to be exported through the API for a single query. This limit can be increased on request and helps prevent mishaps when users forget to add `LIMIT` clauses to their queries.
</Info>

## Next Steps

After creating a new query run:

1. [Poll for its status](/api/explorer/fetch-query-run-status) to check if the query has completed
2. [Retrieve the results](/api/explorer/fetch-query-run-results) when execution is finished


## OpenAPI

````yaml post /api/v1/explorer/queries/{query_id}/run-async
openapi: 3.0.2
info:
  title: Allium API
  version: 0.1.0
servers:
  - url: https://api.allium.so
security: []
paths:
  /api/v1/explorer/queries/{query_id}/run-async:
    post:
      summary: Execute Query Async
      operationId: execute_query_async_api_v1_explorer_queries__query_id__run_async_post
      parameters:
        - required: true
          schema:
            title: Query Id
            type: string
          name: query_id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Body_execute_query_async_api_v1_explorer_queries__query_id__run_async_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncQueryRunResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyBearer: []
components:
  schemas:
    Body_execute_query_async_api_v1_explorer_queries__query_id__run_async_post:
      title: >-
        Body_execute_query_async_api_v1_explorer_queries__query_id__run_async_post
      required:
        - parameters
      type: object
      properties:
        parameters:
          title: Parameters
          type: object
          additionalProperties:
            type: string
          description: >-
            Parameter names and values, to be substituted into parameter
            placeholders in the saved query
        run_config:
          title: Run Config
          allOf:
            - $ref: '#/components/schemas/QueryRunRequestConfig'
          default: {}
    AsyncQueryRunResponse:
      properties:
        run_id:
          type: string
          title: Run Id
      type: object
      required:
        - run_id
      title: AsyncQueryRunResponse
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    QueryRunRequestConfig:
      title: QueryRunRequestConfig
      type: object
      properties:
        limit:
          type: integer
          title: Limit
          example: 1000
          description: Limit the number of rows in the result (max 250,000)
        compute_profile:
          title: Compute profile
          type: string
          description: Compute profile identifier
    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
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````