## Restore an instance to an earlier state version (tenant:settings:write)

`POST /api/workflow/v1/tasks/{instanceId}/recover`

Module: Workflow · operationId: `restoreInstanceVersion` · Tag: Instances · Auth: access token (`Authorization: Bearer <accessToken>`)

Saves the state of revision `versionId` as a new revision and writes it to trade, which locks or
releases the transaction accordingly. `409` when another instance is already active for the
transaction, when the version belongs to a start that never ran, or on a concurrent change.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `versionId` | query | integer (int64) | yes | Revision to restore (`versionId` from the version list) |
| `instanceId` | path | string (uuid) | yes | Instance id (`guid`) |

### Responses

- **200** Restored (no body)
- **400** Error (`application/json`)
- **401** Missing or invalid token (`unauthorized`) (`application/json`)
- **403** Error (`application/json`)
- **404** Error (`application/json`)
- **409** Error (`application/json`)
- **500** Error (`application/json`)

### Example request

```bash
curl -X POST 'https://api.mbcom.cloud/api/workflow/v1/tasks/3f9c2a1e-8b7d-4c6e-a5f4-1d2b3c4e5f60/recover?versionId=3' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
