---
title: "PATCH /v1/projects/{projectsId}/instances/{instancesId}"
method: PATCH
path: "/v1/projects/{projectsId}/instances/{instancesId}"
tags: ["projects"]
---

# PATCH /v1/projects/{projectsId}/instances/{instancesId}

`PATCH /v1/projects/{projectsId}/instances/{instancesId}`

## Request

- Base URL: `https://spanner.googleapis.com`
- URL: `https://spanner.googleapis.com/v1/projects/{projectsId}/instances/{instancesId}`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/spanner.admin`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/spanner.admin`

Updates an instance, and begins allocating or releasing resources as requested. The returned long-running operation can be used to track the progress of updating the instance. If the named instance does not exist, returns `NOT_FOUND`. Immediately upon completion of this request: * For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level. Until completion of the returned operation: * Cancelling the operation sets its metadata's cancel_time, and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a `CANCELLED` status. * All other attempts to modify the instance are rejected. * Reading the instance via the API continues to give the pre-request resource levels. Upon completion of the returned operation: * Billing begins for all successfully-allocated resources (some types may have lower than the requested levels). * All newly-reserved resources are available for serving the instance's tables. * The instance's new resource levels are readable via the API. The returned long-running operation will have a name of the format `/operations/` and can be used to track the instance modification. The metadata field type is UpdateInstanceMetadata. The response field type is Instance, if successful. Authorization requires `spanner.instances.update` permission on the resource name.

## Path parameters

