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

# Bulk Attach Restore Template

POST https://%7Baccount-domain%7D.console.eon.io/api/v1/projects/{projectId}/restore-template/{restoreTemplateId}/bulk-attach
Content-Type: application/json

Attaches a restore template to multiple resources.

Existing restore template assignments on the resources are overwritten.


Reference: https://docs.eon.io/api/api-reference/restore-connections/restore-templates/bulk-attach-restore-template

## 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 restore template 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.
- `restoreTemplateId` (string, required) — ID of the restore template to attach to the resources.

### Body (application/json)

This endpoint expects a BulkAttachRestoreTemplateRequest.

- `resourceIds` (list of string, required) — List of Eon-assigned resource IDs to attach the restore template to.

## Response

### 204

Restore template attached.

## Errors

### 400 Bad Request Error

Invalid request. Typically this indicates that the restore template type is incompatible with a resource type.

- `any`

### 404 Not Found Error

Restore template wasn't found.

- `any`

## Examples

**Request**

```json
{
  "resourceIds": [
    "043090df-9fe5-4f89-9859-45db589c2936",
    "7b3d5a2e-1c4f-4a8b-b9e0-2f1d3c5e7a8b"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://{account-domain}.console.eon.io/api/v1/projects/733888d8-2573-5f9a-b81d-21f051d24fda/restore-template/de308488-df3d-5b82-8f37-477ef529f491/bulk-attach"

payload = { "resourceIds": ["043090df-9fe5-4f89-9859-45db589c2936", "7b3d5a2e-1c4f-4a8b-b9e0-2f1d3c5e7a8b"] }
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/733888d8-2573-5f9a-b81d-21f051d24fda/restore-template/de308488-df3d-5b82-8f37-477ef529f491/bulk-attach';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"resourceIds":["043090df-9fe5-4f89-9859-45db589c2936","7b3d5a2e-1c4f-4a8b-b9e0-2f1d3c5e7a8b"]}'
};

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/733888d8-2573-5f9a-b81d-21f051d24fda/restore-template/de308488-df3d-5b82-8f37-477ef529f491/bulk-attach")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"resourceIds\": [\n    \"043090df-9fe5-4f89-9859-45db589c2936\",\n    \"7b3d5a2e-1c4f-4a8b-b9e0-2f1d3c5e7a8b\"\n  ]\n}")
  .asString();
```