---
title: "Rollback policy"
url: https://hexelstudio.com/docs/api/titan/management/rollback-policy
---

# Rollback policy

**POST** `/titan/management/deployments/{id}/policy/versions/{source_revision}:rollback`

Re-applies the version's source as a new revision (the revision in force plus one) through the same path as PUT .../policy: compiled, checked against Titan's terms, the organization's policy layers and the deployment's capabilities, and signed by the Configuration Authority. Records the audit events deployment.policy_updated (rollback_of_revision) and deployment.policy_rolled_back, and a version of origin rollback. The policy in force's authorization_not_before is kept when it is later than the version's (a rollback never lifts an authorization cutoff); authorization_not_before_kept says so.

## Path parameters

- `id: string`

- `source_revision: integer`

  A source_revision of the deployment's policy history.

## Headers

- `Authorization: string`

  `Bearer <token>`. A Hexel Studio access token for a member or a service user of your organization (or send a service user's API key as X-API-Key).

- `If-Match: optional string`

  The source_digest of the policy in force the caller saw (GET .../policy), quoted or not (* is refused); an alternative to base_source_revision. The rollback is refused with 409 POLICY_REVISION_STALE when the policy in force has another digest.

## Body parameters

- `base_source_revision: optional integer`

- `note: optional string`

## Returns

`200` Organization-scoped result. (`PolicyRollbackResult`)

- `authorization_not_before_kept: boolean`

- `policy: object`

  - `deployment_id: string`

  - `enforcement_deployment_id: string`

  - `policy_source_id: string`

  - `source: any`

  - `source_digest: string`

  - `source_revision: integer`

- `rolled_back_to_revision: integer`

- `version: object`

  - `compiled_digest: string`

  - `created_at: string`

  - `created_by: optional string`

  - `current: boolean`

  - `note: optional string`

  - `origin: string`

  - `policy_source_id: string`

  - `rollback_of_revision: optional integer`

  - `source_digest: string`

  - `source_revision: integer`

  - `suggestion_id: optional string`

## Errors

- `400` Invalid request, path or query; on a rollback, INVALID_REQUEST when neither base_source_revision nor If-Match is given, If-Match is *, the body is not the closed rollback body or the note is not 1-500 characters without control characters; POLICY_INVALID, POLICY_TERM_UNSUPPORTED or OBLIGATION_PROFILE_UNKNOWN when the version's source is no longer valid for the deployment (the codes a PUT .../policy of it gets: for example a toolkit the capability selection no longer has, or a watch-only rule while watch-only rules is off).
- `401` Missing or invalid authenticated context.
- `403` Organization mismatch, or an IAM action is denied: to list, read and compare, both titan:enforcement_deployment:read (as GET .../policy) and titan:policy:read; to roll back, both titan:enforcement_deployment:create (as PUT .../policy) and titan:policy:publish.
- `404` Unknown or foreign deployment; POLICY_VERSION_NOT_FOUND when the history does not hold the revision (never recorded, or pruned past the 1000 kept); NOT_FOUND for every history path while the caller's organization does not have policy history.
- `405` HTTP method is not supported on this route.
- `409` POLICY_REVISION_STALE when the base (base_source_revision or If-Match) is not the policy in force; POLICY_VERSION_CURRENT when the version's content is the policy in force; the deployment is not a provisioned Titan Cloud or Titan Dedicated deployment (DEPLOYMENT_NOT_PROVISIONED), is retired (DEPLOYMENT_RETIRED) or has an operation in progress (OPERATION_IN_PROGRESS).
- `413` Request body exceeds its size limit.
- `415` Unsupported request media type.
- `502` The deployment's Configuration Authority refused or answered unexpectedly (closed code).
- `503` Local storage or the deployment's Configuration Authority unavailable.

## Example

```bash
curl --request POST \
  --url 'https://api.hexelstudio.com/v1/titan/management/deployments/{id}/policy/versions/{source_revision}:rollback' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "base_source_revision": 0,
  "note": "string"
}'
```

### Response (200)

```json
{
  "authorization_not_before_kept": true,
  "policy": {
    "deployment_id": "string",
    "enforcement_deployment_id": "string",
    "policy_source_id": "string",
    "source": "string",
    "source_digest": "string",
    "source_revision": 0
  },
  "rolled_back_to_revision": 0,
  "version": {
    "compiled_digest": "string",
    "created_at": "2026-01-01T00:00:00Z",
    "created_by": "string",
    "current": true,
    "note": "string",
    "origin": "string",
    "policy_source_id": "string",
    "rollback_of_revision": 0,
    "source_digest": "string",
    "source_revision": 0,
    "suggestion_id": "string"
  }
}
```

### Response (400)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (401)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (403)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (404)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (405)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (409)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (413)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (415)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (502)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```

### Response (503)

```json
{
  "error": {
    "billing_url": "string",
    "code": "string",
    "message": "string"
  }
}
```
