- [HTTP request](https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances/switchover#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances/switchover#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances/switchover#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances/switchover#body.request_body)
- [Response body](https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances/switchover#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances/switchover#body.aspect)
- [Examples](https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances/switchover#examples)
- [Try it!](https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances/switchover#try-it)

Switches over from the primary instance to the DR replica instance.

### HTTP request

`POST https://sqladmin.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/switchover`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `project` | `string` ID of the project that contains the replica. |
| `instance` | `string` Cloud SQL read replica instance name. |

### Query parameters

| Parameters ||
|---|---|
| `dbTimeout` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations timeout, which is a sum of all database operations. Default value is 10 minutes and can be modified to a maximum value of 24 hours. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloudsql`
- `
  https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/sqlservice.admin`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).