# DashboardTemplate

A dashboard the organization sets up for the users with one of its roles, user types or teams; a template with none of those is for everyone. The first template that fits a user, by `position`, is where their standard dashboard starts and what "restore default" brings back. A user who changed their standard dashboard keeps their own layout when a template changes. Templates are organization settings: reading them takes `organization::read`, changing them `organization::update`.

## Used by
- GET /api/v2/dashboard-templates: List dashboard templates (DashboardTemplateList)
- POST /api/v2/dashboard-templates: Create a dashboard template (DashboardTemplate)
- GET /api/v2/dashboard-templates/{dashboard_template}: Read a dashboard template (DashboardTemplate)
- PATCH /api/v2/dashboard-templates/{dashboard_template}: Update a dashboard template (DashboardTemplate)

## DashboardTemplate fields
- id (integer, required): Unique identifier.
- name (string ≤ 255, required): The template's name, as users see it when they pick one.
- position (integer, required): Which template wins when several fit a user: the lowest.
- user_types (array of string, required): The user types the template is for.
- role_ids (array of integer, required): The roles the template is for, by id.
- team_ids (array of integer, required): The teams the template is for, by id, as `/api/v2/teams` lists them.
- layout (array of object, required): The widgets, as on a dashboard. Each user sees only the widgets they may see; the template keeps the others for those who may.
  - id (string, required): The entry's id; `under` names it. Generated when you leave it out.
  - widget (string, required): The widget, by key, such as `worklog` or `recent-projects`.
  - row (integer, required): The row, from 0 at the top.
  - start (integer, required): The first of the 12 columns the widget takes, from 1.
  - columns (integer, required): How many of the 12 columns the widget takes, at least the widget's own minimum. Its maximum is only a recommendation: a widget may take all 12.
  - settings (object, required): The widget's own settings, such as the number of rows. A setting left out takes its default.
  - under (string or null, optional): The `id` of the entry this one sits below, in its place and width: a stack. Null when it stands on its own.
- 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 (DashboardTemplateLinks, required)
  - self (url, required): The canonical URI of this record.

## Variants

### DashboardTemplateList

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

10 fields.
Identical to the detail object above.

### DashboardTemplateLinks

The `links` object on this resource.

Keys: self

## Example
```json
{
  "id": 1,
  "name": "Project managers",
  "position": 1,
  "user_types": [
    "project_manager"
  ],
  "role_ids": [
    1
  ],
  "team_ids": [
    1
  ],
  "layout": [
    {
      "id": "…",
      "widget": "…",
      "row": 1,
      "start": 1,
      "columns": 1,
      "settings": {},
      "…": "1 optional field left out"
    }
  ],
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1"
  }
}
```
