Publish draft
Publish the open draft on this branch as a new revision.
The response is `200` with `state: "committed"` when the security scan finishes synchronously, and `202` with `state: "scanning"` when the scan is deferred. A `scanning` revision is visible in history but cannot be restored or made live until it becomes `committed`. If the scan fails, the revision is left in `scanning` state and this endpoint returns `409` on subsequent publishes until the scan is retried.
Publishing on the live branch pushes to production immediately.
Authentication
AuthorizationBearer
API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.
Path parameters
id
The agent ID.
branchId
The branch ID.
Request
This endpoint expects an object.
label
Optional label saved on the committed revision.
Response
Draft committed synchronously.
status
data
Result of publish or restore.
state: "committed"(HTTP200) 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 underrevision.state: "scanning"(HTTP202) is returned when a security scan is deferred. In this case the response body carries onlystate.revisionis 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 pollGET /agent/{id}/branches/{branchId}/revisions/{revisionId}untilrevision.statusflips from any transient value to"published". On the revision doc the lifecycle field isstatus(notstate), and the security-scan sub-lifecycle is on the nestedsecurityCheck.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

