---
title: "Preview warehouse query"
method: POST
path: "/warehouse-connections/{id}/preview"
tags: ["Warehouse Sync"]
---

# Preview warehouse query

`POST /warehouse-connections/{id}/preview`

## Request

- Base URL: `https://api.sequenzy.com/api/v1`
- URL: `https://api.sequenzy.com/api/v1/warehouse-connections/{id}/preview`
- Auth: HTTP bearer

Runs a SELECT query with a 20-row limit and returns its columns and rows, to build a sync mapping. Requires warehouse:write.

## Path parameters

- `id` string, required

## Request body

- object
  - `query` string, required: A single SELECT or WITH statement.

## Response `200`

Preview returned

- object
  - `success` boolean
  - `columns` object[]
    - `name` string
    - `type` string: Warehouse type name.
  - `rows` object[]

## Other responses

- `400`: The query is not a single SELECT (invalid_query) or the warehouse rejected it (query_failed)
- `401`: Unauthorized
- `403`: Missing scope, or the member role cannot manage workspace settings
- `404`: Not found

## Changes

- **2026-10-16** `db3873ca3d4d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sequenzy/apis/sequenzy-api/changes/warehouse-connections/:id/preview/post.md)

---

[API](https://skmtc.dev/sequenzy/apis/sequenzy-api.md) - [All operations](https://skmtc.dev/sequenzy/apis/sequenzy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sequenzy/apis/sequenzy-api/revisions/3d816357b738?raw)
