Skip to main content

Generate task draft

Generate AI draft content for a task on demand (just-in-time).

POST/api/task-queue/{task_id}/draft
HTTP referenceScope tasks:writeUpdated September 27, 2026

This page documents the canonical HTTP contract for this endpoint.

Draft generation model

Drafts are generated just-in-time when requested, then persisted onto the task content payload. The task must be an AI-generated sequence task with a valid sequence step; this endpoint invokes AI generation and changes the stored task content.

Used for manual-capable sequence steps when aiDraft=true.

Path parameters

  • task_idrequired

    string

    Task ID.

Query parameters

  • actorUserId · optional

    string

    Optional actor override.

Body parameters

  • force · optional

    boolean

    Force regeneration of existing draft content; defaults to false.

Errors

StatusMeaning
400Invalid payload or actor.
401Invalid API key or missing auth.
403Missing tasks:write scope.
404Task or sequence not found.
409Draft generation is blocked by task orchestration state.

Docs