# Restore a backup

`POST /api/v1/artifacts/{artifact}/restore`

The backup is restored to the server it came from, with the choices the
panel's Restore form offers for it. The fields depend on the backup, and
a field that does not apply to it is refused:

- files backup: `target_path` (required, absolute) and `overwrite_policy`
  (`overwrite`, `skip_existing` or `rename`; default `overwrite`);
- database backup: `database_connection_id` (required), a connection on the backup's server;
- Plesk or cPanel backup: `components` (`files`, `databases`, `mail`, `settings`, those the
  backup holds), `files_target`, `databases` (names of dumps in the backup), `database_mode`
  (`new` restores into `name_restored`, replacing one that exists; `overwrite` over the original;
  default `new`, or `overwrite` when `apply_settings` re-creates an account that was missing
  from the server at the last account sync),
  `mail_overwrite`, `apply_settings`, `rollback_live` (Plesk); or `mailbox` (`address`, `overwrite_account`) alone
  to restore one mailbox.

Answers 202 with the queued restore run (its choices under `restore`); the agent picks it
up on its next poll. 409 while another restore on the same server is queued or running.
422 when the backup cannot be restored (orphaned, missing from storage, or refused). 503
while the file list of a Plesk or cPanel backup cannot be read.

Guides: [Queue a restore through the API](/docs/developers/queue-restore), [Handle errors and rate limits](/docs/developers/errors-rate-limits)

## Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| artifact | integer | yes | The ID of the backup. Example: `2291`. |

## Body Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| target_path | string | no | Files backup: the absolute folder on the server to restore into. Required for a files backup. Example: `/var/www/restore`. |
| overwrite_policy | string | no | Files backup: what to do with a file that already exists. Default: `overwrite`. One of: `overwrite`, `skip_existing`, `rename`. Example: `skip_existing`. |
| database_connection_id | integer | no | Database backup: the connection to restore into, on the backup's server. Required for a database backup. Example: `9`. |
| components | string[] | no | Plesk or cPanel backup: the parts to restore, among those the backup holds (`files`, `databases`, `mail`, `settings`). Required unless `mailbox` is sent. One of: `files`, `databases`, `mail`, `settings`. Example: `["files","databases"]`. |
| files_target | string | no | Plesk or cPanel backup: the folder to restore the files into. Blank for the account's own folder; on cPanel it must be the home folder or inside it. Example: `/var/www/vhosts/example.com/httpdocs`. |
| databases | string[] | no | Plesk or cPanel backup: the databases to restore, by the names of their dumps in the backup. Example: `["wp"]`. |
| database_mode | string | no | Plesk or cPanel backup: `new` restores each database as `name_restored` (replacing a `name_restored` database that exists) and leaves the original alone; `overwrite` empties the original and loads the backup into it. When left out it is `new`, or `overwrite` when `apply_settings` re-creates an account that was missing from the server at the last account sync (its databases come back empty). Default: `new`. One of: `new`, `overwrite`. Example: `new`. |
| mail_overwrite | boolean | no | Plesk or cPanel backup: overwrite messages that already exist. Default: `false`. Example: `false`. |
| apply_settings | boolean | no | Plesk or cPanel backup with `settings`: apply them. Re-creates a deleted subscription or account; on cPanel it also rolls a live account's configuration back. Default: `false`. Example: `true`. |
| rollback_live | boolean | no | Plesk backup with `settings` and `apply_settings`: also roll back a subscription that still exists. Its settings (hosting and PHP options, DNS records, mail accounts) and every password go back to the backup's; files, mail and databases are restored only as chosen in `components`. Default: `false`. Example: `false`. |
| mailbox | object | no | Plesk or cPanel backup: restore one mailbox instead of components, as `{"address": "info@example.com", "overwrite_account": false}`. `overwrite_account` resets an existing mailbox's password (and on Plesk its aliases and forwarding) to the backup. Example: `{"address":"info@example.com","overwrite_account":false}`. |

## Response

