Skip to main content
POST
Create a Query API endpoint
Beta Disclaimer: This beta endpoint is evolving; the API contract may change.

Creates a Query API endpoint.

Authorizations

Authorization
string
header
required

Use key ID and key secret obtained in ClickHouse Cloud console: https://clickhouse.com/docs/cloud/manage/openapi

Path Parameters

organizationId
string<uuid>
required

ID of the requested organization.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$
serviceId
string<uuid>
required

ID of the requested service.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$

Body

application/json
name
string
required

Name of the Query API endpoint.

Minimum string length: 1
Pattern: \S
sql
string
required

SQL executed by the endpoint.

Maximum string length: 4194304
Pattern: \S
database
string
required

Database used by the Query API endpoint.

Pattern: \S
apiKeyIds
string<uuid>[]
required

API key IDs allowed to call the endpoint.

Minimum array length: 1
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$
roles
string[]
required

Database roles used by the endpoint.

Minimum array length: 1
Minimum string length: 1
parameters
object

Default query parameters.

allowedOrigins
string[]

Origins allowed by the endpoint CORS policy.

Response

The Query API endpoint was created.

status
integer
required

HTTP status code.

Example:

201

requestId
string<uuid>
required

Unique id assigned to every request. UUIDv4

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$
result
object
required
Last modified on September 14, 2026