> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore a Postgres service

> Restore a Postgres database from continuous backup, optionally at a specific point in time.

Restore a Postgres database from continuous backup, optionally at a specific point in time.

#### Permissions

The API key must have the `control-plane:postgres-service:manage`, `control-plane:organization:create-service` permissions.


## OpenAPI

````yaml /_specs/cloud-openapi.json post /v1/organizations/{organizationId}/postgres/{postgresId}/restoredService
openapi: 3.1.1
info:
  title: OpenAPI spec for ClickHouse Cloud
  version: '1.0'
  contact:
    name: ClickHouse Support
    url: >-
      https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-1451325
    email: support@clickhouse.com
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: Notifications
  - name: User management
  - name: Billing
  - name: Role Management
  - name: Service
  - name: Backup
  - name: Snapshot
  - name: API keys
  - name: Prometheus
  - name: ClickPipes
  - name: ClickStack
  - name: Postgres
  - name: UDF
  - name: Query API endpoints
  - name: Saved queries
paths:
  /v1/organizations/{organizationId}/postgres/{postgresId}/restoredService:
    post:
      tags:
        - Postgres
      summary: Restore a Postgres service
      description: >-
        Restore a Postgres database from continuous backup, optionally at a
        specific point in time.
      operationId: postgresInstanceRestore
      parameters:
        - in: path
          name: organizationId
          description: ID of the organization that owns the Postgres service.
          required: true
          schema:
            type: string
            format: uuid
        - in: path
          name: postgresId
          description: ID of the requested Postgres service.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostgresServiceRestoreRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 200
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
                  result:
                    $ref: '#/components/schemas/PostgresService'
        '400':
          description: >-
            The request cannot be processed due to a client error. Please verify
            your request parameters and try again.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 400
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
        '500':
          description: >-
            An internal server error has occurred. If this issue persists,
            please contact ClickHouse Cloud support for assistance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 500
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
components:
  schemas:
    PostgresServiceRestoreRequest:
      properties:
        name:
          $ref: '#/components/schemas/pgNameProperty'
        restoreTarget:
          $ref: '#/components/schemas/pgPitrRestoreTargetProperty'
        pgConfig:
          $ref: '#/components/schemas/pgConfig'
        pgBouncerConfig:
          $ref: '#/components/schemas/pgBouncerConfig'
        tags:
          $ref: '#/components/schemas/pgTags'
      required:
        - name
        - restoreTarget
    PostgresService:
      properties:
        name:
          $ref: '#/components/schemas/pgNameProperty'
        provider:
          $ref: '#/components/schemas/pgProvider'
        region:
          $ref: '#/components/schemas/pgRegion'
        postgresVersion:
          $ref: '#/components/schemas/pgVersion'
        size:
          $ref: '#/components/schemas/pgSize'
        haType:
          $ref: '#/components/schemas/pgHaType'
        standbyCount:
          $ref: '#/components/schemas/pgStandbyCount'
        tags:
          $ref: '#/components/schemas/pgTags'
        ipAccessList:
          type: array
          description: >-
            IPv4 access rules shown in the console. IPv6 rules are not included.
            Returned when reading or configuring access; omitted from other
            service updates.
          items:
            $ref: '#/components/schemas/PostgresIpAccessListEntry'
        id:
          $ref: '#/components/schemas/pgIdProperty'
        storageSize:
          $ref: '#/components/schemas/pgStorageSize'
        state:
          $ref: '#/components/schemas/pgStateProperty'
        createdAt:
          $ref: '#/components/schemas/pgCreatedAtProperty'
        isPrimary:
          $ref: '#/components/schemas/pgIsPrimaryProperty'
        connectionString:
          description: >-
            Connection string to the Postgres service. Embeds the service
            password, so it is only returned when the service is created or its
            password is reset. Omitted from every other response when Postgres
            credential redaction is enabled for the organization. Not guaranteed
            to be present — treat as optional.
          type: string
        username:
          description: Username for the Postgres service
          type: string
        password:
          description: >-
            Password for the Postgres service. Only returned when the service is
            created or its password is reset. Omitted from every other response
            when Postgres credential redaction is enabled for the organization.
            Not guaranteed to be present — treat as optional.
          type: string
        hostname:
          description: Hostname for the Postgres service
          type: string
        deletionProtection:
          $ref: '#/components/schemas/pgDeletionProtectionProperty'
        earliestRestoreTime:
          description: >-
            Earliest point in time the service can be restored to with the
            restore endpoint. ISO-8601. Only present for a primary service once
            its first backup has completed.
          type: string
          format: date-time
    pgNameProperty:
      type: string
      title: Postgres Service Name
      description: >-
        Name of the Postgres service. Alphanumerical string with whitespaces up
        to 50 characters.
      minLength: 1
      maxLength: 50
    pgPitrRestoreTargetProperty:
      type: string
      format: date-time
      title: PITR Restore Target as an RFC 3339-formatted timestamp in UTC time.
      example: '2026-03-31T18:17:37Z'
      description: >-
        The point in time at which to recover, as either date/time, named
        restore point, or a specific transaction ID.
    pgConfig:
      type: object
      title: Postgres Configuration
      description: >-
        Postgres [runtime
        configuration](https://www.postgresql.org/docs/current/runtime-config.html)
        configuration.
      properties:
        max_connections:
          type:
            - string
            - integer
          description: >-
            Sets the maximum number of concurrent connections to the database
            server.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/max_connections/
          example: 500
          minimum: 1
        default_transaction_isolation:
          type: string
          description: Sets the default transaction isolation level for new transactions.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/default_transaction_isolation/
          example: read committed
          enum:
            - read committed
            - repeatable read
            - serializable
        ssl_min_protocol_version:
          type: string
          description: >-
            Sets the minimum SSL/TLS protocol version allowed for client
            connections.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/ssl_min_protocol_version/
          example: TLSv1.3
          enum:
            - TLSv1
            - TLSv1.1
            - TLSv1.2
            - TLSv1.3
        default_toast_compression:
          type: string
          description: >-
            Sets the default compression method for compressible values stored
            out of line (TOAST).
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/default_toast_compression/
          example: lz4
          enum:
            - pglz
            - lz4
        maintenance_work_mem:
          type:
            - string
            - integer
          description: Sets the maximum memory to be used for maintenance operations.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/maintenance_work_mem/
          example: 64MB
          minimum: 64
        work_mem:
          type:
            - string
            - integer
          description: >-
            Sets the amount of memory Postgres will use for internal operations
            like sorting and hashing as part of executing a query.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/work_mem/
          example: 4MB
          minimum: 64
        effective_cache_size:
          type:
            - string
            - integer
          description: Sets the planner's assumption about the total size of data caches.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/effective_cache_size/
          example: 4GB
          minimum: 8
        random_page_cost:
          type:
            - string
            - number
          description: >-
            Sets the planner's estimate of the cost of a
            non-sequentially-fetched disk page. Lower values (1.1-1.5) are
            better for SSDs.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/random_page_cost/
          example: 1.1
          minimum: 0
        effective_io_concurrency:
          type:
            - string
            - integer
          description: >-
            Number of concurrent disk I/O operations the planner expects. Higher
            values (100-200) benefit SSDs.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/effective_io_concurrency/
          example: 200
          minimum: 0
        max_worker_processes:
          type:
            - string
            - integer
          description: >-
            Maximum number of background processes the system can support.
            Includes parallel query workers, logical replication, and more.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/max_worker_processes/
          example: 8
          minimum: 0
        max_parallel_workers:
          type:
            - string
            - integer
          description: >-
            Maximum number of workers that can be used for parallel operations.
            Cannot exceed max_worker_processes.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/max_parallel_workers/
          example: 4
          minimum: 0
        max_parallel_workers_per_gather:
          type:
            - string
            - integer
          description: >-
            Maximum number of parallel workers per executor node for parallel
            queries. Use 0 to disable parallel queries.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/max_parallel_workers_per_gather/
          example: 2
          minimum: 0
        max_parallel_maintenance_workers:
          type:
            - string
            - integer
          description: >-
            Maximum number of parallel workers for maintenance operations like
            CREATE INDEX and VACUUM.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/max_parallel_maintenance_workers/
          example: 2
          minimum: 0
        shared_memory_percent:
          type:
            - string
            - integer
          description: >-
            Percent of VM memory reserved for the shared_memory, from 25% to
            75%. shared_buffers sized to fit in it. Limited to 50% on VMs with
            memory less or equal 16GB
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/shared_buffers/
          example: 25
          minimum: 25
          maximum: 75
        temp_buffers:
          type:
            - string
            - integer
          description: >-
            Sets the maximum memory each session uses for temporary table
            buffers.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/temp_buffers/
          example: 8MB
          minimum: 800
        hash_mem_multiplier:
          type:
            - string
            - integer
          description: Multiple of work_mem that hash-based operations may use.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/hash_mem_multiplier/
          example: 2
          minimum: 1
          maximum: 1000
        enable_parallel_hash:
          type: string
          description: Enables the planner's use of parallel hash plans.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/enable_parallel_hash/
          example: 'on'
          enum:
            - 'on'
            - 'off'
        maintenance_io_concurrency:
          type:
            - string
            - integer
          description: >-
            Number of concurrent disk I/O operations used for maintenance work
            such as vacuum.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/maintenance_io_concurrency/
          example: 10
          minimum: 0
          maximum: 1000
        io_method:
          type: string
          description: >-
            Selects the method used to perform asynchronous I/O. Postgres 18 and
            later.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/io_method/
          example: worker
          enum:
            - sync
            - worker
            - io_uring
        io_workers:
          type:
            - string
            - integer
          description: >-
            Number of I/O worker processes used when io_method is worker.
            Postgres 18 only.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/io_workers/
          example: 3
          minimum: 1
          maximum: 32
        io_min_workers:
          type:
            - string
            - integer
          description: >-
            Minimum number of I/O worker processes kept running when io_method
            is worker. Postgres 19 and later.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/io_min_workers/
          example: 2
          minimum: 1
          maximum: 32
        io_max_workers:
          type:
            - string
            - integer
          description: >-
            Maximum number of I/O worker processes started when io_method is
            worker. Postgres 19 and later.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/io_max_workers/
          example: 8
          minimum: 1
          maximum: 32
        bgwriter_delay:
          type:
            - string
            - integer
          description: Sleep time between background writer activity rounds.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/bgwriter_delay/
          example: 200ms
          minimum: 10
          maximum: 10000
        bgwriter_flush_after:
          type:
            - string
            - integer
          description: >-
            Amount of data written by the background writer after which the OS
            is asked to flush it to disk.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/bgwriter_flush_after/
          example: 512kB
          minimum: 0
          maximum: 2048
        bgwriter_lru_maxpages:
          type:
            - string
            - integer
          description: Maximum number of buffers the background writer writes per round.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/bgwriter_lru_maxpages/
          example: 100
          minimum: 0
          maximum: 1073741823
        bgwriter_lru_multiplier:
          type:
            - string
            - integer
          description: >-
            Multiple of the average recent buffer demand that the background
            writer cleans per round.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/bgwriter_lru_multiplier/
          example: 2
          minimum: 0
          maximum: 10
        statement_timeout:
          type:
            - string
            - integer
          description: >-
            Abort any statement that runs longer than the specified time. Use 0
            to disable.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/statement_timeout/
          example: 60s
          minimum: 0
        lock_timeout:
          type:
            - string
            - integer
          description: >-
            Abort any statement that waits longer than the specified time while
            attempting to acquire a lock. Use 0 to disable.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/lock_timeout/
          example: 10s
          minimum: 0
        idle_session_timeout:
          type:
            - string
            - integer
          description: >-
            Terminate any session that has been idle for longer than the
            specified time. Use 0 to disable.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/idle_session_timeout/
          example: 2m
          minimum: 0
        idle_in_transaction_session_timeout:
          type:
            - string
            - integer
          description: >-
            Terminate any session that has been idle within an open transaction
            for longer than the specified time. Use 0 to disable.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/idle_in_transaction_session_timeout/
          example: 2h
          minimum: 0
        transaction_timeout:
          type:
            - string
            - integer
          description: >-
            Terminate any statement that takes more than the specified time,
            even while active. Use 0 to disable.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/transaction_timeout/
          example: 120s
          minimum: 0
        wal_sender_timeout:
          type:
            - string
            - integer
          description: >-
            Terminate replication connections that are inactive for longer than
            this time. Use 0 to disable.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/wal_sender_timeout/
          example: 120m
          minimum: 0
        wal_keep_size:
          type:
            - string
            - integer
          description: >-
            Minimum size of past WAL files kept in pg_wal for standby servers.
            Use 0 to disable.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/wal_keep_size/
          example: 1GB
          minimum: 0
        min_wal_size:
          type:
            - string
            - integer
          description: >-
            Minimum size to shrink the WAL to. WAL files are recycled rather
            than removed when below this size.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/min_wal_size/
          example: 80MB
          minimum: 32768
        max_wal_size:
          type:
            - string
            - integer
          description: >-
            Maximum size WAL can grow between checkpoints. Larger values improve
            write performance but increase crash recovery time.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/max_wal_size/
          example: 5GB
          minimum: 32768
        checkpoint_timeout:
          type:
            - string
            - integer
          description: Sets the maximum time between automatic WAL checkpoints.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/checkpoint_timeout/
          example: 5min
          minimum: 30
          maximum: 3600
        max_slot_wal_keep_size:
          type:
            - string
            - integer
          description: >-
            Specifies the maximum size of WAL files that replication slots are
            allowed to retain. Use -1 for unlimited.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/max_slot_wal_keep_size/
          example: '-1'
          minimum: 0
        wal_compression:
          type: string
          description: >-
            Compress full-page writes in WAL. Reduces I/O at the cost of CPU.
            Options vary by PostgreSQL version.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/wal_compression/
          example: lz4
          enum:
            - 'off'
            - 'on'
            - lz4
            - zstd
        wal_buffers:
          type:
            - string
            - integer
          description: >-
            Sets the number of disk-page buffers in shared memory for WAL. A
            number without a unit is in 8 kB pages.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/wal_buffers/
          example: 16MB
          minimum: 32
          maximum: 262144
        max_replication_slots:
          type:
            - string
            - integer
          description: >-
            Maximum number of replication slots. Standbys and logical
            replication each use slots.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/max_replication_slots/
          example: 10
          minimum: 10
          maximum: 262143
        max_wal_senders:
          type:
            - string
            - integer
          description: Maximum number of simultaneously running WAL sender processes.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/max_wal_senders/
          example: 10
          minimum: 10
          maximum: 262143
        max_logical_replication_workers:
          type:
            - string
            - integer
          description: >-
            Maximum number of logical replication workers for subscriptions on
            this server.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/max_logical_replication_workers/
          example: 4
          minimum: 0
          maximum: 262143
        max_repack_replication_slots:
          type:
            - string
            - integer
          description: >-
            Replication slots reserved for REPACK CONCURRENTLY, separate from
            max_replication_slots. Postgres 19 and later.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/max_repack_replication_slots/
          example: 5
          minimum: 0
          maximum: 262143
        max_sync_workers_per_subscription:
          type:
            - string
            - integer
          description: Maximum number of table synchronization workers per subscription.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/max_sync_workers_per_subscription/
          example: 2
          minimum: 0
          maximum: 262143
        logical_decoding_work_mem:
          type:
            - string
            - integer
          description: >-
            Maximum memory used for logical decoding before changes spill to
            disk.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/logical_decoding_work_mem/
          example: 64MB
          minimum: 64
        autovacuum_max_workers:
          type:
            - string
            - integer
          description: >-
            Maximum number of autovacuum worker processes that can run at the
            same time. Workers share a single cost-limit budget, so raising this
            alone may not speed up vacuuming.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/autovacuum_max_workers/
          example: 8
          minimum: 1
        autovacuum_max_parallel_workers:
          type:
            - string
            - integer
          description: >-
            Maximum number of parallel workers a single autovacuum worker can
            use. 0 (the default) turns parallel autovacuum off. Postgres 19 and
            later.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/autovacuum_max_parallel_workers/
          example: 2
          minimum: 0
          maximum: 1024
        autovacuum_naptime:
          type:
            - string
            - integer
          description: >-
            Minimum delay between autovacuum runs. Lower values make autovacuum
            check for work more frequently.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/autovacuum_naptime/
          example: 5s
          minimum: 1
        autovacuum_work_mem:
          type:
            - string
            - integer
          description: >-
            Maximum memory each autovacuum worker uses to track dead tuples.
            Higher values reduce repeated index-vacuum passes on large tables.
            Use -1 to fall back to maintenance_work_mem.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/autovacuum_work_mem/
          example: 64000kB
          minimum: 1024
        autovacuum_vacuum_scale_factor:
          type:
            - string
            - number
          description: >-
            Fraction of a table's rows that must change before autovacuum runs.
            Lower values vacuum large tables more frequently.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/autovacuum_vacuum_scale_factor/
          example: 0.2
          minimum: 0
        autovacuum_analyze_scale_factor:
          type:
            - string
            - number
          description: >-
            Fraction of a table's rows that must change before autovacuum runs
            ANALYZE to refresh planner statistics.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/autovacuum_analyze_scale_factor/
          example: 0.1
          minimum: 0
        autovacuum_vacuum_insert_scale_factor:
          type:
            - string
            - number
          description: >-
            Fraction of a table's rows that must be inserted before autovacuum
            runs. Helps vacuum insert-heavy, rarely-updated tables.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/autovacuum_vacuum_insert_scale_factor/
          example: 0.2
          minimum: 0
        autovacuum_vacuum_threshold:
          type:
            - string
            - integer
          description: Minimum number of tuple updates or deletes prior to vacuum.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/autovacuum_vacuum_threshold/
          example: 50
          minimum: 0
          maximum: 2147483647
        autovacuum_analyze_threshold:
          type:
            - string
            - integer
          description: >-
            Minimum number of tuple inserts, updates, or deletes prior to
            analyze.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/autovacuum_analyze_threshold/
          example: 50
          minimum: 0
          maximum: 2147483647
        autovacuum_vacuum_insert_threshold:
          type:
            - string
            - integer
          description: >-
            Minimum number of tuple inserts prior to vacuum, or -1 to disable
            insert vacuums.
          externalDocs:
            url: >-
              https://postgresqlco.nf/doc/en/param/autovacuum_vacuum_insert_threshold/
          example: 1000
          minimum: -1
          maximum: 2147483647
        autovacuum_freeze_max_age:
          type:
            - string
            - integer
          description: >-
            Age at which to autovacuum a table to prevent transaction ID
            wraparound.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/autovacuum_freeze_max_age/
          example: 200000000
          minimum: 100000
          maximum: 2000000000
        autovacuum_vacuum_cost_limit:
          type:
            - string
            - integer
          description: >-
            Cost-accounting limit shared across all autovacuum workers before
            they pause. Use -1 to inherit vacuum_cost_limit.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/autovacuum_vacuum_cost_limit/
          example: '-1'
          minimum: 1
        autovacuum_vacuum_cost_delay:
          type:
            - string
            - integer
          description: >-
            Time autovacuum sleeps when the cost limit is reached. Lower values
            speed up vacuuming at the cost of more I/O.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/autovacuum_vacuum_cost_delay/
          example: 2ms
          minimum: 0
        vacuum_cost_delay:
          type:
            - string
            - integer
          description: >-
            Time in milliseconds a manual VACUUM sleeps when its cost limit is
            exceeded. 0 disables cost-based delay.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/vacuum_cost_delay/
          example: '0'
          minimum: 0
          maximum: 100
        log_min_duration_statement:
          type:
            - string
            - integer
          description: >-
            Logs statements that run at least this many milliseconds. 0 logs all
            statements; -1 disables.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/log_min_duration_statement/
          example: 1000
          minimum: -1
          maximum: 2147483647
        log_temp_files:
          type:
            - string
            - integer
          description: >-
            Logs temporary files of at least this size in kilobytes. 0 logs all
            temporary files; -1 disables.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/log_temp_files/
          example: '-1'
          minimum: -1
          maximum: 2147483647
        log_lock_waits:
          type: string
          description: >-
            Logs a message when a session waits longer than deadlock_timeout to
            acquire a lock.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/log_lock_waits/
          example: 'off'
          enum:
            - 'on'
            - 'off'
        log_parameter_max_length:
          type:
            - string
            - integer
          description: >-
            Maximum bytes of each bind parameter value logged with statements. 0
            disables; -1 logs values in full.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/log_parameter_max_length/
          example: '-1'
          minimum: -1
          maximum: 1073741823
        track_activity_query_size:
          type:
            - string
            - integer
          description: >-
            Bytes reserved to store the text of the currently running command of
            each session, shown in pg_stat_activity.
          externalDocs:
            url: https://postgresqlco.nf/doc/en/param/track_activity_query_size/
          example: 4096
          minimum: 100
          maximum: 1048576
      additionalProperties: false
      minProperties: 1
      example:
        max_connections: 100
    pgBouncerConfig:
      type: object
      title: PgBouncer Configuration
      description: >-
        PgBouncer [runtime configuration](https://www.pgbouncer.org/config.html)
        configuration.
      additionalProperties:
        type: string
        description: Any PgBouncer configuration parameter.
      minProperties: 1
      maxProperties: 64
      example:
        default_pool_size: '16'
    pgTags:
      type: array
      items:
        $ref: '#/components/schemas/ResourceTagsV1'
      maxItems: 50
      title: Postgres Tags
      description: >-
        Tags associated with the Postgres service. Tag keys starting with “chc_”
        are reserved for internal use.
    pgProvider:
      type: string
      enum:
        - aws
        - gcp
      title: Cloud provider
      description: The cloud provider for a Postgres service.
    pgRegion:
      type: string
      title: Service region
      description: The cloud region for a Postgres service.
    pgVersion:
      type: string
      title: Postgres major version
      enum:
        - '19'
        - '18'
        - '17'
    pgSize:
      type: string
      title: VM size
      description: The VM size for a Postgres service.
      enum:
        - c6gd.large
        - c6gd.xlarge
        - c6gd.2xlarge
        - c6gd.4xlarge
        - c6gd.8xlarge
        - c6gd.16xlarge
        - i7i.large
        - i7i.xlarge
        - i7i.2xlarge
        - i7i.4xlarge
        - i7i.8xlarge
        - i7i.12xlarge
        - i7i.16xlarge
        - i7i.24xlarge
        - i7ie.large
        - i7ie.xlarge
        - i7ie.2xlarge
        - i7ie.3xlarge
        - i7ie.6xlarge
        - i7ie.12xlarge
        - i7ie.18xlarge
        - i7ie.24xlarge
        - i8g.large
        - i8g.xlarge
        - i8g.2xlarge
        - i8g.4xlarge
        - i8g.8xlarge
        - i8g.16xlarge
        - i8g.24xlarge
        - i8ge.large
        - i8ge.xlarge
        - i8ge.2xlarge
        - i8ge.3xlarge
        - i8ge.6xlarge
        - i8ge.12xlarge
        - i8ge.18xlarge
        - i8ge.24xlarge
        - m6gd.large
        - m6gd.xlarge
        - m6gd.2xlarge
        - m6gd.4xlarge
        - m6gd.8xlarge
        - m6gd.16xlarge
        - m6id.large
        - m6id.xlarge
        - m6id.2xlarge
        - m6id.4xlarge
        - m6id.8xlarge
        - m6id.16xlarge
        - m8gd.large
        - m8gd.xlarge
        - m8gd.2xlarge
        - m8gd.4xlarge
        - m8gd.8xlarge
        - m8gd.16xlarge
        - r6gd.medium
        - r6gd.large
        - r6gd.xlarge
        - r6gd.2xlarge
        - r6gd.4xlarge
        - r6gd.8xlarge
        - r6gd.12xlarge
        - r6gd.16xlarge
        - r6id.large
        - r6id.xlarge
        - r6id.2xlarge
        - r6id.4xlarge
        - r6id.8xlarge
        - r6id.12xlarge
        - r6id.16xlarge
        - r6id.24xlarge
        - r6id.32xlarge
        - r8gd.medium
        - r8gd.large
        - r8gd.xlarge
        - r8gd.2xlarge
        - r8gd.4xlarge
        - r8gd.8xlarge
        - r8gd.12xlarge
        - r8gd.16xlarge
        - r8gd.24xlarge
        - r8gd.48xlarge
        - c4a-highmem-lssd-4
        - c4a-highmem-lssd-8
        - c4a-highmem-lssd-16
        - c4a-highmem-lssd-32
        - c4a-highmem-lssd-48
        - c4a-highmem-lssd-64
        - c4a-highmem-lssd-72
        - c4a-standard-lssd-4
        - c4a-standard-lssd-8
        - c4a-standard-lssd-16
        - c4a-standard-lssd-32
        - c4a-standard-lssd-48
        - c4a-standard-lssd-64
        - c4a-standard-lssd-72
        - c4-highmem-lssd-4
        - c4-highmem-lssd-8
        - c4-highmem-lssd-16
        - c4-highmem-lssd-24
        - c4-highmem-lssd-32
        - c4-highmem-lssd-48
        - c4-highmem-lssd-96
        - c4-highmem-lssd-144
        - c4-highmem-lssd-192
        - c4-highmem-lssd-288
        - c4-standard-lssd-4
        - c4-standard-lssd-8
        - c4-standard-lssd-16
        - c4-standard-lssd-24
        - c4-standard-lssd-32
        - c4-standard-lssd-48
        - c4-standard-lssd-96
        - c4-standard-lssd-144
        - c4-standard-lssd-192
        - c4-standard-lssd-288
        - c4d-highmem-lssd-8
        - c4d-highmem-lssd-16
        - c4d-highmem-lssd-32
        - c4d-highmem-lssd-48
        - c4d-highmem-lssd-64
        - c4d-highmem-lssd-96
        - c4d-highmem-lssd-192
        - c4d-highmem-lssd-384
        - c4d-standard-lssd-8
        - c4d-standard-lssd-16
        - c4d-standard-lssd-32
        - c4d-standard-lssd-48
        - c4d-standard-lssd-64
        - c4d-standard-lssd-96
        - c4d-standard-lssd-192
        - c4d-standard-lssd-384
        - c3-standard-lssd-4
        - c3-standard-lssd-8
        - c3-standard-lssd-22
        - c3-standard-lssd-44
        - c3-standard-lssd-88
        - c3-standard-lssd-176
        - c3d-highmem-lssd-8
        - c3d-highmem-lssd-16
        - c3d-highmem-lssd-30
        - c3d-highmem-lssd-60
        - c3d-highmem-lssd-90
        - c3d-highmem-lssd-180
        - c3d-highmem-lssd-360
        - c3d-standard-lssd-8
        - c3d-standard-lssd-16
        - c3d-standard-lssd-30
        - c3d-standard-lssd-60
        - c3d-standard-lssd-90
        - c3d-standard-lssd-180
        - c3d-standard-lssd-360
        - z3-highmem-highlssd-8
        - z3-highmem-highlssd-16
        - z3-highmem-highlssd-22
        - z3-highmem-highlssd-32
        - z3-highmem-highlssd-44
        - z3-highmem-highlssd-88
        - z3-highmem-standardlssd-14
        - z3-highmem-standardlssd-22
        - z3-highmem-standardlssd-44
        - z3-highmem-standardlssd-88
        - z3-highmem-standardlssd-176
        - n2-highmem-2xlssd-4
        - n2-highmem-2xlssd-8
        - n2-highmem-2xlssd-16
        - n2-highmem-2xlssd-32
        - n2-highmem-2xlssd-48
        - n2-highmem-2xlssd-64
        - n2-highmem-2xlssd-96
        - n2-standard-2xlssd-4
        - n2-standard-2xlssd-8
        - n2-standard-2xlssd-16
        - n2-standard-2xlssd-32
        - n2-standard-2xlssd-48
        - n2-standard-2xlssd-64
        - n2-standard-2xlssd-96
        - n2-highmem-4xlssd-2
        - n2-highmem-4xlssd-4
        - n2-highmem-4xlssd-8
        - n2-highmem-4xlssd-16
        - n2-highmem-4xlssd-32
        - n2-highmem-4xlssd-48
        - n2-highmem-8xlssd-2
        - n2-highmem-8xlssd-4
        - n2-highmem-8xlssd-8
        - n2-highmem-8xlssd-16
        - n2-highmem-8xlssd-32
        - n2-highmem-16xlssd-2
        - n2-highmem-16xlssd-4
        - n2-highmem-16xlssd-8
        - n2-highmem-16xlssd-16
    pgHaType:
      type: string
      description: >-
        Type of high availability: “none” for no replication, “async” for
        asynchronous replication to a single standby, and “sync” for synchronous
        replication to the number of standbys in `standbyCount` (two by
        default).
      enum:
        - none
        - async
        - sync
    pgStandbyCount:
      type: integer
      description: >-
        Number of hot standby instances. Accepted values and defaults depend on
        `haType`:

        - “none”: 0 (default)

        - “async”: 1 (default)

        - “sync”: 1, or 2 (default)


        When `haType` is updated without `standbyCount`, the default for the new
        `haType` applies.
      enum:
        - 0
        - 1
        - 2
    PostgresIpAccessListEntry:
      properties:
        id:
          description: >-
            Rule ID returned by the service. Include it when editing an existing
            rule; omit it when creating a rule.
          type: string
        source:
          description: >-
            IPv4 address or CIDR allowed to connect. Returned as a canonical
            CIDR.
          type: string
          example: 203.0.113.0/24
        portRange:
          description: >-
            Port or inclusive range, from 1 to 65535. Use "5432" for Postgres,
            "6432" for PgBouncer, or a range such as "5432..6432".
          type: string
          example: '5432'
        description:
          description: Optional description of the access list entry.
          type: string
      required:
        - source
        - portRange
    pgIdProperty:
      type: string
      title: Unique Postgres service ID
      format: uuid
      example: f71df78e-ddad-82d0-8dfa-abbec741b82e
    pgStorageSize:
      type: integer
      title: Storage Size
      description: >-
        The storage size, in GiB, which must be supported by the specified
        `size`.
    pgStateProperty:
      type: string
      title: Postgres Service State
      description: Current state of the service
      enum:
        - creating
        - restarting
        - running
        - replaying_wal
        - restoring_backup
        - finalizing_restore
        - unavailable
        - stopped
        - deleting
    pgCreatedAtProperty:
      type: string
      format: date-time
      title: Postgres Service creation timestamp
      example: '2026-03-26T20:51:16.384Z'
    pgIsPrimaryProperty:
      type: boolean
      title: Postgres Service is Primary
      description: True if this service is the primary service in the data warehouse
      default: false
    pgDeletionProtectionProperty:
      type: boolean
      title: Postgres Service Deletion Protection
      description: >-
        When true, the service cannot be deleted until deletion protection is
        turned off. Only available for organizations with deletion protection
        enabled.
    ResourceTagsV1:
      type: object
      properties:
        key:
          type: string
          description: Tag key. Must be alphanumeric with dashes, underscores and dots.
          minLength: 1
          maxLength: 128
          pattern: ^[a-zA-Z0-9._-]+$
        value:
          type: string
          description: Tag value. Must be alphanumeric with dashes, underscores and dots.
          maxLength: 256
          pattern: ^[a-zA-Z0-9._-]+$
      required:
        - key
      example:
        key: Environment
        value: staging
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Use key ID and key secret obtained in ClickHouse Cloud console:
        https://clickhouse.com/docs/cloud/manage/openapi
      x-permission-scopes: >-
        The scope list of a `security` requirement holds ClickHouse Cloud API
        key permission ids (for example `control-plane:organization:view`), not
        OAuth scopes. OpenAPI has no field for API key permissions, so this is
        the closest available place. A key must hold every permission listed on
        an operation to call it; an operation with no scopes needs none beyond a
        valid key. Every operation declares at most one requirement object,
        always for this scheme, so the list is only ever conjunctive —
        alternative sets of permissions are never expressed.

````