> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ziik.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing unit memberships

> Assign users to units and manage department and user types per membership.

Unit memberships define which users belong to which units (and department and user types within that unit).

Use these endpoints:

* **List a user's memberships** – `GET /users/{user}/units`.
* **Add a membership** – `POST /users/{user}/units` (body specifies unit, department, user types).
* **Update a membership** – `PATCH /users/{user}/units/{unit}` (e.g. change department, user types, or move to another unit).
* **Remove a membership** – `DELETE /users/{user}/units/{unit}`. The user must have at least one remaining membership.

Use the user's Ziik ID (or resolve it via `GET /users/reference/{reference}`) and the unit ID (or resolve via `GET /units/reference/{unit}`) when managing memberships from your system.
