> This page is for API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.eon.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.eon.io/_mcp/server.

# Restore Files

POST https://%7Baccount-domain%7D.console.eon.io/api/v1/projects/{projectId}/resources/{id}/snapshots/{snapshotId}/restore-files
Content-Type: application/json

Restores files from an Eon snapshot.

This operation is asynchronous.
It triggers a restore job and returns a job ID, which can be used to track the progress of the restore job.
You can follow the progress of the restore job by calling [Get Restore Job](/api/api-reference/jobs/restore-jobs/get-restore-job) with the job ID.


Reference: https://docs.eon.io/api/api-reference/restore/restore-files

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `projectId` (string, required) — ID of the project the snapshot is in. You can get your project ID from the [API Credentials](https://console.eon.io/global-management/api-credentials) page in your global management console.
- `id` (string, required) — Eon-assigned resource ID.
- `snapshotId` (string, required) — ID of the Eon [snapshot](/api/api-reference/backup-management/snapshots/list-resource-snapshots) to restore.

### Body (application/json)

This endpoint expects a RestoreFilesRequest.

- `destination` (ObjectStorageDestination, required)
- `files` (list of FilePath, required) — List of file paths to restore.
- `restoreAccountId` (string, required) — Eon-assigned ID of the restore account.

## Response

### 202

Restore job started.

- `jobId` (string, required) — Restore job ID.

## Errors

### 404 Not Found Error

Project, resource, or snapshot wasn't found.

- `any`

## Types

### ObjectStorageDestination

- `s3Bucket` (S3RestoreTarget, optional) — Information about the S3 bucket where you want to restore the files. If you don't specify a target, the files are restored to the original bucket.
- `storageAccount` (StorageAccountRestoreTarget, optional) — Information about the storage account where you want to restore the files. If you don't specify a target, the files are restored to the original storage account.
- `gcsBucket` (GCSRestoreTarget, optional) — Information about the Google Cloud Storage bucket where you want to restore the files. If you don't specify a target, the files are restored to the original bucket.

### FilePath

- `path` (string, required) — Absolute path to the file or directory to restore.
- `isDirectory` (boolean, required) — Whether `path` is a directory. If `true`, Eon restores all files in all subdirectories under the path. If `false`, Eon restores only the file at the path.

### S3RestoreTarget

Information about the S3 bucket where you want to restore the files. If you don't specify a target, the files are restored to the original bucket.

- `bucketName` (string, required) — Name of an existing bucket to restore the files to.
- `encryptionKeyId` (string, optional) — ID of the key you want Eon to use for encrypting the restored files.
- `prefix` (string, optional) — Prefix to add to the restore path. If you don't specify a prefix, the files are restored to their respective folders in the original file tree, starting from the root of the bucket.

### StorageAccountRestoreTarget

Information about the storage account where you want to restore the files. If you don't specify a target, the files are restored to the original storage account.

- `name` (string, required) — Name of the storage account to restore the files to.
- `container` (string, required) — Name of the container in the storage account to restore the files to.
- `resourceGroup` (string, optional) — Name of the resource group that contains the storage account.
- `prefix` (string, optional) — Prefix to add to the restore path. If you don't specify a prefix, the files are restored to their respective folders in the original file tree, starting from the root of the container.

### GCSRestoreTarget

Information about the Google Cloud Storage bucket where you want to restore the files. If you don't specify a target, the files are restored to the original bucket.

- `bucketName` (string, required) — Name of an existing bucket to restore the files to.
- `prefix` (string, optional) — Prefix to add to the restore path. If you don't specify a prefix, the files are restored to their respective folders in the original file tree, starting from the root of the bucket.

## Examples

**Request**

```json
{
  "files": [
    {
      "path": "string",
      "isDirectory": true
    }
  ],
  "restoreAccountId": "1ee34dc5-0a7c-4e56-a820-917371e05c8d"
}
```

**Response**

```json
{
  "jobId": "9892ecab-22d5-47ca-b2b4-70369e80b90a"
}
```

**SDK Code**

```python
import requests

url = "https://{account-domain}.console.eon.io/api/v1/projects/1ee34dc5-0a7c-4e56-a820-917371e05c8d/resources/043090df-9fe5-4f89-9859-45db589c2936/snapshots/c11d3c11-7be5-4ee4-9eb8-2024d9c04904/restore-files"

payload = {
    "files": [
        {
            "path": "string",
            "isDirectory": True
        }
    ],
    "restoreAccountId": "1ee34dc5-0a7c-4e56-a820-917371e05c8d"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{account-domain}.console.eon.io/api/v1/projects/1ee34dc5-0a7c-4e56-a820-917371e05c8d/resources/043090df-9fe5-4f89-9859-45db589c2936/snapshots/c11d3c11-7be5-4ee4-9eb8-2024d9c04904/restore-files';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"files":[{"path":"string","isDirectory":true}],"restoreAccountId":"1ee34dc5-0a7c-4e56-a820-917371e05c8d"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://{account-domain}.console.eon.io/api/v1/projects/1ee34dc5-0a7c-4e56-a820-917371e05c8d/resources/043090df-9fe5-4f89-9859-45db589c2936/snapshots/c11d3c11-7be5-4ee4-9eb8-2024d9c04904/restore-files")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"files\": [\n    {\n      \"path\": \"string\",\n      \"isDirectory\": true\n    }\n  ],\n  \"restoreAccountId\": \"1ee34dc5-0a7c-4e56-a820-917371e05c8d\"\n}")
  .asString();
```