---
title: "Create a draft task"
method: POST
path: "/tasks/draft"
tags: ["Uploads"]
---

# Create a draft task

`POST /tasks/draft`

## Request

- Base URL: `https://api.autumn.ai`
- URL: `https://api.autumn.ai/tasks/draft`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`
  - HTTP bearer

An empty task to attach uploads to. Start it with POST /task and its task_id.

## Request body

- DraftRequest
  - `name` string, nullable
  - `output` object, nullable: The output artifact to collect: id, kind, path, name; for research also schema, schema_order, target_count.
  - `source_data` object, nullable

## Response `200`

The empty task. Store task_id.

- Task
  - `task_id` string, required
  - `name` string, nullable
  - `status` string, nullable: Legacy; use state and done. `plan` (idle, or finished), `execute` (working), `accepted` (queued), `deleted`.
  - `phase` 'plan' | 'execute', nullable: Legacy; use state and done.
  - `activity` string, nullable: Legacy; use state and done. idle, queued, planning, executing or thinking. `queued` is waiting for a free slot and starts on its own. Finished is `idle`.
  - `output_count` integer, nullable
  - `credits_used` integer, nullable
  - `created_at` string, nullable
  - `updated_at` string, nullable
  - `poll_after_s` integer, nullable: Seconds to wait before polling status again.
  - `status_url` string, nullable
  - `task_url` string, nullable: API resource URL, relative to the API server. Open the chat in the browser at https://platform.autumn.ai/?task={task_id}.
  - `output_url` string, nullable
  - `stream_url` string, nullable
  - `queue` QueueState
    - `position` integer, required: Place in line, 1 is next.
    - `eta_s` integer, required: Estimated seconds until the run starts.
  - `state` string, nullable: A2A lifecycle state: submitted, working, input-required, completed, canceled or failed.
  - `done` boolean, nullable: True for input-required, completed, canceled and failed.
  - `stage` string, nullable: Current stage while the task is active.
  - `message` string, nullable: Latest public-facing task message.
  - `answer` string, nullable: Full saved assistant answer for a completed chat task without output rows.
  - `progress` object, nullable: Rows saved and optional target count.
  - `elapsed_s` integer, nullable: Elapsed seconds in the current or most recent run.
  - `queue_position` integer, nullable: Place in line for a queued task, or null when not queued.
  - `queued_messages` QueuedMessage[], nullable: Follow-ups queued behind the current turn.
    - `id` string, required
    - `text` string, nullable
    - `state` string, nullable: queued, sending, sent or dropped.
    - `error` string, nullable
  - `queued_count` integer: Pending queued follow-ups.
  - `outcome` string, nullable: Normalized completed outcome.
  - `error` object, nullable: Public failure code and recovery guidance.
  - `next` object, nullable: Suggested next action and API call.
  - `version` string, nullable: Changes when public task status changes.
  - `app_url` string, nullable: Open the task in the Autumn app.

## Other responses

- `401`: `unauthorized`: Missing or invalid credentials. Send your full API key as `X-API-Key: <key>` or `Authorization: Bearer <key>`.
- `422`: `invalid_request`: a field failed validation. `param` names it; `detail` is the validator output.
- `503`: `auth_unavailable`: Key verification is temporarily unavailable. Wait `retry_after` seconds, then send the request again. | `service_unavailable`: Autumn is temporarily unavailable. Wait `retry_after` seconds, then send the request again.

---

[API](https://skmtc.dev/autumn-ai/apis/autumn-task-api.md) - [All operations](https://skmtc.dev/autumn-ai/apis/autumn-task-api/llms.txt) - [OpenAPI document](https://skmtc.dev/autumn-ai/apis/autumn-task-api/revisions/78fb43699783?raw)
