Skip to main content
POST
Create Task

Authorizations

Authorization
string
header
required

Workspace API key as a bearer token: Authorization: Bearer ish_sk_live_.... Keys are workspace-scoped machine principals minted in Settings > Developers (shown once at mint). Scopes: sessions:run (create a session, submit turns, close), sessions:read (read the session and its decision trace), environments:read and environments:write (manage the workspace's registered environments), tasks:read and tasks:write (manage the workspace's registered tasks), people:read and people:write (the people the workspace can run a session for), and usage:read (the workspace's own consumption, spend limits and rate-limit budgets). A key is minted with sessions:run, sessions:read, and tasks:read by default; every other scope must be requested, people:read and usage:read included. An ish user access token also works on the same header for personal scripts.

Headers

Idempotency-Key
string | null

Path Parameters

workspace_id
string<uuid>
required

Body

application/json
instructions
string
required

What the person is trying to do, in their own terms. Rendered into their prompt as the situation paragraph, exactly as a session's inline instructions are.

Required string length: 1 - 2000
name
string
required
Required string length: 1 - 120
background
string | null

Background the person is treated as already knowing. Accepted and stored; not yet consumed by API sessions, which currently render the instructions only.

Maximum string length: 8000
get_or_create
boolean
default:false

Idempotent register for CI: when a live task with this name (case-insensitive, per workspace) already exists, return it with 200 instead of 409. The existing task is returned as is: nothing on this request is applied to it.

steps
TaskStep · object[] | null

The atomic actions a run should be checked against afterwards. Never shown to the person doing the run. Step ids are permanent identity: an id you supply is kept verbatim, a missing one is minted server-side. Accepted and stored; not yet consumed by API sessions.

Maximum array length: 50

Response

The existing task, RETURNED AS IS: nothing on this request was applied to it. Two paths reach here: an Idempotency-Key replay (same key, same body), or get_or_create with a live task already holding this name.

A registered task as the caller sees it.

archived_at
string<date-time> | null
required

Set when the task is archived (DELETE). An archived task stays readable by id so existing sessions keep resolving, is hidden from the default list, refuses new sessions (409), and frees its name for reuse.

background
string | null
required

Background the person is treated as already knowing, or null. Accepted and stored; not yet consumed by API sessions, which currently render the instructions only.

created_at
string<date-time>
required
id
string<uuid>
required
instructions
string
required
name
string
required
revision
integer
required

Increments on every write to this task. Sessions freeze the revision they bound, so runs are comparable within a revision of the content.

steps
TaskStepView · object[] | null
required

The actions a run is checked against afterwards, or null when the task has none. Steps are never shown to the person doing the run. Accepted and stored; not yet consumed by API sessions.

updated_at
string<date-time>
required
workspace_id
string<uuid>
required