---
title: "Set Pg Instance Ha Mode"
method: POST
path: "/admin/pg-instances/{instance_id}/ha-mode"
---

# Set Pg Instance Ha Mode

`POST /admin/pg-instances/{instance_id}/ha-mode`

## Request

- Base URL: `https://api.xhostd.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xhostd.com/admin/pg-instances/{instance_id}/ha-mode`
- Auth: none declared

Protect an instance or take its protection off (admin).

:func:`set_pg_instance_ha_mode_for_admin` holds the refusals.

## Path parameters

- `instance_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Request body

- HaModeRequest
  - `ha_mode` string, required
  - `request_id` string, uuid, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xhostd/apis/xhostd-public.md) · [All operations](https://skmtc.dev/xhostd/apis/xhostd-public/llms.txt) · [OpenAPI document](https://skmtc.dev/xhostd/apis/xhostd-public/revisions/bf439c4d1789?raw)
