Fork a new variant branch
POSThttps://platform.docana.com/api/v1/agents/:agentId/branches/
Forks a new CANDIDATE branch, copying a spec into a fresh, independent artifact lineage. The source can be this agent's own lineage (published, draft, or a specific artifact version), ANOTHER agent in the same application (agent, copying that agent’s published version or current draft), or a spec document supplied inline (spec, e.g. the agent.spec of an exported agent file — only the spec is imported; evals, routines, sub-agents and insights in the export are not). Never touches the agent's published pointer — a fork is purely additive until a later promote. Capped at 10 live variants per agent.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 500
The forked branch
Invalid request body
The API key or session is missing, expired, or malformed.
The caller is authenticated but not allowed to perform this operation.
Agent not found, no access to the application, or fork source not found
A branch with this name already exists; the variant cap was reached; the fork source has nothing to copy (this agent, or the named source agent, has no published version or no draft); or an agent source named this same agent (use published or draft to fork an agent from itself)
Unexpected server error.