# ContactRole

A contact role: the organisation-wide list a contact's function is picked from, e.g. Technical contact or Invoicing. Deleting one unassigns it from every contact rather than refusing.

## Used by
- GET /api/v2/contact-roles: List contact roles (ContactRoleList)
- POST /api/v2/contact-roles: Create a contact role (ContactRole)
- GET /api/v2/contact-roles/{contact_role}: Read a contact role (ContactRole)
- PATCH /api/v2/contact-roles/{contact_role}: Update a contact role (ContactRole)

## ContactRole fields
- id (integer, required): Unique identifier.
- name (string ≤ 255, required): Role name as shown in the UI, unique across the organisation. This is the default sort key and the field `?q=` searches.
- 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.
- contacts_count (integer ≥ 0, required): Number of contacts assigned this role.
- links (ContactRoleLinks, required)
  - self (url, required): The canonical URI of this record.
  - contacts (url, required): Contacts assigned this role.

## Variants

### ContactRoleList

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

6 fields.
Identical to the detail object above.

### ContactRoleSummary

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

2 fields.
Omits: created_at, updated_at, contacts_count, links

### ContactRoleLinks

The `links` object on this resource.

Keys: self, contacts

## Example
```json
{
  "id": 1,
  "name": "Invoicing",
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "contacts_count": 1,
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1",
    "contacts": "https://<your-url>/api/v2/work-items/1"
  }
}
```
