---
title: "Parse an C8QL query"
method: POST
path: "/_fabric/{fabric}/_api/query"
tags: ["Query"]
---

# Parse an C8QL query

`POST /_fabric/{fabric}/_api/query`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/query/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint is for query validation only. To query the database, see `/api/cursor`.

## Path parameters

- `fabric` string, string, required

## Request body

- ApiQueryProperties
  - `query` string, required: To validate a query string without executing it, the query string can be passed to the server via an HTTP POST request.

## Response `200`

Successfull fetched *collections* attributes with an array of collections used in the query and *bindVars* attribute with names of the bind parameters found in the query (if any).

If the query is parsed successfully, the *ast* attribute of the returned JSON contain the abstract syntax tree representation of the query. The format of the *ast* is subject to change in future versions of database, but it can be used to inspect how database interprets a given query. Note that the abstract syntax tree is returned without any optimizations applied to it.

- unknown

## Other responses

- `400`: Failed due to missing, malformed data or the query contains a parse error. Verify that all parameters are complete.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
