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

# Update service auto scaling settings

> Updates minimum and maximum total memory limits and idle mode scaling behavior for the service. The memory settings are available only for "production" services and must be a multiple of 12 starting from 24GB. Please contact support to enable adjustment of numReplicas.

Updates minimum and maximum total memory limits and idle mode scaling behavior for the service. The memory settings are available only for "production" services and must be a multiple of 12 starting from 24GB. Please contact support to enable adjustment of numReplicas.


## OpenAPI

````yaml _specs/cloud-openapi.json PATCH /v1/organizations/{organizationId}/services/{serviceId}/scaling
openapi: 3.1.2
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-910487
    email: support@clickhouse.com
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: User management
  - name: Billing
  - name: Role Management
  - name: Service
  - name: Backup
  - name: OpenAPI
  - name: Prometheus
  - name: ClickPipes
  - name: ClickStack
  - name: Postgres
paths:
  /v1/organizations/{organizationId}/services/{serviceId}/scaling:
    patch:
      tags:
        - Service
      summary: Update service auto scaling settings
      description: >-
        Updates minimum and maximum total memory limits and idle mode scaling
        behavior for the service. The memory settings are available only for
        "production" services and must be a multiple of 12 starting from 24GB.
        Please contact support to enable adjustment of numReplicas.
      operationId: instanceScalingUpdate
      parameters:
        - in: path
          name: organizationId
          description: ID of the organization that owns the service.
          required: true
          schema:
            type: string
            format: uuid
        - in: path
          name: serviceId
          description: ID of the service to update scaling parameters.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceScalingPatchRequest'
      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/Service'
        '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
      deprecated: true
