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

# Administration API: Warehouse connections

> Test, create, update, delete, and list the warehouse connections of Bolt, DinoAI agents, the Code IDE, and Radar cost tracking with the Administration API.

Manage a workspace's data warehouse connections from code: test settings before you save them, create and update the connections that Bolt, DinoAI agents, the Code IDE, and Radar use, choose each environment's default, and list them without their secrets.

> [!NOTE]
>
> **Prerequisites:**
>
> * These operations are part of the Enterprise plan. On other plans, they fail with `PLAN_UPGRADE_REQUIRED`.
> * An account API key with the `X-Paradime-Workspace` header, or a workspace API key.
> * The **Warehouse connections admin** capability group. To read a connection's `environment`, the key also needs **Environment admin**.
>
> Keys, errors, pagination, and write-only secrets work the same in every area. See [Conventions](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md).

## Operations

| Operation | Type | What it does | Capability group |
| - | - | - | - |
| [`Workspace.warehouseConnections`](https://docs.paradime.io/graphql-reference/types/Workspace) | Field | Lists the workspace's connections of every scope, without their secrets. | Warehouse connections admin |
| [`testWarehouseConnection`](https://docs.paradime.io/graphql-reference/mutations/testWarehouseConnection) | Mutation | Opens a connection with the settings, and saves nothing. | Warehouse connections admin |
| [`createWarehouseConnection`](https://docs.paradime.io/graphql-reference/mutations/createWarehouseConnection) | Mutation | Tests a new connection, then saves it. | Warehouse connections admin |
| [`updateWarehouseConnection`](https://docs.paradime.io/graphql-reference/mutations/updateWarehouseConnection) | Mutation | Tests a connection's new settings, then saves them. | Warehouse connections admin |
| [`deleteWarehouseConnection`](https://docs.paradime.io/graphql-reference/mutations/deleteWarehouseConnection) | Mutation | Deletes a connection. | Warehouse connections admin |
| [`setDefaultWarehouseConnection`](https://docs.paradime.io/graphql-reference/mutations/setDefaultWarehouseConnection) | Mutation | Makes a connection its environment's default. | Warehouse connections admin |

## Scopes and keys

A connection's `scope` says who uses it. Together with `environmentSlug` and `connectionId`, it names the connection.

| `scope` | Used by | `environmentSlug` |
| - | - | - |
| `SCHEDULER` | The Bolt schedules of a Bolt environment. | Required. `production` names the default Bolt environment when no environment has that slug. |
| `AGENT` | The DinoAI agents of an agent environment. | Required. |
| `DEVELOPMENT_SHARED` | The Code IDE: the part of the connection that every user shares. | Leave it out. |
| `COST` | Radar cost tracking. BigQuery, Firebolt, Redshift, or Snowflake only. | Leave it out. |

* `connectionId` is the connection's id inside its environment. It is `default` when you leave it out. An environment can hold several connections, and one of them is the default. A `COST` connection's id is always `default`.
* `DEVELOPMENT_SHARED` holds only what the workspace shares, such as the Snowflake account or the BigQuery location. Each user enters their own credentials and personal settings when they set up the Code IDE. The API never takes them: a field that each user sets, and `threads`, fail with `VALIDATION_FAILED` on their path.
* `COST` does not use `name`, `targetName`, or `threads`. Sending one fails with `VALIDATION_FAILED`.

## Adapters

Set exactly one field of `adapter`:

| `adapter` field | Warehouse |
| - | - |
| `snowflake` | Snowflake |
| `bigquery` | BigQuery |
| `databricks` | Databricks |
| `redshift` | Amazon Redshift |
| `duckdb` | DuckDB or MotherDuck, set up through its dbt™ profile |
| `firebolt` | Firebolt |
| `profileConnection` | Trino, SQL Server, ClickHouse, or Microsoft Fabric, set up through its dbt™ profile. Set `warehouseType` to `TRINO`, `SQL_SERVER`, `CLICKHOUSE`, or `FABRIC`. |

The reference page of each input type, such as [`createWarehouseConnection`](https://docs.paradime.io/graphql-reference/mutations/createWarehouseConnection), lists its fields and which ones are required. For the warehouse side of each setting, see the [data warehouse integration pages](https://docs.paradime.io/integrations/snowflake/index).

Secret inputs, such as `password`, `privateKey`, `token`, `serviceAccountJson`, and `profile`, are write-only. They take the value, or a reference to a secret in AWS Secrets Manager, Azure Key Vault, or GCP Secret Manager. See [Secrets](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md#secrets).

## Test the settings

`testWarehouseConnection` opens a connection with the settings and saves nothing. A refused connection fails with `CONNECTION_TEST_FAILED`, and the message gives the warehouse's reason. A secret that you leave out comes from the saved connection with the same key, if there is one.

You can't test a `DEVELOPMENT_SHARED` connection: opening it needs a user's own credentials. The test fails with `VALIDATION_FAILED` on `scope`.

```graphql theme={"system"}
mutation TestConnection($input: TestWarehouseConnectionInput!) {
  testWarehouseConnection(input: $input) {
    type
    testedAt
  }
}
```

```json theme={"system"}
{
  "input": {
    "scope": "SCHEDULER",
    "environmentSlug": "production",
    "adapter": {
      "snowflake": {
        "account": "acme-xy12345",
        "role": "TRANSFORMER",
        "database": "ANALYTICS",
        "warehouse": "TRANSFORMING",
        "schema": "DBT_PROD",
        "username": "PARADIME_BOLT",
        "useKeyPairAuth": true,
        "privateKey": "arn:aws:secretsmanager:us-east-1:123456789012:secret:paradime/bolt-key-AbCdEf"
      }
    }
  }
}
```

## Create a connection

`createWarehouseConnection` tests the connection, then saves it. A refused connection fails with `CONNECTION_TEST_FAILED` and saves nothing. A new `SCHEDULER` or `AGENT` connection needs `name`, `targetName`, and `threads`. A new `DEVELOPMENT_SHARED` connection needs `name` and `targetName`. A `COST` connection takes none of them.

After the save, Paradime redeploys the workspace's Bolt schedules. A `COST` connection also starts Radar's cost sync. A `DEVELOPMENT_SHARED` connection is saved without a test, and Paradime rewrites every user's dbt™ profile with it.

Sending the same input again returns the connection unchanged. A connection with the same key and other settings fails with `CONFLICT`: change it with `updateWarehouseConnection`.

```graphql theme={"system"}
mutation CreateConnection($input: CreateWarehouseConnectionInput!) {
  createWarehouseConnection(input: $input) {
    warehouseConnection {
      scope
      connectionId
      type
      isDefault
      name
      targetName
      threads
      updatedAt
      environment {
        slug
      }
      settings {
        __typename
        ... on SnowflakeConnectionSettings {
          account
          role
          useKeyPairAuth
          hasPassword
          hasPrivateKey
        }
      }
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "scope": "SCHEDULER",
    "environmentSlug": "production",
    "name": "Snowflake production",
    "targetName": "prod",
    "threads": 8,
    "adapter": {
      "snowflake": {
        "account": "acme-xy12345",
        "role": "TRANSFORMER",
        "database": "ANALYTICS",
        "warehouse": "TRANSFORMING",
        "schema": "DBT_PROD",
        "username": "PARADIME_BOLT",
        "useKeyPairAuth": true,
        "privateKey": "arn:aws:secretsmanager:us-east-1:123456789012:secret:paradime/bolt-key-AbCdEf"
      }
    }
  }
}
```

> [accordion] Example response
>
> ```json theme={"system"}
> {
>   "data": {
>     "createWarehouseConnection": {
>       "warehouseConnection": {
>         "scope": "SCHEDULER",
>         "connectionId": "default",
>         "type": "SNOWFLAKE",
>         "isDefault": true,
>         "name": "Snowflake production",
>         "targetName": "prod",
>         "threads": 8,
>         "updatedAt": "2026-11-27T10:21:03+00:00",
>         "environment": { "slug": "production" },
>         "settings": {
>           "__typename": "SnowflakeConnectionSettings",
>           "account": "acme-xy12345",
>           "role": "TRANSFORMER",
>           "useKeyPairAuth": true,
>           "hasPassword": false,
>           "hasPrivateKey": true
>         }
>       }
>     }
>   }
> }
> ```

The settings read back show each secret only as a `has…` field, such as `hasPrivateKey`. The value is never returned.

## Update a connection

`updateWarehouseConnection` tests the new settings, then saves them. A connection that does not exist fails with `NOT_FOUND`.

* `adapter` replaces the warehouse settings.
* A secret, `name`, `targetName`, or `threads` that you leave out keeps its stored value.
* If you change the warehouse type, or where the connection points (such as the Snowflake account), send every required secret again. Otherwise the update fails with `VALIDATION_FAILED`.
* A change redeploys the workspace's Bolt schedules, and a `COST` change starts Radar's cost sync. Sending the same input again changes nothing.

```graphql theme={"system"}
mutation UpdateConnection($input: UpdateWarehouseConnectionInput!) {
  updateWarehouseConnection(input: $input) {
    warehouseConnection {
      connectionId
      threads
      updatedAt
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "scope": "SCHEDULER",
    "environmentSlug": "production",
    "threads": 16,
    "adapter": {
      "snowflake": {
        "account": "acme-xy12345",
        "role": "TRANSFORMER",
        "database": "ANALYTICS",
        "warehouse": "TRANSFORMING_L",
        "schema": "DBT_PROD",
        "username": "PARADIME_BOLT",
        "useKeyPairAuth": true
      }
    }
  }
}
```

## List connections

`warehouseConnections` lists the workspace's connections, ordered by environment slug and connection id. Filter with `scope` and `environmentSlug`. A field that a connection's scope does not hold reads `null`.

```graphql theme={"system"}
query ListConnections($scope: ConnectionScope, $first: Int) {
  workspace {
    warehouseConnections(scope: $scope, first: $first) {
      totalCount
      edges {
        node {
          scope
          connectionId
          type
          isDefault
          name
          environment {
            slug
            type
          }
        }
      }
    }
  }
}
```

```json theme={"system"}
{ "scope": "SCHEDULER", "first": 100 }
```

## Delete a connection or change the default

`deleteWarehouseConnection` deletes a connection. Deleting it again is not an error. You can't delete an environment's default connection while the environment has other connections: make another one the default first.

```graphql theme={"system"}
mutation DeleteConnection($input: DeleteWarehouseConnectionInput!) {
  deleteWarehouseConnection(input: $input) {
    deletedConnectionId
  }
}
```

```json theme={"system"}
{
  "input": {
    "scope": "SCHEDULER",
    "environmentSlug": "staging",
    "connectionId": "snowflake-backup"
  }
}
```

`setDefaultWarehouseConnection` makes a connection its environment's default. Here `connectionId` is required.

```graphql theme={"system"}
mutation SetDefaultConnection($input: SetDefaultWarehouseConnectionInput!) {
  setDefaultWarehouseConnection(input: $input) {
    warehouseConnection {
      connectionId
      isDefault
    }
  }
}
```

```json theme={"system"}
{
  "input": {
    "scope": "SCHEDULER",
    "environmentSlug": "staging",
    "connectionId": "snowflake-backup"
  }
}
```

## Errors

These are the cases specific to warehouse connections. For the error format and the codes every area shares, see [Errors](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md#errors).

| Code | When |
| - | - |
| `CONNECTION_TEST_FAILED` | The warehouse refused the connection. Paradime saved nothing. |
| `CONFLICT` | A connection with the same key exists with other settings, on create. Another create of the same connection is still running. The connection is its environment's default and the environment has other connections, on delete. |
| `NOT_FOUND` | The workspace has no environment of the scope with the `environmentSlug`. The connection does not exist, on update or set default. |
| `VALIDATION_FAILED` | `adapter` sets no field, or more than one. A required field is missing. `environmentSlug` is missing for `SCHEDULER` or `AGENT`, or sent for `DEVELOPMENT_SHARED` or `COST`. A `COST` connection's id is not `default`. A field that `DEVELOPMENT_SHARED` or `COST` does not take is set. A test of a `DEVELOPMENT_SHARED` connection. A required secret is missing after a change of type or endpoint. A Snowflake `SCHEDULER` or `AGENT` connection sets `useSso`. |

## Related

* [Python SDK: Connections](https://docs.paradime.io/developers/python-sdk/modules/admin/connections.md): the same operations in `paradime.admin.connections`.
* [Paradime CLI: `paradime admin`](https://docs.paradime.io/developers/paradime-cli/admin-cli): `paradime admin connections` lists, tests, creates, updates, and deletes connections.
* [Connect your data warehouse to each environment](https://docs.paradime.io/products/settings/connections/index.md): the same connections in the app.
* [Data warehouse integrations](https://docs.paradime.io/integrations/snowflake/index): the warehouse-side setup for each adapter.
* [Administration API: Environments](https://docs.paradime.io/developers/graphql-api/admin-api/environments): the Bolt and agent environments that connections belong to.


## Related topics

- [Administration API: Environments](https://docs.paradime.io/developers/graphql-api/admin-api/environments.md)
- [Administration API](https://docs.paradime.io/developers/graphql-api/admin-api/index.md)
- [Administration API: Workspaces](https://docs.paradime.io/developers/graphql-api/admin-api/workspaces.md)
- [Administration API: Conventions](https://docs.paradime.io/developers/graphql-api/admin-api/conventions.md)
- [Administration API: Setup status](https://docs.paradime.io/developers/graphql-api/admin-api/setup-status.md)


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