Skip to main content
POST
Create a Query API endpoint
Creates a Query API endpoint.

Permission

The API key must have the control-plane:service:manage-query-api-endpoints permission.

Autorisations

Authorization
string
header
requis

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

Paramètres de chemin

organizationId
string<uuid>
requis

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>
requis

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)$

Corps

application/json
name
string
requis

Name of the Query API endpoint.

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

SQL executed by the endpoint.

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

Database used by the Query API endpoint.

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

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[]
requis

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.

Réponse

The Query API endpoint was created.

status
integer
requis

HTTP status code.

Exemple:

201

requestId
string<uuid>
requis

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
requis
Dernière modification le 3 octobre 2026