# List the accounts a batch can restore

`GET /api/v1/servers/{server}/restore-candidates`

Every hosting account of the server, ordered by domain name: under `restorable` with the backup a batch would restore it from (its newest that can be restored, at or before `as_of` when given), under `refused` with the reason it cannot be restored. Reading backup indexes may take a while on a large server. 422 when the server has no Plesk or cPanel, or that panel's integration is switched off.

Guides: [Restore many accounts at once](/docs/restores/bulk-restore)

## Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| server | integer | yes | The ID of the server. Example: `12`. |

## Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| as_of | string · date-time | no | Use each account's newest backup at or before this moment (ISO 8601, not in the future). Leave it out for the newest backup. Example: `2026-11-20T00:00:00+00:00`. |

## Response

### 200

The server's accounts, split into those a batch can restore and those it cannot.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| data | object | yes |  |
| data.restorable | object[] | yes |  |
| data.restorable.hosting_account_id | integer | yes |  |
| data.restorable.domain_name | string | yes |  |
| data.restorable.backup_artifact_id | integer | yes | The backup the account would be restored from. When the plan keeps one backup per component, the first of the backup run the account is restored from. Nullable. |
| data.restorable.backup_artifact_ids | integer[] | yes | Every backup the account would be restored from, in the order they are restored: one, or one per component. |
| data.restorable.backup_run_id | integer | yes | The backup run the account is restored from: its newest backup run (at or before `as_of` when given) that can be restored. Nullable. |
| data.restorable.backed_up_at | string · date-time | yes | When that backup run started. Nullable. |
| data.restorable.components | string[] | yes | What the backup holds, in the order a batch restores it. One of: `settings`, `files`, `databases`, `mail`. |
| data.refused | object[] | yes |  |
| data.refused.hosting_account_id | integer | yes |  |
| data.refused.domain_name | string | yes |  |
| data.refused.reason | string | yes | Why the account cannot be restored, as Browse Backups says it. |

### 401

The request carries no valid token: the `Authorization: Bearer` header is missing, or its token is unknown, revoked or past its expiry date. Send a current personal access token.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | Always `Unauthenticated.`. |

### 403

The token may not read this. The `message` says why: `Your role does not permit this action.` (its owner is not an Admin, Operator or Viewer in the client), `This account is disabled.`, `This token is not bound to a client you belong to.`, or `Client suspended`.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | What went wrong. |

### 404

Not found

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | What went wrong. |

### 422

The `as_of` query is not a date (the body then lists it under `errors`), or the server cannot run a batch: it has no control panel with hosting accounts, or that panel's integration is switched off. The `message` says which.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | What went wrong. |

### 429

More than 120 requests a minute for this user. Wait the seconds in `Retry-After`, then retry.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | What went wrong. |

## Request example

```bash
curl 'https://app.clokeep.com/api/v1/servers/12/restore-candidates' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Accept: application/json'
```

## Response example (200)

```json
{
  "data": {
    "restorable": [
      {
        "hosting_account_id": 17,
        "domain_name": "example.com",
        "backup_artifact_id": 2291,
        "backup_artifact_ids": [
          2291
        ],
        "backup_run_id": 1873,
        "backed_up_at": "2026-11-20T02:00:07+00:00",
        "components": [
          "settings",
          "files",
          "databases",
          "mail"
        ]
      }
    ],
    "refused": [
      {
        "hosting_account_id": 18,
        "domain_name": "shop.example.com",
        "reason": "No backup yet"
      }
    ]
  }
}
```

## Response example (401)

```json
{
  "message": "Unauthenticated."
}
```

## Response example (403)

```json
{
  "message": "Your role does not permit this action."
}
```

## Response example (404)

```json
{
  "message": "No query results for model [App\\Models\\Server] 12"
}
```

## Response example (422)

```json
{
  "message": "Plesk integration is switched off."
}
```

## Response example (429)

```json
{
  "message": "Too Many Attempts."
}
```
