---
title: "Sets a customer's access to a ClickHouse database to exactly the given relation."
method: PUT
path: "/authorization/relations/clickhouse"
tags: ["ClickHouse"]
---

# Sets a customer's access to a ClickHouse database to exactly the given relation.

`PUT /authorization/relations/clickhouse`

## Request

- Base URL: `https://api.rapidata.ai`
- URL: `https://api.rapidata.ai/authorization/relations/clickhouse`
- Auth: OpenID Connect (`https://auth.rapidata.ai/.well-known/openid-configuration`, scopes: `openid`, `profile`, `email`, `offline_access`, `api`)

Replaces the customer's other relation on the same database. Idempotent. 400 when the database is not grantable.

## Request body

- GrantClickHouseRelationEndpointInput
  - `customer` string, uuid, required: The customer to grant the relation to.
  - `database` string, required: The ClickHouse database name.
  - `relation` 'Reader' | 'Writer', required: Relations a customer holds on a `clickhouse_database`, one object per ClickHouse database name. `writer` folds into `reader`.

## Response `204`

No Content

## Other responses

- `400`: Bad Request
- `401`: Unauthenticated
- `403`: Forbidden

## Changes

- **2026-10-23** `3cf7b4f0003e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rapidata/apis/rapidata-api/changes/authorization/relations/clickhouse/put.md)

---

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