---
title: "Query external tables"
method: POST
path: "/query"
tags: ["query"]
---

# Query external tables

`POST /query`

Executes one read-only SELECT against the authenticated tenant's materialized external tables. Call /query/schema first to discover logical table and column names. Authorization is tenant-wide in Phase 1; principal-level row authorization is not applied.

## Request body

- ExternalTableQueryRequest
  - `sql` string, required — A single read-only SELECT using logical table names

## Response `200`

Bounded query result

- ExternalTableQueryResponse
  - `columns` string[], required
  - `rows` object[], required
  - `row_count` integer, required
  - `truncated` boolean, required

## Other responses

- `400` — Invalid or disallowed SQL
- `401` — Unauthorized
- `422` — Request validation failed
- `503` — Published snapshot is unavailable

## Changes

> 55 revisions in range; 2 not diffed.

- **2026-07-26** `67d44efb04be` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/qlonolink/apis/qaip-apis/changes/query/post.md)

---

[API](https://skmtc.dev/qlonolink/apis/qaip-apis.md) · [All operations](https://skmtc.dev/qlonolink/apis/qaip-apis/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qlonolink/qaip-apis/revisions/4a41832eefde/schema)
