# Lock, download and delete snapshots

> Find a snapshot on the Snapshots page, lock it against accidental deletion, download the archive or delete it.

Source: https://www.coritan.com/docs/snapshots/manage-snapshots/

In the dashboard:

- /dashboard/snapshots: https://www.coritan.com/dashboard/snapshots

The **Snapshots** page lists every snapshot on your account, from every server you have had. The menu at the end of each row locks the snapshot, downloads its archive or deletes it. A server's own **Snapshots** tab has the same menu for the snapshots in its list.

## Before you begin

- Only the account that holds a snapshot can lock, download or delete it. Someone you share a server with cannot, even with the Snapshots permission ([Share a server with other users](/docs/managed-containers/users/#choose-permissions)).
- You can download a snapshot once its status is `Completed`.
- The free plan does not include downloads, so you cannot download a snapshot of a free server.

## Find a snapshot

1. In the [dashboard](https://www.coritan.com/dashboard/snapshots), select **Snapshots** in the sidebar.
2. To see one group, select **Ready**, **In progress**, **Failed**, **Locked** or **Deleted servers**. **All** shows every snapshot again.
3. To search, type part of a snapshot's name, its server, its software, its status or its location in **Search snapshots**.
4. To sort the list, select a column heading. The list starts with the newest snapshot first.

When nothing matches, the page shows **No matches**. Select **Reset filters** to clear the search and the filter.

## Lock or unlock a snapshot

Open the menu at the end of the snapshot's row and select **Lock**. A **Locked** badge shows beside the snapshot's name. To remove the lock, select **Unlock** in the same menu.

While a snapshot is locked:

- Nobody can delete it from the dashboard or the API.
- A schedule never deletes it to make room for a new snapshot.
- If we took it before suspending a server, we keep it when the server is unsuspended ([Snapshots and backups compared](/docs/snapshots/snapshots-and-backups/#snapshots-we-take-for-you)).

**Lock** and **Unlock** are greyed out while the snapshot is being taken, restored or deleted.

> [!IMPORTANT]
> A lock does not keep a snapshot past the storage cleanup. When an account stays over its snapshot allowance after the cleanup date, we delete snapshots until it fits, and we delete locked snapshots after the unlocked ones. [How snapshot storage works](/docs/snapshots/storage-allowance/#when-the-account-is-over) explains the cleanup.

## Download a snapshot

1. Open the menu at the end of the snapshot's row and select **Download**. It is greyed out until the snapshot is `Completed`.
2. The download opens in a new browser tab. The file is a `.tar.gz` archive named after the snapshot's ID.

The link works for 6 hours by default. To download the snapshot again later, select **Download** again for a new link. You can download a snapshot while an invoice is unpaid.

A snapshot of a free server cannot be downloaded while that server is on the free plan. Once the server moves to a paid plan, or once it is deleted, you can download its snapshots. Until then, restore the snapshot onto a server, or download the files you need from the server's **Files** tab.

## Delete a snapshot

> [!CAUTION]
> Deleting a snapshot deletes its archive from storage. You cannot undo it, and we cannot recover the archive.

1. Open the menu at the end of the snapshot's row and select **Delete snapshot…**. It is greyed out while the snapshot is locked, and while its status is `Creating`, `Restoring` or `Deleting`.
2. Type the snapshot's name to confirm, then select **Delete snapshot**.

You can delete a failed snapshot, and one that has stayed on `Pending`. A snapshot we put on hold says so under its name, with the reason, and you cannot delete it until we lift the hold.

## Result

- A locked snapshot shows the **Locked** badge, and the **Locked** filter lists it.
- A download starts in a new tab.
- A deleted snapshot leaves the list, and a message confirms it, such as `before-1.21-update deleted.` The space it used is free again at once, and the **Snapshot storage** card shows it.

## Troubleshooting

When an action fails, the page shows **Could not get a download link**, **Could not change the lock** or **Could not delete the snapshot**, with one of these messages:

`Downloading a snapshot is not included on the free plan. …`
: The snapshot comes from a free server. Restore it onto a server instead, or download the files you need from the server's **Files** tab.

`That snapshot is not finished yet`
: Wait until the snapshot's status is `Completed`. A failed snapshot has no archive to download.

`Object storage did not return a download URL for this snapshot.`
: The storage that holds the snapshot did not answer. Try again in a few minutes, or [contact support](/docs/support/conversations/).

`Cannot delete a locked snapshot`
: Select **Unlock** first, then delete the snapshot.

`Cannot delete a snapshot while it is being restored`
: Wait until the restore ends and the snapshot's status is `Completed` again.

`This snapshot is on hold and cannot be deleted.`
: We put the snapshot on hold, and the reason shows under its name. [Contact support](/docs/support/conversations/) about it.

`Cannot change the lock while the snapshot is creating`
: The message names `pending`, `creating`, `restoring` or `deleting`. Wait until that finishes, then try again.

`Snapshot … not found`
: The snapshot is gone, or another account holds it. On a server someone shared with you, the snapshots belong to the owner, so only the owner can lock, download or delete them.

## Related

- [Snapshots](/docs/snapshots/)
- [Restore a snapshot onto a server](/docs/snapshots/restore-a-snapshot/)
- [How snapshot storage works](/docs/snapshots/storage-allowance/)
- [Take a server snapshot](/docs/managed-containers/snapshots/)

## With the API

Each request takes a snapshot's `uuid` from `GET /api/v1/client/snapshots` and works only on your own account's snapshots. Another account's snapshot answers `404` with `Snapshot … not found`.

Lock a snapshot, or unlock a locked one:

```bash
curl -X POST https://api.coritan.com/api/v1/client/snapshots/$SNAPSHOT/lock \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

The request turns the lock on when it is off, and off when it is on. It returns the snapshot with its new `is_locked`. A snapshot that is being taken, restored or deleted answers `409`.

Get a download link:

```bash
curl https://api.coritan.com/api/v1/client/snapshots/$SNAPSHOT/download \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

The response is `{"url": "…"}`, a signed link to the archive that works for 6 hours by default. Fetch the link as it is, with no `Authorization` header:

```bash
curl -o before-1.21-update.tar.gz "$URL"
```

A snapshot that is not `completed` answers `409`, one from a free server answers `403`, and `503` means the storage did not return a link.

Delete a snapshot:

```bash
curl -X DELETE https://api.coritan.com/api/v1/client/snapshots/$SNAPSHOT \
  -H "Authorization: Bearer $CORITAN_TOKEN"
```

The response is `{"message": "Snapshot deleted"}`. A locked snapshot answers `400`, one on hold answers `403`, and one that is being restored answers `409`.

## API

- `POST /api/v1/client/snapshots/{snapshot_uuid}/lock`: Keep a snapshot, or release it (https://www.coritan.com/docs/api/reference/client/container-apps/snapshots/#op-post-api-v1-client-snapshots-snapshot-uuid-lock)
- `GET /api/v1/client/snapshots/{snapshot_uuid}/download`: A signed URL for the archive itself (https://www.coritan.com/docs/api/reference/client/container-apps/snapshots/#op-get-api-v1-client-snapshots-snapshot-uuid-download)
- `DELETE /api/v1/client/snapshots/{snapshot_uuid}`: Delete a snapshot and the archive behind it (https://www.coritan.com/docs/api/reference/client/container-apps/snapshots/#op-delete-api-v1-client-snapshots-snapshot-uuid)
