---
title: "Failover database node"
method: POST
path: "/v1/databases/{database_id}/nodes/{node_name}/failover"
tags: ["Database"]
---

# Failover database node

`POST /v1/databases/{database_id}/nodes/{node_name}/failover`

Performs a failover for a node to a replica candidate.

## Path parameters

- `database_id` string, required
- `node_name` string, required

## Request body

- FailoverDatabaseNodeRequest
  - `candidate_instance_id` string — Optional instance_id of the replica to promote. If omitted, a candidate will be selected.
  - `skip_validation` boolean — If true, skip the health validations that prevent running failover on a healthy cluster.

## Response `200`

OK response.

- FailoverDatabaseNodeResponse
  - `task` Task, required
    - `completed_at` string, date-time — The time when the task was completed.
    - `created_at` string, date-time, required — The time when the task was created.
    - `database_id` string — The database ID of the task.
    - `entity_id` string, required — The entity ID (database_id or host_id) that this task belongs to.
    - `error` string — The error message if the task failed.
    - `host_id` string — The ID of the host that the task is running on.
    - `instance_id` string — The ID of the instance that the task is operating on.
    - `node_name` string — The name of the node that the task is operating on.
    - `parent_id` string, uuid — The parent task ID of the task.
    - `scope` 'database' | 'host', required — The scope of the task (database or host).
    - `status` 'pending' | 'running' | 'completed' | 'canceled' | 'canceling' | 'failed' | 'unknown', required — The status of the task.
    - `task_id` string, uuid, required — The unique ID of the task.
    - `type` string, required — The type of the task.

## Other responses

- `400` — Bad Request response.
- `404` — Not Found response.
- `409` — Conflict response.
- `500` — Internal Server Error response.
- `default` — Unexpected error response

---

[API](https://skmtc.net/pgedge/apis/pgedge-control-plane-v1-api.md) · [All operations](https://skmtc.net/pgedge/apis/pgedge-control-plane-v1-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pgedge/pgedge-control-plane-v1-api/versions/29a68546f34c/schema)
