Create a branch
Fork a new branch from an existing branch. The source branch must have at least one committed revision. Branch names are unique per agent; the name Main is reserved for the default branch. Creating from a branch whose latest draft is still scanning returns 409 source_scanning.
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.
Request
This endpoint expects an object.
sourceBranchId
Branch to fork from. Its head revision must exist.
name
New branch name. Unique per agent among active branches. main is reserved.
Response
Branch created.
status
data
An AgentBranch document. An editable copy of an agent with its own draft slot and revision chain.
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

