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

# Rollback

> POST /api/configs/:id/rollback

<Note>
  Requires **Pro** or **Team** plan.
</Note>

## Request

```bash theme={null}
POST /api/configs/:id/rollback
```

Rolls back a config to a previous version. This creates a **new version** with the target version's data (similar to `git revert`).

### Path parameters

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `id`      | `string` | Config UUID |

### Body

```json theme={null}
{
  "versionId": "version-uuid-to-rollback-to"
}
```

| Field       | Type     | Required | Description                        |
| ----------- | -------- | -------- | ---------------------------------- |
| `versionId` | `string` | Yes      | UUID of the version to rollback to |

### Example

```bash theme={null}
curl -X POST https://lazyraccoon.dev/api/configs/config-uuid/rollback \
  -H "Authorization: Bearer lr_your_key" \
  -H "Content-Type: application/json" \
  -d '{"versionId": "version-uuid"}'
```

## Response

```json theme={null}
{
  "id": "new-version-uuid",
  "version": 4,
  "hash": "def456...",
  "createdAt": "2026-03-13T12:00:00.000Z",
  "isCurrent": true
}
```

### Authorization

* **Personal configs**: only the owner can rollback
* **Team configs**: requires **owner** or **admin** role
