# Start rescue mode

`POST https://console.advinservers.com/api/v1/client/servers/{server}/rescue`

### Overview

Restarts the server into the rescue system. The server is shut down first, and anything not saved to disk is lost. Send SSH key IDs as `ssh_keys` to sign in with those keys, and a `password` to sign in with a root password of your own. With keys and no password, password logins are turned off. With neither, you get a generated root password. `ssh_key` still takes a single key ID. The response is the rescue mode status. Read it again until `rescue.state` is `ready`, which usually takes a few minutes. The account holder is emailed when the rescue system is ready. Your mounted ISO and boot order are kept and come back when rescue mode ends, but they cannot be changed until then. Returns 400 when the server is already in rescue mode or rescue mode is unavailable.

### Permissions

Requires the `server.reinstall` (Reinstall servers) permission for the selected team. Resources outside that team return 404.

## Authorization

Send `Authorization: Bearer <token>` with the request. Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.

## Path parameters

- `server` (string, required): The server uuid short

## Body

Sent as `application/json`.

- `password` (string | null): The password. Send it only over HTTPS and do not log it. At most 191 characters
- `ssh_keys` (string[]): The value of `ssh_keys`. At most 25 items
- `ssh_key` (string | null): The value of `ssh_key`. Exactly 36 characters
- `notify_customer` (boolean): The value of `notify_customer`.

## Response 202

The request was accepted and is being carried out in the background.

- `rescue` (object | null, required): Null when the server is not in rescue mode.
  - `state` (string, required): The billing state, province, or region, or null or an empty string to clear it. One of: `booting`, `ready`, `failed`.
  - `failure` (string | null, required): Why the rescue system could not be set up, when `state` is `failed`.
  - `image_name` (string, required): The name of the image the server boots for rescue.
  - `ipv4` (string | null, required): The rescue system answers SSH on the server's primary addresses.
  - `ipv6` (string | null, required): The value of `ipv6`.
  - `username` (string, required): The value of `username`.
  - `password` (string | null, required): Null when the login is SSH keys only, which also turns password logins off.
  - `ssh_key_names` (string[], required): The value of `ssh_key_names`.
  - `ssh_key_name` (string | null, required): The first of `ssh_key_names`, kept for clients written when rescue mode took one key.
  - `notify_customer` (boolean, required): Whether the account holder is emailed when the rescue system is ready.
  - `created_at` (string<date-time>, required): The date and time for created at, in UTC.
  - `ready_at` (string<date-time> | null, required): The date and time for ready at, in UTC.
- `unavailable_reason` (string | null, required): Why rescue mode cannot be turned on right now, or null when it can.

```json
{
  "rescue": {
    "state": "ready",
    "failure": null,
    "image_name": "SystemRescue 13.03",
    "ipv4": "203.0.113.24",
    "ipv6": "2001:db8:4b2:18::1",
    "username": "root",
    "password": null,
    "ssh_key_names": [
      "gordon-workstation"
    ],
    "ssh_key_name": "gordon-workstation",
    "notify_customer": true,
    "created_at": "2026-09-14T16:42:09.000000Z",
    "ready_at": "2026-09-14T16:42:09.000000Z"
  },
  "unavailable_reason": null
}
```

## Errors

- `401`: The key was missing, malformed, revoked, or belongs to an account that no longer exists.
- `403`: Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
- `404`: The resource was not found in the selected team. Resources in another account or team also return 404.
- `422`: A field is missing or invalid, or the resource cannot accept this change in its current state. Check `message` for details. Field validation also includes an `errors` object keyed by field name.
- `429`: Too many requests. The `Retry-After` header says how many seconds to wait. Limits are per account, so several keys on one account share them.

## Example request

```bash
curl --request POST \
  --url 'https://console.advinservers.com/api/v1/client/servers/{server}/rescue' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "password": null,
  "ssh_keys": [
    "97721fd4-746a-40cc-8da0-4c9f623c112e"
  ],
  "ssh_key": null,
  "notify_customer": true
}'
```
