# Roll Back to an Earlier Version

Publish a version that was once active again, as a new version.

## Overview

- `setId` names an archived version that was active once. Its rules are copied exactly into a new version (`copiedFromSetId`), authored by the caller and submitted.
- `201` with the new version: `active` at once where the tenant's quorum is off, `awaiting_quorum` where it applies — then another administrator [publishes](https://docs.aureahub.com/docs/policy-set-publish.md) it.
- `description`: optional, for the new version.
- `409` `POLICY_SET_NOT_ARCHIVED` (`Only an archived version is rolled back to`) or `POLICY_SET_NEVER_ACTIVE` (`This version was never active: copy it into a draft instead`).
- **A passkey step-up**: `stepUpToken`, your passkey's `policy_set.rollback` step-up on the archived version (`setId`) ([Passkeys & Step-Up](https://docs.aureahub.com/docs/guide-passkeys.md)). Where your tenant's step-up mode is `enforce` — on request; a tenant on the institutional profile by its profile —, it is required: without it `403` `STEP_UP_REQUIRED`, with one that is not for this `403` `STEP_UP_INVALID`, checked after the `409`s above; nothing is created. In `log` the right one is used, and a missing or wrong one refuses nothing. A new version left `awaiting_quorum` is confirmed again by the administrator who publishes it, with their own `policy_set.publish` step-up.

## Endpoint

### `POST /v1/policy-sets/{setId}/rollback`

Authentication: bearer token required.

Copies an archived, once-active version into a new version and submits it.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `setId` | string | yes | The archived version's id |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string \| null | no | For the new version |
| `stepUpToken` | string | no | Your passkey's `policy_set.rollback` step-up token for the archived version, 1–200 characters: required where your tenant's step-up mode is `enforce` |

**Responses**

`409` Never active

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "This version was never active: copy it into a draft instead",
  "details": { "code": "POLICY_SET_NEVER_ACTIVE", "status": "archived" }
}
```

`403` Step-up required

```json
{
  "statusCode": 403,
  "error": "ForbiddenError",
  "message": "Confirm this with your passkey: ask POST /v1/auth/step-up/options for this action, then send its stepUpToken",
  "details": {
    "code": "STEP_UP_REQUIRED",
    "action": "policy_set.rollback",
    "tenantId": "6f1e2d3c-4b5a-4968-8776-a5b4c3d2e1f0"
  }
}
```

---

Web version: https://docs.aureahub.com/#policy-set-rollback
