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

# Query SQL

`POST /v2/sql`

Query records and lists with SQL. Your workspace must be on the Enterprise plan in order to access this endpoint.

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.net/attio/apis/attio-api.md) · [All operations](https://skmtc.net/attio/apis/attio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/attio/attio-api/revisions/6ad6c02e6af9/schema)
