---
title: "Create Connection"
method: POST
path: "/api/v2/connections"
tags: ["Connections"]
---

# Create Connection

`POST /api/v2/connections`

Creates a new ClickHouse connection

## Request body

- CreateConnectionRequest
  - `name` string, required — Display name for the connection.
  - `host` string, required — ClickHouse HTTP endpoint URL.
  - `username` string, required — ClickHouse username.
  - `password` string — ClickHouse password. Never returned by the API.
  - `hyperdxSettingPrefix` string, nullable — Optional prefix for HyperDX-specific ClickHouse settings. Must only contain alphanumeric characters and underscores.
  - `isPrometheusEndpoint` boolean — Optional. When true, `host` is treated as a Prometheus-compatible API endpoint (e.g. Prometheus or Thanos) and PromQL queries are proxied to it. When false or omitted, `host` is a ClickHouse HTTP endpoint.

## Response `200`

Successfully created connection

- ConnectionResponseEnvelope
  - `data` Connection
    - `id` string, required — Unique connection ID.
    - `name` string, required — Display name for the connection.
    - `host` string, required — ClickHouse HTTP endpoint URL.
    - `username` string, required — ClickHouse username.
    - `hyperdxSettingPrefix` string, nullable — Optional prefix for HyperDX-specific ClickHouse settings. Must only contain alphanumeric characters and underscores.
    - `isPrometheusEndpoint` boolean — Optional. When true, `host` is treated as a Prometheus-compatible API endpoint (e.g. Prometheus or Thanos) and PromQL queries are proxied to it. When false or omitted, `host` is a ClickHouse HTTP endpoint.
    - `createdAt` string, date-time — Creation timestamp
    - `updatedAt` string, date-time — Last update timestamp

## Other responses

- `400` — Bad request
- `401` — Unauthorized

## Changes

- **2026-06-26** `a4888dfe2491` — 2 warning, 2 info
  - removed the request property `prometheusEndpoint`
  - removed the optional property `data/prometheusEndpoint` from the response with the `200` status
  - added the new optional request property `isPrometheusEndpoint`
  - added the optional property `data/isPrometheusEndpoint` to the response with the `200` status
- **2026-06-16** `93cfcaa1a7da` — 1 info
  - endpoint added
- **2026-01-30** `ed852374c451` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/hyperdxio/apis/hyperdx-external-api/changes/api/v2/connections/post.md)

---

[API](https://skmtc.dev/hyperdxio/apis/hyperdx-external-api.md) · [All operations](https://skmtc.dev/hyperdxio/apis/hyperdx-external-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hyperdxio/hyperdx-external-api/revisions/3399efdca551/schema)
