# WorkType

A work-item type: the organisation-wide categories work items are filed under (bug, task, story, …), carrying the colour and icon the backlog, board and Gantt render beside them. A type still used by work items cannot be deleted.

## Used by
- GET /api/v2/work-types: List work types (WorkTypeList)
- POST /api/v2/work-types: Create a work type (WorkType)
- GET /api/v2/work-types/{work_type}: Read a work type (WorkType)
- PATCH /api/v2/work-types/{work_type}: Update a work type (WorkType)

## WorkType fields
- id (integer, required): Unique identifier.
- name (string ≤ 255, required): Work-type name as shown in the UI, e.g. `Bug`.
- color (string ≤ 255, required): Six-digit hex colour, e.g. `#6b7280`. A stored value that is not six-digit hex reads back as `#6b7280`, so writing this field back unchanged replaces the malformed original.
- icon (string ≤ 255, required): Icon name, e.g. `heroicon-o-rectangle-stack`: not a URL and not markup.
- order (integer, required, server-assigned): Display position; set by dragging in plnnrly and not writable. API-created types are created at 0 and fall back to the id tiebreaker.
- 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.
- links (WorkTypeLinks, required)
  - self (url, required): The canonical URI of this record.

## Variants

### WorkTypeList

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

8 fields.
Identical to the detail object above.

### WorkTypeSummary

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

4 fields.
Omits: order, created_at, updated_at, links

### WorkTypeLinks

The `links` object on this resource.

Keys: self

## Example
```json
{
  "id": 1,
  "name": "Spike",
  "color": "#6b7280",
  "icon": "heroicon-o-rectangle-stack",
  "order": 1,
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1"
  }
}
```
