# Create an externally controlled task

`POST /v1/tasks/external`

Creates an idle task for an external client. No Adam model is selected, no inference or agent run starts, and no compute is provisioned. Attachments are immutable task inputs from POST /v1/uploads and additionally require files:read and files:write.

Required OAuth scopes: `tasks:write`

## Parameters

- `Idempotency-Key` (header, string, required): Required unique key. For 24 hours, retries with the same key and body replay the original response.

## Request body

- `attachments` (object[])
  - `uploadId` (string, required)
- `prompt` (string): The user's request to save in task history. This does not start an Adam agent.
- `title` (string)
- `projectId` (string (uuid))

## Responses

- `201`
  - `task` (object, required)
    - `id` (string, required)
    - `title` (string, required)
    - `status` ("idle" | "queued" | "running" | "awaiting_input" | "completed" | "cancelled" | "failed", required)
    - `executionMode` ("adam" | "external")
    - `projectId` (string | null, required)
    - `model` (object | null, required)
    - `pendingInteraction` (object | null, required)
    - `createdAt` (string, required)
    - `updatedAt` (string, required)
  - `messages` (object[], required)
    - `id` (string, required)
    - `role` ("user" | "assistant", required)
    - `parts` (object[], required)
    - `createdAt` (string (date-time), required)
- `400`: Invalid request
- `401`: Missing or invalid Bearer credential
- `402`: Payment or subscription required
- `403`: Credential is missing a required scope
- `404`: Resource not found
- `409`: Request conflict
- `429`: Rate limit exceeded
- `500`: Internal API error
