# Team

A team: a named group of the organisation's people, such as Development or Support. Automation steps and template answers name teams by id, for example as notification recipients. Without `teams::read` and a token covering teams, someone who may build automations sees what the automation builder's team picker shows: `id`, `name`, `users_count` and `links`. Read-only: teams and their members are maintained in plnnrly.

## Used by
- GET /api/v2/teams: List teams (TeamList)
- GET /api/v2/teams/{team}: Read a team (Team)

## Team fields
- id (integer, required): Unique identifier: the id an automation step or template answer takes, as in `"recipients": {"principals": {"teams": [3]}}`.
- name (string ≤ 255, required): Team name as shown in plnnrly, e.g. Development. Searchable with `?q=`.
- users_count (integer ≥ 0, required): Number of members. Service accounts are not counted.
- links (TeamLinks, required)
  - self (url, required): The canonical URI of this record.
  - users (url, required): Every member of this team, paginated. Following it needs `users::read` and `teams::read`.
- description (string or null, optional, multiline): What the team is for, as entered in plnnrly, or `null`. Returned only with `teams::read` and a token covering `api:read:teams`; anyone else gets the object without it.
- budget_group_ids (array of integer or null, optional): The budget groups this team handles, by id. plnnrly uses them to suggest a kanban task's team. A deleted budget group can stay listed here. `null` or empty means none. Returned only with `teams::read` and a token covering `api:read:teams`; anyone else gets the object without it.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): Creation timestamp. Returned only with `teams::read` and a token covering `api:read:teams`; anyone else gets the object without it.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): Last-write timestamp. Adding or removing a member does not change it. Returned only with `teams::read` and a token covering `api:read:teams`; anyone else gets the object without it.
- users (array of UserSummary ≤ 25, optional, only with include): The team's members. Service accounts are never listed. The include stops at 25; `links.users` lists every member. Wrapped in `{ data, meta }`; `meta.truncated` says whether the cap was hit and `meta.count` is the full count.
  - id (integer, required): Unique identifier.
  - name (string ≤ 255, required): Full name as shown in the UI.

## Variants

### TeamList

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

9 fields.
Identical to the detail object above.

### TeamLinks

The `links` object on this resource.

Keys: self, users

## Example
```json
{
  "id": 1,
  "name": "…",
  "description": "…",
  "budget_group_ids": [
    1
  ],
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "users": {
    "data": [
      {
        "…": "2 fields of UserSummary"
      }
    ],
    "meta": {
      "truncated": false,
      "…": "1 optional field left out"
    }
  },
  "users_count": 1,
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1",
    "users": "https://<your-url>/api/v2/work-items/1"
  }
}
```