### 202

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| data | object | yes |  |
| data.id | integer | yes |  |
| data.plan_id | integer | yes |  |
| data.server_id | integer | yes |  |
| data.kind | string | yes | One of: `backup`, `restore`. |
| data.kind_label | string | yes | One of: `Backup`, `Restore`. |
| data.trigger | string | yes | One of: `manual`, `schedule`, `api`. |
| data.trigger_label | string | yes | One of: `Manual`, `Schedule`, `API`. |
| data.status | string | yes | One of: `queued`, `running`, `completed`, `partial`, `failed`, `cancelled`. |
| data.status_label | string | yes | One of: `Queued`, `Running`, `Completed`, `Partially completed`, `Failed`, `Cancelled`. |
| data.progress_percent | integer | yes | How far the run has got, 0 to 100. |
| data.current_step | string | yes | The step the agent is on: for a backup `prepare`, `dump`, `archive`, `compress`, `upload` or `index`; for a restore `download`, `extract`, `restore` or `verify`. It is null in the first answer to starting a backup, for a restore until the agent picks it up, and once the run has completed; a backup waiting for the agent already shows `prepare`, and a failed or cancelled run keeps the step it stopped at. To know whether a run has started, read `status`, not this field. Nullable. |
| data.message | string | yes | The latest status line of the run. Nullable. |
| data.queue | string | yes | The queue the run was dispatched to. Nullable. |
| data.laravel_job_uuid | string | yes | The id of the queued job that started the run. Nullable. |
| data.started_at | string · date-time | yes | When the agent started the run. Nullable. |
| data.finished_at | string · date-time | yes | When the run ended; null while it is still queued or running. Nullable. |
| data.cancel_requested_at | string · date-time | yes | When a stop was requested, for example `2026-11-20T02:05:30+00:00`; null unless someone asked to cancel the run. Nullable. |
| data.error_message | string | yes | Why the run failed, for example `Upload failed: connection timed out after 120 seconds.`, or for a `partial` run which items failed; null for a run that did not fail. Nullable. |
| data.initiated_by_user_id | integer | yes | The user who started the run; null for a scheduled run. A run started by hand or through the API carries the user's id. Nullable. |
| data.restore | object | yes | What a restore run was asked to restore, and how; null on a backup run. `account` holds a Plesk or cPanel restore's choices (`mailbox` alone for one mailbox), null for a files or database restore. Nullable. |
| data.restore.source_artifact_id | integer | yes | Nullable. |
| data.restore.mode | string | yes | Nullable. One of: `original_location`, `alternate_path`, `download_only`, `null`. |
| data.restore.target_path | string | yes | Nullable. |
| data.restore.overwrite_policy | string | yes | Nullable. One of: `overwrite`, `skip_existing`, `rename`, `null`. |
| data.restore.database_connection_id | integer | yes | Nullable. |
| data.restore.account | object | yes | Nullable. |
| data.restore.account.components | string[] | yes | One of: `files`, `databases`, `mail`, `settings`, `mailbox`. |
| data.restore.account.files_target | string | yes | Nullable. |
| data.restore.account.databases | object[] | yes |  |
| data.restore.account.databases.name | string | yes |  |
| data.restore.account.databases.target_name | string | yes |  |
| data.restore.account.mail_overwrite | boolean | yes |  |
| data.restore.account.apply_settings | boolean | yes |  |
| data.restore.account.rollback_live | boolean | yes |  |
| data.restore.account.mailbox | object | yes | Nullable. |
| data.restore.account.mailbox.address | string | yes |  |
| data.restore.account.mailbox.overwrite_account | boolean | yes |  |
| data.plan | object | yes |  |
| data.plan.id | integer | yes |  |
| data.plan.server_id | integer | yes |  |
| data.plan.plan_template_id | integer | yes | Nullable. |
| data.plan.name | string | yes |  |
| data.plan.type | string | yes | One of: `files`, `database`, `email`, `plesk_subscription`, `cpanel_account`. |
| data.plan.type_label | string | yes | One of: `Files`, `Database`, `Email`, `Plesk server`, `cPanel server`. |
| data.plan.schedule_id | integer | yes | Nullable. |
| data.plan.compression_profile_id | integer | yes | Nullable. |
| data.plan.enabled | boolean | yes |  |
| data.plan.encrypts_new_backups | boolean | yes | True when the plan's next backups will be encrypted with the platform's key (the platform-wide setting or the client's own). |
| data.plan.config | object | yes | The plan's settings; the keys depend on `type`. files: `backup_path_ids`, `incremental`, `full_every`, `archive_per_path`, `dedup_disabled`. database: `database_connection_id`, `tables`. email: `mail_paths`, `mail_domains`, `mail_mailboxes`, `mail_all_domains`. plesk_subscription and cpanel_account: `account_scope` (on Plesk also `plesk_scope`, its pre-4.3.0 name), `include_mail`, `archive_per_component`. An empty list `[]` when nothing is set. Nullable. |
| data.plan.retention_days | integer | yes | Nullable. |
| data.plan.retention_count | integer | yes | Nullable. |
| data.plan.server | object | no |  |
| data.plan.server.id | integer | yes |  |
| data.plan.server.name | string | yes |  |
| data.plan.server.ip | string | yes | Nullable. |
| data.plan.server.status | string | yes | One of: `pending`, `online`, `offline`. |
| data.plan.server.status_label | string | yes | One of: `Pending`, `Online`, `Offline`. |
| data.plan.server.control_panel | string | yes | One of: `none`, `plesk`, `cpanel`. |
| data.plan.server.detected_control_panel | string | yes | Nullable. One of: `none`, `plesk`, `cpanel`, `null`. |
| data.plan.server.last_seen_at | string · date-time | yes | Nullable. |
| data.plan.server.agent_version | string | yes | Nullable. |
| data.plan.server.account_portal_plugin_status | string | yes | What the agent last reported for the cPanel Backups plugin: `installed`, `not_installed` or `failed`. Null until an agent reports it. Nullable. |
| data.plan.server.enrolled_at | string · date-time | yes | Nullable. |
| data.plan.server.metadata | object | yes | Free-form details about the server: whatever the API or panel stored, plus `hostname` and `os` as the agent reports them. An empty list `[]` when nothing is set. Nullable. |
| data.plan.server.work_dir | string | yes | The directory the agent stages and archives in: an absolute path the agent reports in `agent_work_dirs`, `auto` to let the agent pick the one with the most free space, or null for the agent default. Nullable. |
| data.plan.server.agent_work_dirs | object[] | yes | The work directories the agent reported on its last heartbeat; null until an agent that reports them has checked in. Each entry has `path`, `default` (the agent's first choice), `available`, `free_bytes`, `total_bytes`, `source` (`config` for a directory from the agent's settings, `disk` for a detected one) and the nullable `mount_point`, `device` and `fs_type`. Nullable. |
| data.plan.server.agent_work_dirs.path | string | yes |  |
| data.plan.server.agent_work_dirs.default | boolean | yes |  |
| data.plan.server.agent_work_dirs.available | boolean | yes |  |
| data.plan.server.agent_work_dirs.free_bytes | integer | yes |  |
| data.plan.server.agent_work_dirs.total_bytes | integer | yes |  |
| data.plan.server.agent_work_dirs.source | string | yes |  |
| data.plan.server.agent_work_dirs.mount_point | string | yes | Nullable. |
| data.plan.server.agent_work_dirs.device | string | yes | Nullable. |
| data.plan.server.agent_work_dirs.fs_type | string | yes | Nullable. |
| data.plan.server.accounts_synced_at | string · date-time | yes | Nullable. |
| data.plan.server.plesk_subscriptions_synced_at | string · date-time | yes | Nullable. |
| data.plan.server.plesk_sync_requested | boolean | yes | Whether a hosting-account sync is waiting for the agent to pick it up. |
| data.plan.server.created_at | string · date-time | yes | Nullable. |
| data.plan.server.updated_at | string · date-time | yes | Nullable. |
| data.plan.schedule | object | no | Nullable. |
| data.plan.schedule.id | integer | yes |  |
| data.plan.schedule.name | string | yes |  |
| data.plan.schedule.platform | boolean | yes | True for a shared catalog item that Clokeep provides to every client (read-only); false for one the client created. |
| data.plan.schedule.cron_expression | string | yes |  |
| data.plan.schedule.timezone | string | yes |  |
| data.plan.schedule.created_at | string · date-time | yes | Nullable. |
| data.plan.schedule.updated_at | string · date-time | yes | Nullable. |
| data.plan.compression_profile | object | no | Nullable. |
| data.plan.compression_profile.id | integer | yes |  |
| data.plan.compression_profile.name | string | yes |  |
| data.plan.compression_profile.platform | boolean | yes | True for a shared catalog item that Clokeep provides to every client (read-only); false for one the client created. |
| data.plan.compression_profile.archive_format | string | yes | One of: `tar`, `zip`. |
| data.plan.compression_profile.archive_format_label | string | yes | One of: `tar`, `zip`. |
| data.plan.compression_profile.compressor | string | yes | One of: `none`, `gzip`, `zstd`. |
| data.plan.compression_profile.compressor_label | string | yes | One of: `None`, `gzip`, `zstd`. |
| data.plan.compression_profile.level | integer | yes |  |
| data.plan.compression_profile.file_extension | string | yes |  |
| data.plan.compression_profile.is_default | boolean | yes |  |
| data.plan.compression_profile.created_at | string · date-time | yes | Nullable. |
| data.plan.compression_profile.updated_at | string · date-time | yes | Nullable. |
| data.plan.plan_template | object | no | Nullable. |
| data.plan.plan_template.id | integer | yes |  |
| data.plan.plan_template.slug | string | yes |  |
| data.plan.plan_template.name | string | yes |  |
| data.plan.plan_template.platform | boolean | yes | A shared catalog item: read-only to clients. |
| data.plan.plan_template.description | string | yes | Nullable. |
| data.plan.plan_template.type | string | yes | One of: `files`, `database`, `email`, `plesk_subscription`, `cpanel_account`. |
| data.plan.plan_template.type_label | string | yes | One of: `Files`, `Database`, `Email`, `Plesk server`, `cPanel server`. |
| data.plan.plan_template.default_schedule_id | integer | yes | Nullable. |
| data.plan.plan_template.default_compression_profile_id | integer | yes | Nullable. |
| data.plan.plan_template.default_config | object | yes | The settings a plan made from this template starts with; the keys are those of a plan's `config` for the same `type`. An empty list `[]` when nothing is set. Nullable. |
| data.plan.plan_template.is_system | boolean | yes |  |
| data.plan.plan_template.created_at | string · date-time | yes | Nullable. |
| data.plan.plan_template.updated_at | string · date-time | yes | Nullable. |
| data.plan.storages | object[] | no |  |
| data.plan.storages.id | integer | yes |  |
| data.plan.storages.storage_id | integer | yes |  |
| data.plan.storages.priority | integer | yes |  |
| data.plan.storages.path_prefix | string | yes | Nullable. |
| data.plan.storages.storage | object | no |  |
| data.plan.storages.storage.id | integer | yes |  |
| data.plan.storages.storage.name | string | yes |  |
| data.plan.storages.storage.driver | string | yes | One of: `s3`, `sftp`, `ftp`. |
| data.plan.storages.storage.driver_label | string | yes | One of: `S3`, `SFTP`, `FTP`. |
| data.plan.storages.storage.config | object | yes | The storage's non-secret settings; the keys depend on `driver`. s3: `bucket`, `region`, `endpoint`, `use_path_style_endpoint`, `root`. sftp: `host`, `port`, `root`, `timeout`, `host_key`. ftp: `host`, `port`, `root`, `timeout`, `ssl`, `passive` (the panel's own connections only; the agent always uses passive mode). Credentials are never returned. An empty list `[]` when nothing is set. Nullable. |
| data.plan.storages.storage.has_credentials | boolean | yes |  |
| data.plan.storages.storage.is_active | boolean | yes |  |
| data.plan.storages.storage.last_tested_at | string · date-time | yes | Nullable. |
| data.plan.storages.storage.last_test_status | string | yes | The outcome of the last connection test; null before the first. Nullable. One of: `success`, `failed`, `null`. |
| data.plan.storages.storage.object_lock_enabled | boolean | yes | Whether the S3 bucket has Object Lock turned on, as the last connection test found it. Detected, never set through the API; null for SFTP and FTP storages and before an S3 storage's first successful check. Nullable. |
| data.plan.storages.storage.created_at | string · date-time | yes | Nullable. |
| data.plan.storages.storage.updated_at | string · date-time | yes | Nullable. |
| data.plan.created_at | string · date-time | yes | Nullable. |
| data.plan.updated_at | string · date-time | yes | Nullable. |
| data.server | object | yes |  |
| data.server.id | integer | yes |  |
| data.server.name | string | yes |  |
| data.server.ip | string | yes | Nullable. |
| data.server.status | string | yes | One of: `pending`, `online`, `offline`. |
| data.server.status_label | string | yes | One of: `Pending`, `Online`, `Offline`. |
| data.server.control_panel | string | yes | One of: `none`, `plesk`, `cpanel`. |
| data.server.detected_control_panel | string | yes | Nullable. One of: `none`, `plesk`, `cpanel`, `null`. |
| data.server.last_seen_at | string · date-time | yes | Nullable. |
| data.server.agent_version | string | yes | Nullable. |
| data.server.account_portal_plugin_status | string | yes | What the agent last reported for the cPanel Backups plugin: `installed`, `not_installed` or `failed`. Null until an agent reports it. Nullable. |
| data.server.enrolled_at | string · date-time | yes | Nullable. |
| data.server.metadata | object | yes | Free-form details about the server: whatever the API or panel stored, plus `hostname` and `os` as the agent reports them. An empty list `[]` when nothing is set. Nullable. |
| data.server.work_dir | string | yes | The directory the agent stages and archives in: an absolute path the agent reports in `agent_work_dirs`, `auto` to let the agent pick the one with the most free space, or null for the agent default. Nullable. |
| data.server.agent_work_dirs | object[] | yes | The work directories the agent reported on its last heartbeat; null until an agent that reports them has checked in. Each entry has `path`, `default` (the agent's first choice), `available`, `free_bytes`, `total_bytes`, `source` (`config` for a directory from the agent's settings, `disk` for a detected one) and the nullable `mount_point`, `device` and `fs_type`. Nullable. |
| data.server.agent_work_dirs.path | string | yes |  |
| data.server.agent_work_dirs.default | boolean | yes |  |
| data.server.agent_work_dirs.available | boolean | yes |  |
| data.server.agent_work_dirs.free_bytes | integer | yes |  |
| data.server.agent_work_dirs.total_bytes | integer | yes |  |
| data.server.agent_work_dirs.source | string | yes |  |
| data.server.agent_work_dirs.mount_point | string | yes | Nullable. |
| data.server.agent_work_dirs.device | string | yes | Nullable. |
| data.server.agent_work_dirs.fs_type | string | yes | Nullable. |
| data.server.accounts_synced_at | string · date-time | yes | Nullable. |
| data.server.plesk_subscriptions_synced_at | string · date-time | yes | Nullable. |
| data.server.plesk_sync_requested | boolean | yes | Whether a hosting-account sync is waiting for the agent to pick it up. |
| data.server.created_at | string · date-time | yes | Nullable. |
| data.server.updated_at | string · date-time | yes | Nullable. |
| data.logs | object[] | no |  |
| data.logs.id | integer | yes |  |
| data.logs.backup_run_id | integer | yes |  |
| data.logs.level | string | yes | One of: `debug`, `info`, `warning`, `error`. |
| data.logs.level_label | string | yes | One of: `Debug`, `Info`, `Warning`, `Error`. |
| data.logs.message | string | yes |  |
| data.logs.context | object | yes | Extra details a line can carry; the keys vary by line. The agent's own lines carry none, so it is usually null. Nullable. |
| data.logs.created_at | string · date-time | yes |  |
| data.artifacts | object[] | no |  |
| data.artifacts.id | integer | yes |  |
| data.artifacts.backup_run_id | integer | yes | Nullable. |
| data.artifacts.storage_id | integer | yes | Nullable. |
| data.artifacts.remote_path | string | yes | Where the archive sits on its storage. |
| data.artifacts.filename | string | yes |  |
| data.artifacts.label | string | yes | A name the agent gives an archive that holds one account, such as its domain (`example.com`); null for other backups. Nullable. |
| data.artifacts.size_bytes | integer | yes | The archive's size on storage, in bytes. |
| data.artifacts.checksum | string | yes | The SHA-256 checksum of the archive. Nullable. |
| data.artifacts.encrypted | boolean | yes | True when the archive is encrypted at rest with the platform's key. An encrypted backup is restored through the agent; a download is the encrypted file, and single files cannot be extracted. |
| data.artifacts.file_list_encrypted | boolean | yes | True when the backup's file list is encrypted too (encrypted backups made by a current agent). The panel still shows it. |
| data.artifacts.hosting_account_id | integer | yes | The hosting account the archive holds, for a Plesk or cPanel backup (for example `17`); null otherwise. Nullable. |
| data.artifacts.compression_profile_id | integer | yes | Nullable. |
| data.artifacts.indexed_at | string · date-time | yes | When the backup's file list was stored; null for a backup that was never indexed. Nullable. |
| data.artifacts.index_format | string | yes | How the backup's file list is kept: `rows` (entry rows in the panel's database) or `files` (a manifest file stored beside the archive). One of: `rows`, `files`. |
| data.artifacts.entry_count | integer | yes | How many files and folders the backup lists. Nullable. |
| data.artifacts.file_count | integer | yes | How many of the entries are files. Nullable. |
| data.artifacts.total_size_bytes | integer | yes | The files' size before compression, in bytes. Nullable. |
| data.artifacts.has_references | boolean | yes | True when the file list points at files kept in earlier backups of an incremental chain. |
| data.artifacts.manifest_missing_at | string · date-time | yes | When a check found the backup's file list missing from storage (for example `2026-11-21T04:00:00+00:00`); null while it is there. Nullable. |
| data.artifacts.storage | object | no | Nullable. |
| data.artifacts.storage.id | integer | yes |  |
| data.artifacts.storage.name | string | yes |  |
| data.artifacts.storage.driver | string | yes | One of: `s3`, `sftp`, `ftp`. |
| data.artifacts.storage.driver_label | string | yes | One of: `S3`, `SFTP`, `FTP`. |
| data.artifacts.storage.config | object | yes | The storage's non-secret settings; the keys depend on `driver`. s3: `bucket`, `region`, `endpoint`, `use_path_style_endpoint`, `root`. sftp: `host`, `port`, `root`, `timeout`, `host_key`. ftp: `host`, `port`, `root`, `timeout`, `ssl`, `passive` (the panel's own connections only; the agent always uses passive mode). Credentials are never returned. An empty list `[]` when nothing is set. Nullable. |
| data.artifacts.storage.has_credentials | boolean | yes |  |
| data.artifacts.storage.is_active | boolean | yes |  |
| data.artifacts.storage.last_tested_at | string · date-time | yes | Nullable. |
| data.artifacts.storage.last_test_status | string | yes | The outcome of the last connection test; null before the first. Nullable. One of: `success`, `failed`, `null`. |
| data.artifacts.storage.object_lock_enabled | boolean | yes | Whether the S3 bucket has Object Lock turned on, as the last connection test found it. Detected, never set through the API; null for SFTP and FTP storages and before an S3 storage's first successful check. Nullable. |
| data.artifacts.storage.created_at | string · date-time | yes | Nullable. |
| data.artifacts.storage.updated_at | string · date-time | yes | Nullable. |
| data.artifacts.compression_profile | object | no | Nullable. |
| data.artifacts.compression_profile.id | integer | yes |  |
| data.artifacts.compression_profile.name | string | yes |  |
| data.artifacts.compression_profile.platform | boolean | yes | True for a shared catalog item that Clokeep provides to every client (read-only); false for one the client created. |
| data.artifacts.compression_profile.archive_format | string | yes | One of: `tar`, `zip`. |
| data.artifacts.compression_profile.archive_format_label | string | yes | One of: `tar`, `zip`. |
| data.artifacts.compression_profile.compressor | string | yes | One of: `none`, `gzip`, `zstd`. |
| data.artifacts.compression_profile.compressor_label | string | yes | One of: `None`, `gzip`, `zstd`. |
| data.artifacts.compression_profile.level | integer | yes |  |
| data.artifacts.compression_profile.file_extension | string | yes |  |
| data.artifacts.compression_profile.is_default | boolean | yes |  |
| data.artifacts.compression_profile.created_at | string · date-time | yes | Nullable. |
| data.artifacts.compression_profile.updated_at | string · date-time | yes | Nullable. |
| data.artifacts.created_at | string · date-time | yes | Nullable. |
| data.artifacts.updated_at | string · date-time | yes | Nullable. |
| data.created_at | string · date-time | yes | When the run was queued. Nullable. |
| data.updated_at | string · date-time | yes | Nullable. |

