Promote a variant branch to MAIN
POSThttps://platform.docana.com/api/v1/agents/:agentId/branches/:branchId/promote/
Promotes a variant branch: makes it the agent's main line by flipping the agent's draft pointer (Agent.metadata.specArtifactId) and both branch rows (old MAIN -> CANDIDATE, variant -> MAIN) together. The old MAIN line is demoted, not archived — it keeps its artifact and version history and stays a fully editable variant that can be renamed, edited, promoted back, or deleted. This does not publish — Agent.publishedArtifactId/publishedVersion are left exactly where they were, and production keeps serving whatever was last published until a separate call to the publish endpoint. A stale promote — one whose fork base is no longer what is published — is rejected with 409 unless acknowledgeSupersede is true.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 500
The branch was promoted
The request body, query, or path failed validation. See validationErrors.
The API key or session is missing, expired, or malformed.
The caller is authenticated but not allowed to perform this operation.
Branch not found, not owned by this agent, or no access to its application
Only a variant branch can be promoted, or it is stale and was not acknowledged
Unexpected server error.