---
title: "Execute a constrained read-only SQL report over authorized datasets"
method: POST
path: "/v1/query/sql-report"
tags: ["Semantic Query"]
---

# Execute a constrained read-only SQL report over authorized datasets

`POST /v1/query/sql-report`

## Request

- Base URL: `https://api.algenta.ai`
- URL: `https://api.algenta.ai/v1/query/sql-report`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Request body

- SQLReportRequest
  - `sources` SQLReportSource[], required
    - `dataset_id` string, required
    - `alias` string, nullable
  - `sql` string, required
  - `max_rows` integer, nullable

## Response `200`

Successful Response

- SQLReportResponse
  - `columns` string[]
  - `rows` object[]
  - `row_count` integer, required
  - `truncated` boolean
  - `request_id` string, nullable
  - `latency_ms` number, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/codna/apis/algenta-api.md) · [All operations](https://skmtc.dev/codna/apis/algenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/codna/apis/algenta-api/revisions/35d30f84a5df?raw)