### 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 do this. The `message` says why: `This token lacks the required ability.` (a `read` token), `Your role does not permit this action.` (its owner is not an Admin or Operator 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. |

### 409

Another restore on the same server is queued or running.

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

### 422

The body or the query is invalid. `message` names the first problem and `errors` lists every problem by field. A backup whose server or plan was deleted, or one missing from storage at the last check, is refused with a `message` only.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| message | string | yes | The first problem, and how many more there are. |
| errors | object | yes | Every problem, by field. |

### 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. |

### 503

The backup's file index cannot be read from storage right now. Try again later.

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

## Request example

```bash
curl -X POST 'https://app.clokeep.com/api/v1/artifacts/2291/restore' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "target_path": "/var/www/restore",
    "overwrite_policy": "skip_existing"
  }'
```

## Response example (202)

```json
{
  "data": {
    "id": 1875,
    "plan_id": 41,
    "server_id": 12,
    "kind": "restore",
    "kind_label": "Restore",
    "trigger": "api",
    "trigger_label": "API",
    "status": "queued",
    "status_label": "Queued",
    "progress_percent": 0,
    "current_step": null,
    "message": null,
    "queue": "backups",
    "laravel_job_uuid": null,
    "started_at": null,
    "finished_at": null,
    "cancel_requested_at": null,
    "error_message": null,
    "initiated_by_user_id": 8,
    "restore": {
      "source_artifact_id": 2291,
      "mode": "alternate_path",
      "target_path": "/var/www/restore",
      "overwrite_policy": "skip_existing",
      "database_connection_id": null,
      "account": null
    },
    "plan": {
      "id": 41,
      "server_id": 12,
      "plan_template_id": 1,
      "name": "Nightly files",
      "type": "files",
      "type_label": "Files",
      "schedule_id": 7,
      "compression_profile_id": 2,
      "enabled": true,
      "encrypts_new_backups": false,
      "config": {
        "backup_path_ids": [
          5
        ],
        "incremental": true,
        "full_every": 7,
        "archive_per_path": false,
        "dedup_disabled": false
      },
      "retention_days": 30,
      "retention_count": 7,
      "created_at": "2026-11-01T09:14:22+00:00",
      "updated_at": "2026-11-18T16:40:05+00:00"
    },
    "server": {
      "id": 12,
      "name": "web-01",
      "ip": "203.0.113.10",
      "status": "online",
      "status_label": "Online",
      "control_panel": "plesk",
      "detected_control_panel": "plesk",
      "last_seen_at": "2026-11-20T02:00:04+00:00",
      "agent_version": "1.4.1",
      "account_portal_plugin_status": null,
      "enrolled_at": "2026-11-01T09:20:00+00:00",
      "metadata": {
        "hostname": "web-01.example.com",
        "os": "Ubuntu 22.04"
      },
      "work_dir": "/var/backups/clokeep",
      "agent_work_dirs": [
        {
          "path": "/var/backups/clokeep",
          "default": true,
          "available": true,
          "free_bytes": 214748364800,
          "total_bytes": 536870912000,
          "source": "config",
          "mount_point": "/",
          "device": "/dev/sda1",
          "fs_type": "ext4"
        }
      ],
      "accounts_synced_at": "2026-11-20T01:30:04+00:00",
      "plesk_subscriptions_synced_at": "2026-11-20T01:30:04+00:00",
      "plesk_sync_requested": false,
      "created_at": "2026-11-01T09:14:22+00:00",
      "updated_at": "2026-11-20T02:00:04+00:00"
    },
    "created_at": "2026-11-20T10:40:00+00:00",
    "updated_at": "2026-11-20T10:40:00+00:00"
  }
}
```

## Response example (401)

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

## Response example (403)

```json
{
  "message": "This token lacks the required ability."
}
```

## Response example (404)

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

## Response example (409)

```json
{
  "message": "Server \"web-01\" already has an active restore run."
}
```

## Response example (422)

```json
{
  "message": "The target path field is required.",
  "errors": {
    "target_path": [
      "The target path field is required."
    ]
  }
}
```

## Response example (429)

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

## Response example (503)

```json
{
  "message": "The file list of this backup is unavailable: storage unreachable."
}
```
