# Task

A kanban task: one card on an employee's board, filed under a budget of a project, carrying an estimate in minutes that time is logged against. Tasks are per-user, so a caller sees only their own unless they hold `kanban::manage_for_others`.

## Used by
- GET /api/v2/projects/{project}/tasks: List a project's tasks (TaskList)
- POST /api/v2/projects/{project}/tasks: Create a task on a project (Task)
- GET /api/v2/tasks/{task}: Read a task (Task)
- PATCH /api/v2/tasks/{task}: Update a task (Task)

## Task fields
- id (integer, required): Unique identifier.
- budget_id (integer, required): Budget the task is filed under. This is the task's only link to a project (a task has no `project_id` of its own), and it is settable at create time only; a task cannot be re-budgeted through the API.
- user_id (integer or null, required, server-assigned): The employee the task belongs to. Always the authenticated user on create; not writable. Null on a task left unassigned in plnnrly.
- team_id (integer or null, required, server-assigned): Team the task is filed under. Nothing on the API path assigns it, so a task created through the API always carries `null`; plnnrly itself is the only place a team is set. Not writable, and there is no `team` object beside it.
- due_date (date (YYYY-MM-DD) or null, required): Day the task is due. Required when creating a task through the API, and clearable afterwards; tasks created in plnnrly may carry `null`.
- minutes (integer, required): Estimated effort, in minutes.
- description (string ≤ 255, required): Short description shown on the kanban card. This is the task's label and the only field `?q=` searches.
- comment (string or null ≤ 255, required): Optional longer comment on the card, capped at 255 characters.
- is_finished (boolean, required): Whether the task is done. Cross-synced with `status` on every write: setting `status` to finished sets this `true` and any other status sets it `false`, while setting this `false` on a finished task moves `status` back to active. `status` wins when both are sent.
- is_billable (boolean, required): Whether time logged on this task is billable. Defaults to `true` when a task is created through the API, regardless of the budget's own setting.
- status (string, required): Kanban column the card sits in.
- order_column (integer, required, server-assigned): Position on the kanban board, lowest first. Appended to the end of the board on create and changed when someone drags the card in plnnrly. Not writable.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Creation timestamp.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp; use for incremental sync.
- budget (Ref or BudgetSummary, required): The budget this task is filed under.
- user (Ref or UserSummary or null, required): The employee the task belongs to.
- links (TaskLinks, required)
  - self (url, required): The canonical URI of this record.

## Variants

### TaskList

What a collection returns, and what `?view=summary` returns on a single record.

17 fields.
Identical to the detail object above.

### TaskSummary

The embedded form: what you get when another resource carries this one and you did not `include` it.

2 fields.
Omits: budget_id, user_id, team_id, due_date, minutes, comment, is_finished, is_billable, status, order_column, created_at, updated_at, budget, user, links

### TaskLinks

The `links` object on this resource.

Keys: self

## Example
```json
{
  "id": 1,
  "budget_id": 1,
  "user_id": 1,
  "team_id": 1,
  "due_date": "2026-09-15",
  "minutes": 240,
  "description": "Wire up the SSO callback",
  "comment": "…",
  "is_finished": false,
  "is_billable": false,
  "status": "on-hold",
  "order_column": 1,
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "budget": {
    "id": 1
  },
  "user": null,
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1"
  }
}
```
