Restore a revision

View as Markdown
Republish an older revision as a new revision at the head of this branch. Restore does not overwrite history; the older revision keeps its ID, and a new revision is committed on top. The response mirrors `POST /agent/{id}/branches/{branchId}/draft/publish`: `200 committed` if the scan is synchronous, `202 scanning` if deferred. Only one publish or restore can be in flight per branch at a time.

Authentication

AuthorizationBearer

API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.

Path parameters

idstringRequiredformat: "^[a-f\d]{24}$"
The agent ID.
branchIdstringRequiredformat: "^[a-f\d]{24}$"
The branch ID.
revisionIdstringRequiredformat: "^[a-f\d]{24}$"

The revision ID. Equal to the v1 versionId for revisions that were migrated from the v1 model.

Response

Restored synchronously.
statusboolean
dataobject

Result of publish or restore.

  • state: "committed" (HTTP 200) is returned when the commit is synchronous. This happens for restore (the source revision has already been scanned) and for publishes whose content does not need a fresh scan. The response includes the new revision object under revision.
  • state: "scanning" (HTTP 202) is returned when a security scan is deferred. In this case the response body carries only state. revision is absent, and clients must list the branch’s revisions newest-first (GET /agent/{id}/branches/{branchId}/revisions?limit=1) to obtain the new revision ID. Then poll GET /agent/{id}/branches/{branchId}/revisions/{revisionId} until revision.status flips from any transient value to "published". On the revision doc the lifecycle field is status (not state), and the security-scan sub-lifecycle is on the nested securityCheck.status.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
423
Locked Error
500
Internal Server Error