Skip to main content

Rollback a Policy

Rolls back a policy to a specific previous version. This creates a new version with the recipe from the specified version — it does not delete any version history.
POST /v1/docks/:dockId/policies/:policyId/rollback/:version

Path Parameters

ParameterTypeDescription
dockIdstringThe dock ID
policyIdstringThe policy ID
versionintegerThe version number to rollback to

Example Request

curl -X POST https://api.docyard.io/v1/docks/dock_01HQ3K.../policies/pol_01HQ3P.../rollback/2 \
  -H "Authorization: Bearer dk_live_a1b2c3d4..."

Response

{
  "version": 5,
  "policyId": "pol_01HQ3P...",
  "recipe": {
    "access": "read",
    "artifactTypes": ["declaration-page", "coi"],
    "requireFactors": ["email_verified"],
    "expiresInDays": 90
  },
  "changelog": "Rollback to version 2",
  "createdAt": "2025-01-26T10:00:00.000Z"
}

Error Handling

StatusCondition
401Missing or invalid API key
404Policy, dock, or version not found
Rollback is non-destructive. A new version is created with the recipe from the target version. The full version history is preserved, making it easy to audit changes.