> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequenzy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview Warehouse Query

> Run a query with a 20-row limit to see its columns

Runs a query with a 20-row limit and returns its columns and rows, so you can build a [sync mapping](/api-reference/warehouse/syncs-create). Only a single `SELECT` or `WITH` statement is accepted; it runs as a subquery. Requires `warehouse:write`.

<ParamField path="id" type="string" required>
  Connection ID.
</ParamField>

<ParamField body="query" type="string" required>
  The query, up to 100,000 characters.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/warehouse-connections/wconn_abc123/preview" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "select email, plan, updated_at from analytics.customers" }'
```

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "columns": [
      {
        "name": "EMAIL",
        "type": "TEXT"
      },
      {
        "name": "PLAN",
        "type": "TEXT"
      },
      {
        "name": "UPDATED_AT",
        "type": "TIMESTAMP_NTZ"
      }
    ],
    "rows": [
      {
        "EMAIL": "ada@example.com",
        "PLAN": "pro",
        "UPDATED_AT": "2026-09-30T11:58:02.000Z"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "code": "invalid_query",
    "error": "Query must be a single SELECT statement (WITH clauses are fine)."
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "code": "query_failed",
    "error": "Snowflake: SQL compilation error: Object 'ANALYTICS.CUSTOMERS' does not exist or not authorized."
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.