Create a draft

Deprecated
View as Markdown
**Deprecated on the v2 branch model.** Migrate to `PUT /agent/{id}/branches/{branchId}/draft`. When `ENABLE_BRANCH_MODEL` is on, this endpoint returns `409 versioning_v2_migration_required` with the `Deprecation: true` header. See the [migration guide](/voice-agents/deprecations/agent-versioning-migration). Create a new draft from an existing published version or another draft. At least one of sourceVersionId or sourceDraftId is required (both may be sent simultaneously).

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.

Request

This endpoint expects an object.
sourceVersionIdstringOptionalformat: "^[a-f\d]{24}$"

ID of a published version to branch from. Must be a valid MongoDB ObjectId (24-char hex). Sending a non-ObjectId format returns 400.

sourceDraftIdstringOptional
ID of an existing draft to branch from
draftNamestringOptional1-100 characters

Optional name for the draft (1–100 characters)

Response

Draft created successfully
statusboolean
dataobject
Represents either a draft revision or a published version of an agent's configuration.

Errors

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