---
title: "master/slave switchover"
method: POST
path: "/clusters/switchover"
tags: ["switchover"]
---

# master/slave switchover

`POST /clusters/switchover`

master/slave switchover

## Request body

- ClusterMasterSlaveClusterSwitchoverReq
  - `checkMasterWritableFlag` boolean
  - `checkSlaveReadOnlyFlag` boolean
  - `checkStandaloneClusterFlag` boolean — check if cluster specified in `SourceClusterID` is standalone, i.e. no cluster relation and no cdc if this flag is true, always only check
  - `force` boolean
  - `onlyCheck` boolean — only check if this flag is true
  - `rollbackClearPreviousMaintenanceFlag` boolean — clear previous un-cleared "Switching" maintenance state
  - `rollbackWorkFlowID` string — if this field is not empty, that means this is a rollback request
  - `sourceClusterID` string, required — old master/new slave
  - `targetClusterID` string, required — new master/old slave

## Response `200`

OK

- object
  - `code` integer
  - `data` object
    - `workFlowId` string — Asynchronous task workflow ID
  - `message` string

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal Server Error

---

[API](https://skmtc.net/pingcap/apis/em-ui-api.md) · [All operations](https://skmtc.net/pingcap/apis/em-ui-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pingcap/em-ui-api/revisions/631e4b26b7e8/schema)
