---
title: "Update connection"
method: PATCH
path: "/v1/connections/{connectionId}"
tags: ["Connections"]
---

# Update connection

`PATCH /v1/connections/{connectionId}`

Update connection properties including credentials. Credentials are encrypted at rest and never returned in API responses.

This endpoint supports credential rotation for infrastructure-as-code workflows. Depending on the connection type, you can update:
- **Password-based connections** (Postgres, MySQL, etc.): Use `passwordUnencrypted` to update the password
- **BigQuery**: Use `passwordUnencrypted` to update the service account JSON
- **Snowflake**: Use `privateKey` to update the RSA private key (PEM format, minimum 2048 bits)

At least one field must be provided in the request body.

## Path parameters

- `connectionId` string, uuid, required

## Request body

- object
  - `passwordUnencrypted` string — Password or service account JSON for credential rotation. - For **password-based connections** such as Postgres, MySQL, etc. - Provide the new password as a string - For **BigQuery** - Provide the entire service account JSON file as a string
  - `privateKey` string — **Only applicable to Snowflake connections**. RSA private key in PEM format for Snowflake connections. Must be at least 2048 bits.
  - `baseRole` string — The default role for users accessing the connection. Available roles include: - `VIEWER` - Can view the model - `QUERIER` - Can view and query the model - `QUERY_TOPICS` - Can query specific topics. Equivalent to **Restricted Querier.** - `MODELER` - Can edit and model the data - `CONNECTION_ADMIN` - Full administrative access to the connection - `NO_ACCESS` - No access to the model - [Custom roles](/administration/users/custom-roles) defined for your organization
  - `environmentUserAttribute` object, nullable — Configuration for environment user attributes. Set to `null` to remove environment user attribute settings.
    - `attributeName` string, required — The name of the user attribute to use for environments
    - `defaultValues` string[], required — Array of default values for the user attribute

## Response `200`

Connection updated successfully

- object
  - `success` boolean
  - `message` string

## Other responses

- `400` — Bad request. Common causes: - Empty or invalid request body - `privateKey` used with non-Snowflake connection - Invalid private key format or insufficient key length - Empty private key provided
- `401` — Missing or invalid authentication
- `403` — Forbidden. User does not have Connection Admin permissions.
- `404` — Not Found - Resource does not exist
- `429` — Too Many Requests - Rate limit exceeded (60 requests/minute)

---

[API](https://skmtc.net/omni/apis/omni-api.md) · [All operations](https://skmtc.net/omni/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omni/omni-api/revisions/6b02f7349d0e/schema)
