---
title: "Point this project at the customer's own ClickHouse and re-roll the engine (owner/admin)"
method: PUT
path: "/v1/projects/{project_id}/clickhouse"
tags: ["projects"]
---

# Point this project at the customer's own ClickHouse and re-roll the engine (owner/admin)

`PUT /v1/projects/{project_id}/clickhouse`

## Request

- Base URL: `https://api.wavehouse.cloud`
- URL: `https://api.wavehouse.cloud/v1/projects/{project_id}/clickhouse`
- Auth: one of:
  - API key in cookie `whc_session`
  - HTTP bearer
  - API key in header `X-API-Key`

## Path parameters

- `project_id` string, required

## Request body

- ClickHouseConnectionInput
  - `database` string, required: the database the engine writes; it must already exist
  - `host` string, required: hostname of the ClickHouse server, e.g. abc.eu-west-1.aws.clickhouse.cloud
  - `http_port` integer: HTTP interface port; 0 = 8443 with tls, else 8123
  - `native_port` integer: native protocol port; 0 = 9440 with tls, else 9000
  - `password` string, required: write-only; stored as an opaque secret ref and never returned
  - `tls` boolean: speak https/native-TLS; defaults the ports to 8443 and 9440 instead of 8123 and 9000
  - `username` string, required: a user that already holds the required grants on that database

## Response `200`

OK

- ProjectClickHouseOutput
  - `clickhouse` ClickHouseView, required
    - `database` string
    - `host` string: your ClickHouse server; present only when managed is false
    - `http_port` integer
    - `managed` boolean, required: true when WaveHouse operates this ClickHouse; the connection fields are then omitted and data is reached through the project's endpoint
    - `native_port` integer
    - `tls` boolean
    - `username` string
  - `managed_data_deleted_after` string, date-time: when the data WaveHouse-managed ClickHouse held for this project is deleted; switching back before then serves it again
  - `note` string, required: what this change did and did not do to the data
  - `validation` ClickHouseValidationView, required
    - `error` string: why the check stopped, when it did
    - `missing_grants` string[]: privileges the user still needs on the database
    - `ok` boolean, required: true when the engine can be pointed at this connection as it stands
    - `reachable` boolean, required
    - `version` string: the server's version() string

## Other responses

- `429`: Rate limited, per client IP, API key or org; a client IP is also refused on every route for a while after repeated authentication failures. A limited operation carries RateLimit-Policy and RateLimit on every response; wait Retry-After seconds before retrying.
- `default`: Error

---

[API](https://skmtc.dev/wavehouse/apis/wavehouse-cloud-api.md) · [All operations](https://skmtc.dev/wavehouse/apis/wavehouse-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wavehouse/apis/wavehouse-cloud-api/revisions/adea029bf505?raw)
