Agent Versioning - Drafts

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.

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).

post/agent/{id}/drafts

Request

  • Base URL
    https://api.smallest.ai/atoms/v1
  • URL
    https://api.smallest.ai/atoms/v1/agent/{id}/drafts
  • Auth
    HTTP bearer

Path parameters

idstring required

The agent ID.

Request body

sourceVersionIdstring

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

sourceDraftIdstring

ID of an existing draft to branch from

draftNamestring

Optional name for the draft (1–100 characters)

Response

Draft created successfully

statusboolean

Example response

{
  "status": true
}

Changes

    • warning

      added the new multi_agents enum value to the / response property for the response status

    • breaking

      added the pattern ^[a-f\d]{24}$ to the path request parameter id

    • info

      endpoint deprecated

    • info

      added the non-success response with the status