---
title: "Execute structured table query"
method: POST
path: "/v1/spatial/tables/query"
tags: ["Advanced Querying - Queries"]
---

# Execute structured table query

`POST /v1/spatial/tables/query`

## Request

- Base URL: `https://api.cloud.precisely.com`
- URL: `https://api.cloud.precisely.com/v1/spatial/tables/query`
- Auth: one of:
  - `bearerAuth` (a scheme the document does not define)
  - `ApiKeyAuth` (a scheme the document does not define)

Builds and executes an MI SQL SELECT from a structured request body, with optional pagination and micro-batch parameter execution. When 'parametersList' is present (and 'parameters' is absent), the response is a JSON array of FeatureCollections — one per parameter set — instead of a single FeatureCollection.

## Query parameters

- `page` string
- `pageLength` string
- `l` string

## Headers

- `X-Request-Id` string

## Request body

- SqlQueryRequest
  - `select` SelectColumn[], required
    - `expression` string, required
    - `alias` string
  - `from` string, required
  - `joins` JoinClause[]
    - `type` string
    - `table` string
    - `on` string
  - `where` WhereClause
    - `and` WhereCondition[]
      - `field` string
      - `operator` string
      - `value` unknown
    - `or` WhereCondition[]
      - `field` string
      - `operator` string
      - `value` unknown
  - `groupBy` string[]
  - `orderBy` OrderByClause[]
    - `field` string
    - `direction` string
  - `limit` integer
  - `offset` integer
  - `parameters` SqlParameter[]
    - `name` string
    - `value` unknown
    - `crs` object
  - `parametersList` Parameters[]
    - `parameters` SqlParameter[]
      - `name` string
      - `value` unknown
      - `crs` object

## Response `200`

Query executed successfully

## Other responses

- `400`: Invalid query request
- `401`: Unauthorized: Invalid token
- `403`: Forbidden
- `404`: Table not found
- `429`: Too many requests
- `500`: Internal Server Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/precisely/apis/feature-api.md) · [All operations](https://skmtc.dev/precisely/apis/feature-api/llms.txt) · [OpenAPI document](https://skmtc.dev/precisely/apis/feature-api/revisions/6dc26f89c0aa?raw)
