# updateTask

mutation · in the family [Task](/reference/task/)

## What it does

Edit a task — a to-do assigned to people or teams — change its details.

Edit a Task's mutable attributes. Requires the unrestricted capability + the record's CURRENT revision. A supplied reportTo re-gates like create (in-tenant + ACTIVE); explicit null CLEARS it — the task reports to nobody.

## Careful

Edits take effect immediately and write a new revision; the old revision stays in history.

## Who may call it

Capability area: **Work and notes** — Tasks, notes, messages, dashboards and the everyday tools every staff member keeps.

- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- Cashier
- An API key whose scope allows `api:updateTask`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | yes | The id of the record. |
| `revision` | [ID](/types/#scalars) `ID!` | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |
| `input` | [EditTaskInput](/types/EditTaskInput/) `EditTaskInput!` | yes | No further notes. |

## Returns

[Task](/types/Task/) `Task!` — The CsCase chassis reused: caption REQUIRED (the subject line) + its OWN description field (≤8192 — the task's brief; the conversation is the generic Note thread at NOTE#<taskId>, addNote/notes). priority ∈ {low, normal, high, urgent} (its OWN canned registry — kit-stamped 'normal' when unnamed). createdBy is SERVER-STAMPED (IMMUTABLE); reportTo names WHO the work reports to. Assignment is MULTI: assigneeUserIds ≤8 + teamIds ≤4 (in-tenant + ACTIVE at set) — each holds a write-once TASKBOOK inbox row while the task LIVES (terminal transitions remove USER/TEAM rows in the SAME txn: the inbox self-prunes, bounded by open work). labelIds ≤16 (TaskLabel — the work vocabulary). constructRefs ≤16 {type,id} bind LIVE domain constructs REF-ONLY (the CsCase @375 law: validated in-tenant + non-doomed at write, NO doom arms grow, a purged target renders as a tombstone; each holds a TASKBOOK#REF row while the task is non-doomed — the tasksByConstruct lane). dueAt: overdue = COMPUTED at read (dueAt < now ∧ live; + the dueBefore filter) — NO sweep lane in v1 (the overdue-vitals/notification lane = a NAMED deferral). FSM: open(i) ⇄ in_progress (start/unstart — the inbox retreat) · open|in_progress → postponed (postponeTask — the boomerang: returnAt future-only; the USER/TEAM inbox rows PRUNE \[parking means quiet — the REF row stays]; the scheduled-due sweep fires postponed→open AT returnAt, or “Return now” \[unpostpone] pulls it back early — either return RE-MINTS the inbox rows) · open|in_progress|postponed → completed (terminal ▣ immutable, doomed:false — legitimate history; REOPEN = a NEW task via linkedFromTaskId, COMPLETED-only) · open|in_progress|postponed → cancelled (terminal ✦ doomed — lists filter it; NOT reopenable-by-link). 'blocked' is deliberately NOT a state — it is a label (no machine consequence in v1). SEARCHABLE by caption (the law; ⚠ the WIRE enum joins at the deploy leg). The ops event domain (at.ops.task.\* — the facility→ops neighborhood).

## Example request

```graphql
mutation ExampleUpdateTask($id: ID!, $revision: ID!, $input: EditTaskInput!) {
  updateTask(id: $id, revision: $revision, input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    description
    priority
    createdBy
    systemOrigin
    reportTo
    assigneeUserIds
    teamIds
    labelIds
    dueAt
    overdue
    linkedFromTaskId
    returnAt
    originNoteId
    originAnchorType
    originAnchorId
  }
}
```

Variables:

```json
{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "input": {
    "caption": "Blue jeans"
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

## Example response

```json
{
  "data": {
    "updateTask": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "TK-EXMP-0000-000F",
      "type": "Task",
      "caption": "Blue jeans",
      "status": "open",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "description": "Straight-cut, mid-rise, five pockets.",
      "priority": "<priority>",
      "createdBy": "01900000-0000-7000-8000-0b14e5a60000",
      "systemOrigin": "<system origin>",
      "reportTo": "01900000-0000-7000-8000-9d69c9660000",
      "assigneeUserIds": [
        "01900000-0000-7000-8000-fbe5fcb10000"
      ],
      "teamIds": [
        "01900000-0000-7000-8000-1abd3d160000"
      ],
      "labelIds": [
        "01900000-0000-7000-8000-a235e7410000"
      ],
      "dueAt": "2027-01-31T00:00:00.000Z",
      "overdue": true,
      "linkedFromTaskId": "01900000-0000-7000-8000-6de8c4e00000",
      "returnAt": "2027-01-31T00:00:00.000Z",
      "originNoteId": "01900000-0000-7000-8000-f1eb5d520000",
      "originAnchorType": "<origin anchor type>",
      "originAnchorId": "01900000-0000-7000-8000-323b002b0000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))
- `CONFLICT/*` — The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. ([CONFLICT](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))

## Dry run

Add `dryRun: true` to the request envelope (`extensions.at`) to rehearse this call: every check runs, the write is rehearsed against the current records and nothing is stored; the answer is the refusal a real call would give, or the record it would create. Every response to a rehearsal carries `dryRun: true`, so a rehearsed record is never mistaken for a saved one.
