# Kept Backups endpoints (Client API: account)

> 6 FeatherPanel Client API: account endpoints from user/kept-backups.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/user/kept-backups/

Defined in [`backend/app/routes/user/kept-backups.php`](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/routes/user/kept-backups.php). Authentication used here: **Signed-in user**. Read [Authentication](https://featherpanel.com/docs/api/authentication/) for how to send credentials and [Rate limits and errors](https://featherpanel.com/docs/api/rate-limits-and-errors/) for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

## Endpoints

### GET `/api/user/kept-backups`

- Auth: Signed-in user
- Default rate limit: 60 / minute (`user-kept-backups`)
- Route name: `user-kept-backups`
- Controller: [`KeptBackupsController::index`](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/Controllers/User/Backup/KeptBackupsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/routes/user/kept-backups.php#L35)

**List kept backups** Backups the user kept when deleting their servers.

```bash
curl -X GET "$PANEL_URL/api/user/kept-backups" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Kept backups

### GET `/api/user/servers/{uuidShort}/keep-backups`

- Auth: Signed-in user
- Default rate limit: 30 / minute (`user-server-keep-backups`)
- Route name: `user-server-keep-backups`
- Controller: [`KeptBackupsController::keepInfo`](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/Controllers/User/Backup/KeptBackupsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/routes/user/kept-backups.php#L47)

**What keeping backups would do when deleting a server** Whether the node can keep local and PBS backups, and how many finished backups the server has on the node and in remote storage. Only for the server owner.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuidShort` | path | string | yes |  |

```bash
curl -X GET "$PANEL_URL/api/user/servers/$UUID_SHORT/keep-backups" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Keep information · `404` Server not found

### GET `/api/user/kept-backups/{uuid}/targets`

- Auth: Signed-in user
- Default rate limit: 30 / minute (`user-kept-backups-targets`)
- Route name: `user-kept-backups-targets`
- Controller: [`KeptBackupsController::targets`](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/Controllers/User/Backup/KeptBackupsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/routes/user/kept-backups.php#L59)

**Servers a kept backup can be restored onto** Your own servers that are not suspended and, for backups stored on a node, run on that node.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |

```bash
curl -X GET "$PANEL_URL/api/user/kept-backups/$UUID/targets" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Servers · `404` Backup not found

### GET `/api/user/kept-backups/{uuid}/download`

- Auth: Signed-in user
- Default rate limit: 20 / minute (`user-kept-backups-download`)
- Route name: `user-kept-backups-download`
- Controller: [`KeptBackupsController::download`](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/Controllers/User/Backup/KeptBackupsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/routes/user/kept-backups.php#L71)

**Download a kept backup**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |

```bash
curl -X GET "$PANEL_URL/api/user/kept-backups/$UUID/download" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Download link · `404` Backup not found

### POST `/api/user/kept-backups/{uuid}/restore`

- Auth: Signed-in user
- Default rate limit: 10 / minute (`user-kept-backups-restore`)
- Route name: `user-kept-backups-restore`
- Controller: [`KeptBackupsController::restore`](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/Controllers/User/Backup/KeptBackupsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/routes/user/kept-backups.php#L83)

**Restore a kept backup onto one of your servers** Replaces the files of a server you own with the kept backup. Backups stored on a node can only be restored onto a server on the same node.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `server` | string | no | Short UUID of the target server |
| `truncate_directory` | boolean | no | Delete the server files first |

```bash
curl -X POST "$PANEL_URL/api/user/kept-backups/$UUID/restore" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"server":"","truncate_directory":false}'
```

Responses: `202` Restore started · `404` Backup or server not found · `422` Backup cannot be restored onto that server

### DELETE `/api/user/kept-backups/{uuid}`

- Auth: Signed-in user
- Default rate limit: 20 / minute (`user-kept-backups-delete`)
- Route name: `user-kept-backups-delete`
- Controller: [`KeptBackupsController::delete`](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/Controllers/User/Backup/KeptBackupsController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/8318da2dee6f7facc161af39e305be7d97407929/backend/app/routes/user/kept-backups.php#L95)

**Delete a kept backup**

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |

```bash
curl -X DELETE "$PANEL_URL/api/user/kept-backups/$UUID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` Deleted · `404` Backup not found
