---
title: "Query SQL"
method: POST
path: "/v2/sql"
tags: ["SQL"]
---

# Query SQL

`POST /v2/sql`

Query records and lists with SQL.

This endpoint is in beta. We will aim to avoid breaking changes, but small updates may be made as we roll out to more users.

Required scopes: `record_permission:read`, `object_configuration:read`.

## Request body

- object
  - `sql` string, required — The SQL query to be executed.

## Response `200`

Success

- object — Success
  - `data` object, required
    - `rows` object[], required

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.dev/attio/apis/attio-api.md) · [All operations](https://skmtc.dev/attio/apis/attio-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/attio/attio-api/revisions/f24ddc288c35/schema)
