---
title: "Execute a read-only SQL query"
method: POST
path: "/api/db-query"
tags: ["Debug"]
---

# Execute a read-only SQL query

`POST /api/db-query`

## Request body

- object
  - `sql` string
  - `query` string — Deprecated runtime alias for sql.
  - `params` unknown[]
    - unknown

## Response `200`

Query results

- object
  - `columns` string[], required
  - `rows` array[], required
    - unknown[]
      - unknown
  - `elapsed` number, required
  - `total` number, required
  - `truncated` boolean, required
  - `rowLimit` number, nullable, required

## Other responses

- `400` — Invalid or disallowed SQL
- `408` — Query exceeded its wall-clock budget and was terminated
- `429` — Too many concurrent bounded db-query executions; retry shortly

## Changes

- **2026-08-27** `e6aa92904448` — 2 info
  - added the required property `rowLimit` to the response with the `200` status
  - added the required property `truncated` to the response with the `200` status
- **2026-08-20** `37b1adfb229c` — 2 info
  - added the non-success response with the status `408`
  - added the non-success response with the status `429`
- **2026-08-07** `06cac6a7c5bc` — 1 info
  - added the media type `application/json` for the response with the status `400`

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/db-query/post.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/81df4899bc59/schema)
