Query API endpoints

Create a Query API endpoint

Creates a Query API endpoint.

post/v1/organizations/{organizationId}/services/{serviceId}/query-api-endpoints

Request

  • Base URL
    https://api.clickhouse.cloud
  • Auth
    HTTP basic

Path parameters

organizationId, string uuid required

ID of the requested organization.

serviceId, string uuid required

ID of the requested service.

Request body

PublicQueryApiEndpointRequest required
name, string required

Name of the Query API endpoint.

sql, string required

SQL executed by the endpoint.

database, string required

Database used by the Query API endpoint.

parameters, object

Default query parameters.

apiKeyIds, string[] required

API key IDs allowed to call the endpoint.

roles, string[] required

Database roles used by the endpoint.

allowedOrigins, string[]

Origins allowed by the endpoint CORS policy.

Response

The Query API endpoint was created.

object required
status, integer required

HTTP status code.

requestId, string uuid required

Unique id assigned to every request. UUIDv4

result, PublicQueryApiEndpoint required

Example response

{
  "status": 201,
  "result": {
    "url": "https://queries.clickhouse.cloud/run/00000000-0000-0000-0000-000000000000"
  }
}

Changes

No recorded changes to this operation across all 35 revisions of this API.