> ## 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.

# Create Warehouse Connection

> Connect Snowflake, BigQuery, Redshift or Postgres

Connects a data warehouse. Sequenzy runs `SELECT 1` with the credentials before saving; if it fails, nothing is saved and the response contains the warehouse's reason. Requires `warehouse:write`.

Use a user that can only read the tables you want to sync. See [Warehouse Sync](/integrations/warehouse-sync) for setup steps per warehouse.

## Request

<ParamField body="name" type="string" required>
  Display name, up to 255 characters.
</ParamField>

<ParamField body="provider" type="string" required>
  `snowflake`, `bigquery`, `redshift` or `postgres`.
</ParamField>

<ParamField body="config" type="object" required>
  Non-secret settings. **snowflake**: `account` (for example `myorg-myaccount`
  or `xy12345.us-east-1`), `username`, `warehouse`, `database`, optional
  `schema` and `role`. **bigquery**: `projectId`, optional `location` (for
  example `US`). **redshift** and **postgres**: `host`, `database`, `username`,
  optional `port` (default `5439` or `5432`) and `sslMode` (`require`, the
  default, or `verify-full`). The host must resolve to a public address.
</ParamField>

<ParamField body="credentials" type="object" required>
  Secrets, stored encrypted and never returned. **snowflake**: `privateKey`
  (PKCS#8 PEM for key-pair authentication) and optional `privateKeyPassphrase`.
  **bigquery**: `serviceAccountJson`, the contents of the service account key
  file. **redshift** and **postgres**: `password`.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/warehouse-connections" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Analytics Postgres",
    "provider": "postgres",
    "config": { "host": "db.example.com", "database": "analytics", "username": "sequenzy_reader" },
    "credentials": { "password": "..." }
  }'
```

<ResponseExample>
  ```json 201 theme={null}
  {
    "success": true,
    "connection": {
      "id": "wconn_abc123",
      "name": "Snowflake prod",
      "provider": "snowflake",
      "config": {
        "account": "myorg-myaccount",
        "username": "SEQUENZY_READER",
        "warehouse": "ANALYTICS_WH",
        "database": "PROD",
        "schema": "PUBLIC",
        "role": "SEQUENZY_READ"
      },
      "status": "connected",
      "lastTestedAt": "2026-09-30T12:00:00.000Z",
      "lastError": null,
      "syncCount": 1,
      "createdAt": "2026-09-30T12:00:00.000Z",
      "updatedAt": "2026-09-30T12:00:00.000Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "code": "connection_failed",
    "error": "Snowflake rejected the credentials: JWT token is invalid. Check the account, user, and that the user's RSA_PUBLIC_KEY matches this private key."
  }
  ```

  ```json 400 theme={null}
  {
    "success": false,
    "code": "connection_failed",
    "error": "Host must resolve to a public internet address."
  }
  ```
</ResponseExample>


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