> ## 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.

# Update unit membership

> Updates an existing unit membership for the user (e.g. department, user types, or move to another unit).



## OpenAPI

````yaml /openapi.yaml patch /users/{user}/units/{unit}
openapi: 3.0.0
info:
  title: Ziik API
  version: '1.0'
servers: []
security: []
tags:
  - name: Auth
    description: Auth
  - name: Posts
    description: Posts
  - name: Counters
    description: Counters
  - name: Groups
    description: Groups
  - name: Languages
    description: Languages
  - name: Timezones
    description: Timezones
  - name: Units
    description: Units
  - name: User unit memberships
    description: User unit memberships
  - name: Users
    description: Users
  - name: User types
    description: User types
  - name: Conversations
    description: Conversations
paths:
  /users/{user}/units/{unit}:
    patch:
      tags:
        - User unit memberships
      summary: Update unit membership
      description: >-
        Updates an existing unit membership for the user (e.g. department, user
        types, or move to another unit).
      operationId: 014ca9690eac4b66326590f9d03f6e94
      parameters:
        - name: user
          in: path
          description: User ID
          required: true
          schema:
            type: integer
        - name: unit
          in: path
          description: Unit ID of the membership to update
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              properties:
                unit:
                  description: Unit ID to move the membership to
                  type: integer
                userTypes:
                  description: User type IDs
                  type: array
                  items:
                    type: integer
                department:
                  description: Department ID within the unit, or null to clear
                  type: integer
                  nullable: true
                overwrite:
                  description: 'Whether to overwrite existing user types (default: true)'
                  type: boolean
              type: object
      responses:
        '204':
          description: Unit membership updated
        '400':
          description: Unit membership already exists (when moving to another unit)
        '403':
          description: Forbidden
        '404':
          description: User or unit membership not found
        '422':
          description: Validation error

````