> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-home-button.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Создать или обновить эндпоинт запроса сервиса для указанного экземпляра

> Это экспериментальная возможность. Чтобы включить её, обратитесь в службу поддержки.



## OpenAPI

````yaml /ru/products/cloud/api-reference/cloud-openapi.json post /v1/organizations/{organizationId}/services/{serviceId}/serviceQueryEndpoint
openapi: 3.0.1
info:
  contact:
    email: support@clickhouse.com
    name: ClickHouse Support
    url: >-
      https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-299828
  title: OpenAPI spec for ClickHouse Cloud
  version: '1.0'
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: User management
  - name: Billing
  - name: Service
  - name: Backup
  - name: OpenAPI
  - name: Prometheus
  - name: ClickPipes
paths:
  /v1/organizations/{organizationId}/services/{serviceId}/serviceQueryEndpoint:
    post:
      tags:
        - Service
      summary: Создать или обновить эндпоинт запроса сервиса для указанного экземпляра
      description: >-
        Это экспериментальная возможность. Чтобы включить её, обратитесь в
        службу поддержки.
      parameters:
        - description: Идентификатор запрошенной организации.
          in: path
          name: organizationId
          required: true
          schema:
            format: uuid
            type: string
        - description: ID запрошенного сервиса.
          in: path
          name: serviceId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstanceServiceQueryApiEndpointsPostRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    description: >-
                      Уникальный идентификатор, присваиваемый каждому запросу.
                      UUIDv4
                    format: uuid
                    type: string
                  result:
                    $ref: '#/components/schemas/ServiceQueryAPIEndpoint'
                  status:
                    description: Код состояния HTTP.
                    example: 200
                    type: number
                type: object
          description: Успешный ответ
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: Подробное описание ошибки.
                    type: string
                  status:
                    description: Код состояния HTTP.
                    example: 400
                    type: number
                type: object
          description: >-
            Сервер не может или не будет обрабатывать запрос из-за ошибки,
            которая расценивается как ошибка клиента.
components:
  schemas:
    InstanceServiceQueryApiEndpointsPostRequest:
      properties:
        allowedOrigins:
          description: Разрешенные источники в виде списка доменов, разделенных запятыми
          type: string
        openApiKeys:
          description: Версия эндпоинта запроса сервиса
          items:
            type: string
          type: array
        roles:
          description: Роли
          items:
            enum:
              - sql_console_read_only
              - sql_console_admin
            type: string
          type: array
    ServiceQueryAPIEndpoint:
      properties:
        allowedOrigins:
          description: Разрешённые источники в виде списка доменов, разделённых запятыми
          type: string
        id:
          description: Идентификатор эндпоинта запроса сервиса
          type: string
        openApiKeys:
          description: >-
            Список ключей OpenAPI, которые могут обращаться к эндпоинту запроса
            сервиса
          items:
            type: string
          type: array
        roles:
          description: Список ролей, которые могут обращаться к эндпоинту запроса сервиса
          items:
            enum:
              - sql_console_read_only
              - sql_console_admin
            type: string
          type: array
  securitySchemes:
    basicAuth:
      description: >-
        Используйте идентификатор ключа и секрет ключа, полученные в консоли
        ClickHouse Cloud: https://clickhouse.com/docs/cloud/manage/openapi
      scheme: basic
      type: http

````