- `projectsId` string, required
- `instancesId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Request body

- UpdateInstanceRequest: The request for UpdateInstance.
  - `fieldMask` string, google-fieldmask: Required. A mask specifying which fields in Instance should be updated. The field mask must always be specified; this prevents any future fields in Instance from being erased accidentally by clients that do not know about them.
  - `instance` Instance: An isolated set of Cloud Spanner resources on which databases can be hosted.
    - `autoscalingConfig` AutoscalingConfig: Autoscaling configuration for an instance.
      - `asymmetricAutoscalingOptions` AsymmetricAutoscalingOption[]: Optional. Optional asymmetric autoscaling options. Replicas matching the replica selection criteria will be autoscaled independently from other replicas. The autoscaler will scale the replicas based on the utilization of replicas identified by the replica selection. Replica selections should not overlap with each other. Other replicas (those do not match any replica selection) will be autoscaled together and will have the same compute capacity allocated to them.
        - `overrides` AutoscalingConfigOverrides: Overrides the top-level autoscaling configuration for the replicas identified by `replica_selection`. All fields in this message are optional. Any unspecified fields will use the corresponding values from the top-level autoscaling configuration.
          - `autoscalingLimits` AutoscalingLimits: The autoscaling limits for the instance. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.
            - `maxNodes` integer: Maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
            - `maxProcessingUnits` integer: Maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
            - `minNodes` integer: Minimum number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
            - `minProcessingUnits` integer: Minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
          - `autoscalingTargetHighPriorityCpuUtilizationPercent` integer: Optional. If specified, overrides the autoscaling target high_priority_cpu_utilization_percent in the top-level autoscaling configuration for the selected replicas.
          - `autoscalingTargetTotalCpuUtilizationPercent` integer: Optional. If specified, overrides the autoscaling target `total_cpu_utilization_percent` in the top-level autoscaling configuration for the selected replicas.
          - `disableHighPriorityCpuAutoscaling` boolean: Optional. If true, disables high priority CPU autoscaling for the selected replicas and ignores high_priority_cpu_utilization_percent in the top-level autoscaling configuration. When setting this field to true, setting autoscaling_target_high_priority_cpu_utilization_percent field to a non-zero value for the same replica is not supported. If false, the autoscaling_target_high_priority_cpu_utilization_percent field in the replica will be used if set to a non-zero value. Otherwise, the high_priority_cpu_utilization_percent field in the top-level autoscaling configuration will be used. Setting both disable_high_priority_cpu_autoscaling and disable_total_cpu_autoscaling to true for the same replica is not supported.
          - `disableTotalCpuAutoscaling` boolean: Optional. If true, disables total CPU autoscaling for the selected replicas and ignores total_cpu_utilization_percent in the top-level autoscaling configuration. When setting this field to true, setting autoscaling_target_total_cpu_utilization_percent field to a non-zero value for the same replica is not supported. If false, the autoscaling_target_total_cpu_utilization_percent field in the replica will be used if set to a non-zero value. Otherwise, the total_cpu_utilization_percent field in the top-level autoscaling configuration will be used. Setting both disable_high_priority_cpu_autoscaling and disable_total_cpu_autoscaling to true for the same replica is not supported.
        - `replicaSelection` InstanceReplicaSelection: ReplicaSelection identifies replicas with common properties.
          - `location` string: Required. Name of the location of the replicas (for example, "us-central1").
          - `replicaType` 'REPLICA_TYPE_UNSPECIFIED' | 'READ_WRITE' | 'READ_ONLY' | 'WITNESS': Optional. The type of replica.
      - `autoscalingLimits` AutoscalingLimits: The autoscaling limits for the instance. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.
        - `maxNodes` integer: Maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
        - `maxProcessingUnits` integer: Maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
        - `minNodes` integer: Minimum number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
        - `minProcessingUnits` integer: Minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
      - `autoscalingTargets` AutoscalingTargets: The autoscaling targets for an instance.
        - `highPriorityCpuUtilizationPercent` integer: Optional. The target high priority cpu utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization). The valid range is [10, 90] inclusive. If not specified or set to 0, the autoscaler skips scaling based on high priority CPU utilization.
        - `storageUtilizationPercent` integer: Required. The target storage utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization). The valid range is [10, 99] inclusive.
        - `totalCpuUtilizationPercent` integer: Optional. The target total CPU utilization percentage that the autoscaler should be trying to achieve for the instance. This number is on a scale from 0 (no utilization) to 100 (full utilization). The valid range is [10, 90] inclusive. If not specified or set to 0, the autoscaler skips scaling based on total CPU utilization. If both `high_priority_cpu_utilization_percent` and `total_cpu_utilization_percent` are specified, the autoscaler provisions the larger of the two required compute capacities to satisfy both targets.
    - `config` string: Required. The name of the instance's configuration. Values are of the form `projects//instanceConfigs/`. See also InstanceConfig and ListInstanceConfigs.
    - `createTime` string, google-datetime: Output only. The time at which the instance was created.
    - `defaultBackupScheduleType` 'DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED' | 'NONE' | 'AUTOMATIC': Optional. Controls the default backup schedule behavior for new databases within the instance. By default, a backup schedule is created automatically when a new database is created in a new instance. Note that the `AUTOMATIC` value isn't permitted for free instances, as backups and backup schedules aren't supported for free instances. In the `GetInstance` or `ListInstances` response, if the value of `default_backup_schedule_type` isn't set, or set to `NONE`, Spanner doesn't create a default backup schedule for new databases in the instance.
    - `displayName` string: Required. The descriptive name for this instance as it appears in UIs. Must be unique per project and between 4 and 30 characters in length.
    - `edition` 'EDITION_UNSPECIFIED' | 'STANDARD' | 'ENTERPRISE' | 'ENTERPRISE_PLUS': Optional. The `Edition` of the current instance.
    - `endpointUris` string[]: Deprecated. This field is not populated.
    - `freeInstanceMetadata` FreeInstanceMetadata: Free instance specific metadata that is kept even after an instance has been upgraded for tracking purposes.
      - `expireBehavior` 'EXPIRE_BEHAVIOR_UNSPECIFIED' | 'FREE_TO_PROVISIONED' | 'REMOVE_AFTER_GRACE_PERIOD': Specifies the expiration behavior of a free instance. The default of ExpireBehavior is `REMOVE_AFTER_GRACE_PERIOD`. This can be modified during or after creation, and before expiration.
      - `expireTime` string, google-datetime: Output only. Timestamp after which the instance will either be upgraded or scheduled for deletion after a grace period. ExpireBehavior is used to choose between upgrading or scheduling the free instance for deletion. This timestamp is set during the creation of a free instance.
      - `upgradeTime` string, google-datetime: Output only. If present, the timestamp at which the free instance was upgraded to a provisioned instance.
    - `instanceType` 'INSTANCE_TYPE_UNSPECIFIED' | 'PROVISIONED' | 'FREE_INSTANCE': The `InstanceType` of the current instance.
    - `labels` object: Cloud Labels are a flexible and lightweight mechanism for organizing cloud resources into groups that reflect a customer's organizational needs and deployment strategies. Cloud Labels can be used to filter collections of resources. They can be used to control how resource metrics are aggregated. And they can be used as arguments to policy management rules (e.g. route, firewall, load balancing, etc.). * Label keys must be between 1 and 63 characters long and must conform to the following regular expression: `a-z{0,62}`. * Label values must be between 0 and 63 characters long and must conform to the regular expression `[a-z0-9_-]{0,63}`. * No more than 64 labels can be associated with a given resource. See https://goo.gl/xmQnxf for more information on and examples of labels. If you plan to use labels in your own code, please note that additional characters may be allowed in the future. And so you are advised to use an internal label representation, such as JSON, which doesn't rely upon specific characters being disallowed. For example, representing labels as the string: name + "_" + value would prove problematic if we were to allow "_" in a future release.
    - `name` string: Required. A unique identifier for the instance, which cannot be changed after the instance is created. Values are of the form `projects//instances/a-z*[a-z0-9]`. The final segment of the name must be between 2 and 64 characters in length.
    - `nodeCount` integer: The number of nodes allocated to this instance. At most, one of either `node_count` or `processing_units` should be present in the message. Users can set the `node_count` field to specify the target number of nodes allocated to the instance. If autoscaling is enabled, `node_count` is treated as an `OUTPUT_ONLY` field and reflects the current number of nodes allocated to the instance. This might be zero in API responses for instances that are not yet in the `READY` state. If the instance has varying node count across replicas (achieved by setting `asymmetric_autoscaling_options` in the autoscaling configuration), the `node_count` set here is the maximum node count across all replicas. For more information, see [Compute capacity, nodes, and processing units](https://cloud.google.com/spanner/docs/compute-capacity).
    - `processingUnits` integer: The number of processing units allocated to this instance. At most, one of either `processing_units` or `node_count` should be present in the message. Users can set the `processing_units` field to specify the target number of processing units allocated to the instance. If autoscaling is enabled, `processing_units` is treated as an `OUTPUT_ONLY` field and reflects the current number of processing units allocated to the instance. This might be zero in API responses for instances that are not yet in the `READY` state. If the instance has varying processing units per replica (achieved by setting `asymmetric_autoscaling_options` in the autoscaling configuration), the `processing_units` set here is the maximum processing units across all replicas. For more information, see [Compute capacity, nodes and processing units](https://cloud.google.com/spanner/docs/compute-capacity).
    - `replicaComputeCapacity` ReplicaComputeCapacity[]: Output only. Lists the compute capacity per ReplicaSelection. A replica selection identifies a set of replicas with common properties. Replicas identified by a ReplicaSelection are scaled with the same compute capacity.
      - `nodeCount` integer: The number of nodes allocated to each replica. This may be zero in API responses for instances that are not yet in state `READY`.
      - `processingUnits` integer: The number of processing units allocated to each replica. This may be zero in API responses for instances that are not yet in state `READY`.
      - `replicaSelection` InstanceReplicaSelection: ReplicaSelection identifies replicas with common properties.
        - `location` string: Required. Name of the location of the replicas (for example, "us-central1").
        - `replicaType` 'REPLICA_TYPE_UNSPECIFIED' | 'READ_WRITE' | 'READ_ONLY' | 'WITNESS': Optional. The type of replica.
    - `state` 'STATE_UNSPECIFIED' | 'CREATING' | 'READY': Output only. The current instance state. For CreateInstance, the state must be either omitted or set to `CREATING`. For UpdateInstance, the state must be either omitted or set to `READY`.
    - `tags` object: Optional. Tag keys/values directly bound to this resource. For example: "123/environment": "prod", "123/costCenter": "marketing"
    - `updateTime` string, google-datetime: Output only. The time at which the instance was most recently updated.

## Response `200`

Successful response

- Operation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  - `error` Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.

## Changes

- **2026-12-05** `a7213b86b5d7`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/spanner.admin` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/spanner.admin` was removed from the endpoint's security scheme `Oauth2c`
- **2026-11-20** `54a0040f5251`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/spanner.admin` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/spanner.admin` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/spanner/changes/v1/projects/:projectsId/instances/:instancesId/patch.md)

---

[API](https://skmtc.dev/google/apis/spanner.md) - [All operations](https://skmtc.dev/google/apis/spanner/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/spanner/revisions/a7213b86b5d7?raw)
