---
title: "Execute SQL query"
method: POST
path: "/storage/query"
tags: ["Storage - Query"]
---

# Execute SQL query

`POST /storage/query`

Execute a read-only SELECT query against the workspace's storage warehouse. Tables must be referenced as [datasetSlug].[modelSlug] and are rewritten to the underlying warehouse table under the hood.

## Request body

- object — Request body schema.
  - `query` string, required — A read-only SELECT statement. Tables must be referenced as [datasetSlug].[modelSlug] and are rewritten to the underlying warehouse table under the hood. Example: "SELECT count() FROM my_dataset.my_model"

## Response `200`

Successful response

- object
  - `rows` object[], required — Result rows.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `500` — Internal server error

---

[API](https://skmtc.net/getcargo/apis/cargo-api.md) · [All operations](https://skmtc.net/getcargo/apis/cargo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getcargo/cargo-api/versions/1d5a19e01d83/schema)
