Skip to main content
POST
Create a saved query
Creates a saved query.

Permission

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

授权

Authorization
string
header
必填

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

路径参数

organizationId
string<uuid>
必填

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>
必填

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

请求体

application/json
name
string
必填

Name of the saved query.

Minimum string length: 1
sql
string
必填

Saved SQL query.

Maximum string length: 4194304
database
string
必填

Database used by the saved query.

parameters
object

Default query parameters.

响应

The saved query was created.

status
integer
必填

HTTP status code.

示例:

201

requestId
string<uuid>
必填

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
必填
最后修改于 2026年10月14日