components:
  schemas:
    ServiceScalingPatchRequest:
      properties:
        minTotalMemoryGb:
          description: >-
            DEPRECATED - inaccurate for services with non-default numbers of
            replicas. Use `minReplicaMemoryGb` instead. Minimum memory of three
            workers during auto-scaling in Gb. Available only for 'production'
            services. Must be a multiple of 12 and greater than or equal to 24.
            Always absent for horizontal-autoscaling services (replica count is
            variable).
          type: number
          minimum: 24
          maximum: 1068
          multipleOf: 12
          example: 48
          deprecated: true
        maxTotalMemoryGb:
          description: >-
            DEPRECATED - inaccurate for services with non-default numbers of
            replicas. Use `maxReplicaMemoryGb` instead. Maximum memory of three
            workers during auto-scaling in Gb. Available only for 'production'
            services. Must be a multiple of 12 and lower than or equal to 360
            for non paid services or 1068 for paid services. Always absent for
            horizontal-autoscaling services (replica count is variable).
          type: number
          minimum: 24
          maximum: 1068
          multipleOf: 12
          example: 360
          deprecated: true
        numReplicas:
          description: >-
            Number of replicas for the service. The number of replicas must be
            between 2 and 20 for the first service in a warehouse. Services that
            are created in an existing warehouse can have a number of replicas
            as low as 1. Further restrictions may apply based on your
            organization's tier. It defaults to 1 for the BASIC tier and 3 for
            the SCALE and ENTERPRISE tiers.
          type: integer
          minimum: 1
          maximum: 20
          example: 3
        idleScaling:
          description: >-
            When set to true the service is allowed to scale down to zero when
            idle. True by default.
          type: boolean
        idleTimeoutMinutes:
          description: Set minimum idling timeout (in minutes). Must be >= 5 minutes.
          type: number
    Service:
      properties:
        id:
          description: Unique service ID.
          type: string
          format: uuid
        name:
          description: >-
            Name of the service. Alphanumerical string with whitespaces up to 50
            characters.
          type: string
          maxLength: 50
          minLength: 1
        provider:
          description: Cloud provider
          type: string
          enum:
            - aws
            - gcp
            - azure
        region:
          description: Service region.
          type: string
          enum:
            - ap-northeast-1
            - ap-northeast-2
            - ap-south-1
            - ap-southeast-1
            - ap-southeast-2
            - ca-central-1
            - eu-central-1
            - eu-west-1
            - eu-west-2
            - il-central-1
            - us-east-1
            - us-east-2
            - us-west-2
            - us-east1
            - us-central1
            - europe-west2
            - europe-west4
            - asia-southeast1
            - asia-northeast1
            - eastus
            - eastus2
            - westus3
            - germanywestcentral
            - centralus
        state:
          description: Current state of the service.
          type: string
          enum:
            - starting
            - stopping
            - terminating
            - softdeleting
            - awaking
            - partially_running
            - provisioning
            - running
            - stopped
            - terminated
            - softdeleted
            - degraded
            - failed
            - idle
        clickhouseVersion:
          description: ClickHouse version of the service.
          type: string
        endpoints:
          type: array
          description: List of all service endpoints.
          items:
            $ref: '#/components/schemas/ServiceEndpoint'
        tier:
          description: >-
            DEPRECATED for BASIC, SCALE and ENTERPRISE organization tiers. Use
            `minReplicaMemoryGb`, `maxReplicaMemoryGb`, and `numReplicas`
            instead. Tier of the service: 'development', 'production',
            'dedicated_high_mem', 'dedicated_high_cpu', 'dedicated_standard',
            'dedicated_standard_n2d_standard_4',
            'dedicated_standard_n2d_standard_8',
            'dedicated_standard_n2d_standard_32',
            'dedicated_standard_n2d_standard_128',
            'dedicated_standard_n2d_standard_32_16SSD',
            'dedicated_standard_n2d_standard_64_24SSD'. Production services
            scale, Development are fixed size. Azure services don't support
            Development tier
          type: string
          enum:
            - development
            - production
            - dedicated_high_mem
            - dedicated_high_cpu
            - dedicated_standard
            - dedicated_standard_n2d_standard_4
            - dedicated_standard_n2d_standard_8
            - dedicated_standard_n2d_standard_32
            - dedicated_standard_n2d_standard_128
            - dedicated_standard_n2d_standard_32_16SSD
            - dedicated_standard_n2d_standard_64_24SSD
          deprecated: true
        minTotalMemoryGb:
          description: >-
            DEPRECATED - inaccurate for services with non-default numbers of
            replicas. Use `minReplicaMemoryGb` instead. Minimum memory of three
            workers during auto-scaling in Gb. Available only for 'production'
            services. Must be a multiple of 12 and greater than or equal to 24.
            Always absent for horizontal-autoscaling services (replica count is
            variable).
          type: number
          minimum: 24
          maximum: 1068
          multipleOf: 12
          example: 48
          deprecated: true
        maxTotalMemoryGb:
          description: >-
            DEPRECATED - inaccurate for services with non-default numbers of
            replicas. Use `maxReplicaMemoryGb` instead. Maximum memory of three
            workers during auto-scaling in Gb. Available only for 'production'
            services. Must be a multiple of 12 and lower than or equal to 360
            for non paid services or 1068 for paid services. Always absent for
            horizontal-autoscaling services (replica count is variable).
          type: number
          minimum: 24
          maximum: 1068
          multipleOf: 12
          example: 360
          deprecated: true
        minReplicaMemoryGb:
          description: >-
            Minimum total memory of each replica during auto-scaling in Gb. A
            range in vertical autoscaling; equal to maxReplicaMemoryGb in
            horizontal (memory is fixed while the replica count scales). Must be
            a multiple of 4 and greater than or equal to 8.
          type: number
          minimum: 8
          maximum: 356
          multipleOf: 4
          example: 16
        maxReplicaMemoryGb:
          description: >-
            Maximum total memory of each replica during auto-scaling in Gb. A
            range in vertical autoscaling; equal to minReplicaMemoryGb in
            horizontal (memory is fixed while the replica count scales). Must be
            a multiple of 4 and lower than or equal to 120* for non paid
            services or 356* for paid services.* - maximum replica size subject
            to cloud provider hardware availability in your selected region. 
          type: number
          minimum: 8
          maximum: 356
          multipleOf: 4
          example: 120
        numReplicas:
          description: >-
            Number of replicas for the service. The number of replicas must be
            between 2 and 20 for the first service in a warehouse. Services that
            are created in an existing warehouse can have a number of replicas
            as low as 1. Further restrictions may apply based on your
            organization's tier. It defaults to 1 for the BASIC tier and 3 for
            the SCALE and ENTERPRISE tiers. Present only when the service uses
            vertical autoscaling. For horizontal autoscaling, use minReplicas
            and maxReplicas instead.
          type: integer
          minimum: 1
          maximum: 20
          example: 3
        minReplicas:
          description: >-
            Minimum number of replicas for horizontal autoscaling. Present only
            when the service uses horizontal autoscaling.
          type: integer
          minimum: 1
          maximum: 20
          example: 1
        maxReplicas:
          description: >-
            Maximum number of replicas for horizontal autoscaling. Present only
            when the service uses horizontal autoscaling.
          type: integer
          minimum: 1
          maximum: 20
          example: 5
        autoscalingMode:
          description: >-
            Configured autoscaling mode. "vertical" runs a fixed replica count
            while memory scales between minReplicaMemoryGb and
            maxReplicaMemoryGb; "horizontal" scales the replica count between
            minReplicas and maxReplicas at a fixed per-replica memory. This is
            the baseline configuration; the mode currently applied (which may
            differ while a schedule entry is active) is
            currentScaling.effectiveAutoscalingMode.
          type: string
          enum:
            - vertical
            - horizontal
          example: vertical
        replicaMemoryGb:
          description: >-
            Fixed memory per replica in Gb for horizontal autoscaling. Present
            only when the service uses horizontal autoscaling. Must be a
            multiple of 4, at least 8 Gb, and at most 120 Gb for non paid
            services or 356 Gb for paid services.
          type: number
          minimum: 8
          maximum: 356
          multipleOf: 4
          example: 32
        idleScaling:
          description: >-
            When set to true the service is allowed to scale down to zero when
            idle. True by default.
          type: boolean
        idleTimeoutMinutes:
          description: Set minimum idling timeout (in minutes). Must be >= 5 minutes.
          type: number
        ipAccessList:
          type: array
          description: List of IP addresses allowed to access the service
          items:
            $ref: '#/components/schemas/IpAccessListEntry'
        createdAt:
          description: Service creation timestamp. ISO-8601.
          type: string
          format: date-time
        encryptionKey:
          description: Optional customer provided disk encryption key
          type: string
        encryptionAssumedRoleIdentifier:
          description: Optional role to use for disk encryption
          type: string
        iamRole:
          description: IAM role used for accessing objects in s3
          type: string
        privateEndpointIds:
          type: array
          description: List of private endpoints
          items:
            type: string
        availablePrivateEndpointIds:
          type: array
          description: >-
            List of available private endpoints ids that can be attached to the
            service
          items:
            type: string
        dataWarehouseId:
          description: Data warehouse containing this service
          type: string
        isPrimary:
          description: True if this service is the primary service in the data warehouse
          type: boolean
        isReadonly:
          description: >-
            True if this service is read-only. It can only be read-only if a
            dataWarehouseId is provided.
          type: boolean
        releaseChannel:
          description: >-
            Select fast if you want to get new ClickHouse releases as soon as
            they are available. You'll get new features faster, but with a
            higher risk of bugs. Select slow if you would like to defer releases
            to give yourself more time to test. This feature is only available
            for production services. default is the regular release channel.
          type: string
          enum:
            - slow
            - default
            - fast
        byocId:
          description: >-
            This is the ID returned after setting up a region for Bring Your Own
            Cloud (BYOC). When the byocId parameter is specified, the
            minReplicaMemoryGb and the maxReplicaGb parameters are required too,
            with values included among the following sizes: 48, 116, 172, 232.
          type: string
        hasTransparentDataEncryption:
          description: >-
            True if the service should have the Transparent Data Encryption
            (TDE) enabled. TDE is only available for ENTERPRISE organizations
            tiers and can only be enabled at service creation.
          type: boolean
        profile:
          description: >-
            Custom instance profile. Only available for ENTERPRISE organization
            tiers.
          type: string
          enum:
            - v1-default
            - v1-highmem-xs
            - v1-highmem-s
            - v1-highmem-m
            - v1-highmem-l
            - v1-highmem-xl
        transparentDataEncryptionKeyId:
          description: >-
            The ID of the Transparent Data Encryption key used for the service.
            This is only available if hasTransparentDataEncryption is true.
          type: string
        encryptionRoleId:
          description: >-
            The ID of the IAM role used for encryption. This is only available
            if hasTransparentDataEncryption is true.
          type: string
        complianceType:
          description: Type of regulatory compliance for service.
          type: string
          enum:
            - hipaa
            - pci
        tags:
          type: array
          description: Tags associated with the service.
          items:
            $ref: '#/components/schemas/ResourceTagsV1'
          maxItems: 50
        enableCoreDumps:
          description: >-
            True if the service's underline infra is enabled for collecting core
            dumps. This is an experimental feature
          type: boolean
        scalingSchedule:
          $ref: '#/components/schemas/ScalingSchedule'
        currentScaling:
          $ref: '#/components/schemas/CurrentScaling'
      required:
        - autoscalingMode
        - currentScaling
    ServiceEndpoint:
      properties:
        protocol:
          description: 'Endpoint protocol: ''https'', ''nativesecure'', ''mysql''.'
          type: string
          enum:
            - https
            - nativesecure
            - mysql
          example: mysql
        host:
          description: Service host name
          type: string
        port:
          description: Numeric port
          type: number
        username:
          description: Optional username for the endpoint
          type:
            - string
            - 'null'
    IpAccessListEntry:
      properties:
        source:
          description: IP or CIDR
          type: string
        description:
          description: >-
            Optional description of IPv4 address or IPv4 CIDR to allow access
            from
          type: string
    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
    ScalingSchedule:
      properties:
        entries:
          type: array
          description: List of schedule entries.
          items:
            $ref: '#/components/schemas/ScalingScheduleEntry'
        baseConfig:
          $ref: '#/components/schemas/ScalingScheduleBaseConfig'
        activeEntryId:
          description: >-
            ID of the currently-active schedule entry. Absent when no entry is
            active and the base config is in effect.
          type: string
          format: uuid
      required:
        - entries
        - baseConfig
    CurrentScaling:
      properties:
        effectiveAutoscalingMode:
          description: >-
            Autoscaling mode currently in effect on the running service. May
            diverge from the configured baseline mode while a schedule entry is
            active.
          type: string
          enum:
            - vertical
            - horizontal
        effectiveMinReplicaMemoryGb:
          description: >-
            Minimum memory per replica (Gb) currently applied to the running
            service. May diverge from the top-level `minReplicaMemoryGb`
            baseline while a schedule entry is active.
          type: number
        effectiveMaxReplicaMemoryGb:
          description: >-
            Maximum memory per replica (Gb) currently applied to the running
            service. May diverge from the top-level `maxReplicaMemoryGb`
            baseline while a schedule entry is active. Reflects the stored
            value: normally equal to `effectiveMinReplicaMemoryGb` in horizontal
            mode, but a legacy service stored with an unequal memory range
            reports the stored bounds as-is.
          type: number
        effectiveMinReplicas:
          description: >-
            Minimum number of replicas currently applied to the running service.
            May diverge from the baseline while a schedule entry is active.
            Reflects the stored value: normally equal to `effectiveMaxReplicas`
            in vertical mode (a fixed replica count), but a legacy service
            stored with an unequal replica range reports the stored bounds
            as-is.
          type: integer
        effectiveMaxReplicas:
          description: >-
            Maximum number of replicas currently applied to the running service.
            May diverge from the baseline while a schedule entry is active.
          type: integer
        effectiveIdleScaling:
          description: >-
            Whether idle scaling is currently in effect on the service. May
            diverge from the top-level `idleScaling` baseline while a schedule
            entry is active.
          type: boolean
        effectiveIdleTimeoutMinutes:
          description: >-
            Idle timeout in minutes currently in effect on the service. May
            diverge from the top-level `idleTimeoutMinutes` baseline while a
            schedule entry is active.
          type: integer
        activeEntryId:
          description: >-
            ID of the schedule entry whose values are currently applied to the
            service. Absent when no entry is active.
          type: string
          format: uuid
    ScalingScheduleEntry:
      properties:
        id:
          description: Unique identifier for this schedule entry.
          type: string
          format: uuid
        name:
          description: Human-readable label for this schedule entry.
          type: string
        weekdays:
          type: array
          description: >-
            Days of the week this entry applies to. 0 = Sunday, 1 = Monday, …, 6
            = Saturday.
          items:
            type: integer
          minItems: 1
        startHourUtc:
          description: UTC hour (0–23) when this entry becomes active (inclusive).
          type: integer
          minimum: 0
          maximum: 23
        endHourUtc:
          description: >-
            UTC hour (1–24) when this entry deactivates (exclusive). Must differ
            from startHourUtc. Set to 24 to end at midnight. Values less than
            startHourUtc create an overnight window spanning midnight.
          type: integer
          minimum: 1
          maximum: 24
        autoscalingMode:
          description: >-
            Autoscaling mode for this entry. "vertical" runs a fixed replica
            count while memory scales; "horizontal" scales the replica count at
            a fixed per-replica memory. Defaults to "vertical" for entries
            persisted before the mode was exposed.
          type: string
          enum:
            - vertical
            - horizontal
        minReplicaMemoryGb:
          description: >-
            Minimum memory per replica (Gb) during this window. A range in
            vertical; in horizontal it equals maxReplicaMemoryGb (memory is
            fixed while the replica count scales).
          type: number
        maxReplicaMemoryGb:
          description: >-
            Maximum memory per replica (Gb) during this window. A range in
            vertical; in horizontal it equals minReplicaMemoryGb (memory is
            fixed while the replica count scales).
          type: number
        minReplicas:
          description: >-
            Minimum number of replicas during this window. For a horizontal
            entry the replica count scales between minReplicas and maxReplicas;
            for a vertical entry minReplicas and maxReplicas are equal and
            report the fixed replica count (both omitted when the entry stored
            no count).
          type: integer
        maxReplicas:
          description: >-
            Maximum number of replicas during this window. For a horizontal
            entry the replica count scales between minReplicas and maxReplicas;
            for a vertical entry minReplicas and maxReplicas are equal and
            report the fixed replica count (both omitted when the entry stored
            no count).
          type: integer
        idleScaling:
          description: Whether idle scaling is enabled during this window.
          type: boolean
        idleTimeoutMinutes:
          description: Idle timeout in minutes during this window.
          type: integer
        isActiveNow:
          description: >-
            Whether this entry is currently active. Scheduled times are
            indicative — actions are applied on a best-effort basis and may be
            delayed by a few minutes.
          type: boolean
      required:
        - id
        - name
        - weekdays
        - startHourUtc
        - endHourUtc
        - autoscalingMode
        - isActiveNow
    ScalingScheduleBaseConfig:
      properties:
        autoscalingMode:
          description: >-
            Autoscaling mode applied when no schedule entry is active.
            "vertical" runs a fixed replica count while memory scales;
            "horizontal" scales the replica count at a fixed per-replica memory.
          type: string
          enum:
            - vertical
            - horizontal
        minReplicaMemoryGb:
          description: Minimum memory per replica (Gb) when no schedule entry is active.
          type: number
        maxReplicaMemoryGb:
          description: Maximum memory per replica (Gb) when no schedule entry is active.
          type: number
        minReplicas:
          description: Minimum number of replicas when no schedule entry is active.
          type: integer
        maxReplicas:
          description: Maximum number of replicas when no schedule entry is active.
          type: integer
        idleScaling:
          description: Whether idle scaling is enabled when no schedule entry is active.
          type: boolean
        idleTimeoutMinutes:
          description: Idle timeout in minutes when no schedule entry is active.
          type: integer
  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

````