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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://axiom.co/docs/feedback

```json
{
  "path": "/restapi/endpoints/queryEdge",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Run APL query to edge deployment

<Warning>
  Use this endpoint to query data from a specific edge deployment. The data you query must be stored in the edge deployment where you query it. For more information, see [Query data](/restapi/ingest) and [Edge deployments](/reference/edge-deployments).

  The base domain for this endpoint is the base domain of the edge deployment where you want to query data.

  | Edge deployment      | Base domain for ingest and query |
  | :------------------- | :------------------------------- |
  | `US East 1 (AWS)`    | `us-east-1.aws.edge.axiom.co`    |
  | `EU Central 1 (AWS)` | `eu-central-1.aws.edge.axiom.co` |

  This endpoint only supports API tokens. Personal access tokens (PATs) aren't supported. For more information, see [Tokens](/reference/tokens).
</Warning>


## OpenAPI

````yaml v1-edge-query post /query/_apl?format=tabular
openapi: 3.0.0
info:
  description: Query execution API for regional Edge deployments
  title: Axiom Query
  termsOfService: http://axiom.co/terms
  contact:
    name: Axiom support team
    url: https://axiom.co
    email: hello@axiom.co
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 2.0.0
servers:
  - url: https://{axiom-domain}/v1/
security: []
paths:
  /query/_apl?format=tabular:
    post:
      tags:
        - query
      operationId: queryApl
      parameters:
        - name: format
          in: query
          required: true
          schema:
            type: string
            enum:
              - legacy
              - tabular
              - tabular-rows
        - name: nocache
          in: query
          schema:
            type: boolean
            default: false
        - name: saveAsKind
          in: query
          schema:
            type: string
        - description: >-
            when saveAsKind is true, this parameter indicates the id of the
            associated dataset
          name: id
          in: query
          schema:
            type: string
        - name: streaming-duration
          in: query
          schema:
            type: string
        - description: >-
            contains the source of the APL query (for example console,
            dashboard, etc.)
          name: apl-source
          in: query
          schema:
            type: string
        - description: contains the id of the source, for example dashboard_id
          name: apl-source-id
          in: query
          schema:
            type: string
        - description: Include a totals table (only supported in MetricsDB)
          name: totals
          in: query
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APLRequestWithOptions'
        required: true
      responses:
        '200':
          description: AplResult
          headers:
            X-Axiom-History-Query-Id:
              schema:
                type: string
            X-QueryLimit-Limit:
              schema:
                type: integer
            X-QueryLimit-Remaining:
              schema:
                type: integer
            X-QueryLimit-Reset:
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AplResult'
        default:
          description: User or system error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryError'
      security:
        - Auth:
            - query|read
components:
  schemas:
    APLRequestWithOptions:
      type: object
      required:
        - apl
      properties:
        apl:
          description: APL query string
          type: string
        cursor:
          description: Pagination cursor
          type: string
        defaultLimit:
          description: |
            The default limit to use when no limit is specified in the query.
          type: integer
        defaultOrder:
          description: |
            The default order to use when no order is specified in the query.
          type: array
          items:
            type: object
            properties:
              desc:
                type: boolean
              field:
                type: string
            x-go-name: APLRequestWithOptionsDefaultOrder
        endTime:
          description: End time for the query range
          type: string
        includeCursor:
          description: Include cursor in response
          type: boolean
        includeCursorField:
          description: Defines if the _cursor field should be projected in the result
          type: boolean
        libraries:
          type: array
          items:
            description: library ids to include in this query
            type: string
        maxBinAutoGroups:
          description: Maximum number of groups to automatically bin into
          type: integer
        queryOptions:
          $ref: '#/components/schemas/QueryOptions'
        startTime:
          description: >-
            start and end time for the query, these must be specified as RFC3339
            strings

            or using relative time expressions (e.g. now-1h, now-1d, now-1w,
            etc)
          type: string
        variables:
          description: >-
            Variables is an optional set of additional variables that are
            inserted into the APL
          type: object
          additionalProperties:
            type: object
    AplResult:
      description: APL query result (streaming binary data)
      type: object
    QueryError:
      type: object
      properties:
        code:
          description: Status is the http status code associated with this error
          type: integer
        detail:
          $ref: '#/components/schemas/QueryErrorDetail'
        message:
          description: a formatted user-facing error message
          type: string
    QueryOptions:
      type: object
      properties:
        against:
          type: string
        againstStart:
          type: string
        againstTimestamp:
          type: string
        aggChartOpts:
          type: string
        caseSensitive:
          type: string
        containsTimeFilter:
          type: string
        datasets:
          type: string
        displayNull:
          type: string
        editorContent:
          type: string
        endColumn:
          type: string
        endLineNumber:
          type: string
        endTime:
          type: string
        integrationsFilter:
          type: string
        nanosecondPrecision:
          type: string
        openIntervals:
          type: string
        overlayCharts:
          type: string
        queryObject:
          type: string
        quickRange:
          type: string
        resolution:
          type: string
        resultsHistogram:
          type: string
        selection:
          type: string
        shownColumns:
          type: string
        startColumn:
          type: string
        startLineNumber:
          type: string
        startTime:
          type: string
        timeSeriesVariant:
          type: string
        timeSeriesView:
          type: string
    QueryErrorDetail:
      type: object
      properties:
        column:
          description: Column is the column associated with this compile type error
          type: integer
          format: int64
        compileErrorCode:
          description: >-
            CompileErrorCode is a special error code that is only available for
            Compile Errors

            It is an integer value that can be used to identify the error
          type: integer
          format: int64
          enum:
            - 1
            - 2
            - 16
            - 17
            - 32
            - 33
            - 34
        errorType:
          description: Error Type is an integer value indicating the kind of error
          type: integer
          format: int64
          enum:
            - 1
            - 2
            - 3
            - 4
        line:
          description: Line is the line associated with this compile type error
          type: integer
          format: int64
        message:
          description: Message is the raw error message without any formatting
          type: string
  securitySchemes:
    Auth:
      description: >-
        Authenticate using an API token or personal access token (PAT). Include
        the token as a Bearer token: `Authorization: Bearer <token>`. For more
        information, see [Tokens](/reference/tokens).
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth
          tokenUrl: https://www.googleapis.com/oauth2/v4/token
          scopes: {}

````