> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lacy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore previous version

> Roll an automation back to its previous published version

This endpoint rolls an automation back to the version published immediately before the current one and re-publishes it — the undo for an update that made things worse. Only the previous version is supported. An automation that was turned off stays off after the restore.

### Path Parameters

**id** `string` *required*

The ID of the automation (from [List automations](https://docs.lacy.ai/api-reference/automations/list-automations.md))

This endpoint takes no request body.

### Response

**automation\_id** `string`

The automation's ID

**name** `string`

The automation's name after the restore

**status** `string`

`enabled` or `disabled` — the on/off state the automation had going into the restore is preserved

**restored\_version\_id** `string`

The ID of the version that is now live

**note** `string`

Confirmation that the previous version was restored and re-published

A missing automation — or one that does not belong to your account — returns a `404`.

### Error codes (`422`)

| `error` | Meaning |
| - | - |
| `no_previous_version` | There is no earlier version of this automation to roll back to. |
| `rollback_failed` | The previous version could not be restored — nothing changed. |
| `publish_failed` | The previous version was restored as the draft but could not be published, so it is not live yet — publish it in the app or retry. |

```json 200 Response theme={null}
{
  "automation_id": "f4EaLhOW2zoEsXXSOJP2r",
  "name": "Order lookup",
  "status": "enabled",
  "restored_version_id": "8auMJQtqBnE1X8ZP7WVnI",
  "note": "Rolled back to the previous published version and re-published it live."
}
```

```json 422 Response (nothing to roll back to) theme={null}
{
  "message": "There is no earlier version of this automation to roll back to.",
  "error": "no_previous_version"
}
```

```json 404 Response theme={null}
{
  "message": "Automation not found, or it does not belong to your account.",
  "error": "not_found"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.