REST DocumentationDepartmentsPATCH Update a department

Update a department

Changes only the fields that are sent and returns the department like the single-department endpoint does. A department with active sub-departments, and the last active department, cannot be set inactive; an active department cannot sit under an inactive parent or become its own ancestor. Requires the Locations & Departments module.

Availability: Full version and ZEP Clock

Request

PATCH /api/v1/departments/{id}
curl --request PATCH \
     --url 'https://www.zep-online.de/zepinstanz/next/api/v1/departments/{id}' \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer {token}' \
     --header 'Content-Type: application/json' \
     --data '{
       "name": "EU",
       "description": "Angebot|en:offer",
       "parent_id": 1,
       "status": true
     }'

Path parameters

  • Name
    id
    Type
    integer
    Description

    The department ID

Request body

  • Name
    name
    Type
    string
    Description

    The department’s short name, unique across all departments. Blanks are allowed; quotes, #, &, -- and other unsafe characters are not.

  • Name
    description
    Type
    string, nullable
    Description

    Free-text description of the department.

  • Name
    parent_id
    Type
    integer, nullable
    Description

    Identifier of the parent department, null detaches it. It cannot be the department itself or one of its descendants, and an active department cannot sit under an inactive one.

  • Name
    status
    Type
    boolean
    Description

    Whether the department is inactive. A department with an active child department, and the last active department, cannot be set inactive.

Response

{
  "data": {
    "id": 1,
    "parent_id": 1,
    "name": "EU",
    "description": "Angebot|en:offer",
    "comments": "Wichtiger Kunde - mit Sorgfalt behandeln",
    "status": true,
    "manager": [
      {
        "username": "max.mustermann",
        "firstname": "Max",
        "lastname": "Mustermann",
        "personal_number": "1",
        "email": "erika.mustermann@acme-corp.de",
        "is_deputy": true
      }
    ],
    "children": [
      {}
    ],
    "manager_count": 2,
    "children_count": 10,
    "created": "2024-07-20T11:30:00.000000Z",
    "modified": "2024-07-20T12:30:00.000000Z"
  }
}

Response fields

  • Name
    id
    Type
    integer
    Description

    Unique identifier of the department.

  • Name
    parent_id
    Type
    integer, nullable
    Description

    Identifier of the parent department, if this department is nested under one.

  • Name
    name
    Type
    string
    Description

    Display name of the department.

  • Name
    description
    Type
    string, nullable
    Description

    Free-text description of the department’s purpose or scope.

  • Name
    comments
    Type
    string, nullable
    Description

    Free-text internal comments on the department.

  • Name
    status
    Type
    boolean, nullable
    Description

    Stored inactive flag, delivered as is: 1 means the department is inactive, 0 or null means it is active.

  • Name
    manager
    Type
    array of DepartmentManager
    Description

    The employee currently assigned as this department’s manager.

  • Name
    manager.username
    Type
    string
    Description

    Unique login name of the department manager.

  • Name
    manager.firstname
    Type
    string
    Description

    Given name of the department manager.

  • Name
    manager.lastname
    Type
    string
    Description

    Family name of the department manager.

  • Name
    manager.personal_number
    Type
    string, nullable
    Description

    Personnel number of the department manager.

  • Name
    manager.email
    Type
    string, nullable
    Description

    Business email address of the department manager.

  • Name
    manager.is_deputy
    Type
    boolean
    Description

    Whether the person is the deputy of the department manager; only the Inovex module sets it, an unset value reads false.

  • Name
    children
    Type
    array of Department
    Description

    The departments directly nested under this department.

  • Name
    children.id
    Type
    integer
    Description

    Unique identifier of the department.

  • Name
    children.parent_id
    Type
    integer, nullable
    Description

    Identifier of the parent department, if this department is nested under one.

  • Name
    children.name
    Type
    string
    Description

    Display name of the department.

  • Name
    children.description
    Type
    string, nullable
    Description

    Free-text description of the department’s purpose or scope.

  • Name
    children.comments
    Type
    string, nullable
    Description

    Free-text internal comments on the department.

  • Name
    children.status
    Type
    boolean, nullable
    Description

    Stored inactive flag, delivered as is: 1 means the department is inactive, 0 or null means it is active.

  • Name
    children.manager
    Type
    array of DepartmentManager
    Description

    The employee currently assigned as this department’s manager.

  • Name
    children.children
    Type
    array of Department
    Description

    The departments directly nested under this department.

  • Name
    children.manager_count
    Type
    integer
    Description

    Number of department managers currently assigned.

  • Name
    children.children_count
    Type
    integer
    Description

    Number of departments directly nested under this department.

  • Name
    children.created
    Type
    string (date-time), nullable
    Description

    Timestamp the department was created.

  • Name
    children.modified
    Type
    string (date-time), nullable
    Description

    Timestamp the department was last modified.

  • Name
    manager_count
    Type
    integer
    Description

    Number of department managers currently assigned.

  • Name
    children_count
    Type
    integer
    Description

    Number of departments directly nested under this department.

  • Name
    created
    Type
    string (date-time), nullable
    Description

    Timestamp the department was created.

  • Name
    modified
    Type
    string (date-time), nullable
    Description

    Timestamp the department was last modified.

Generated from the OpenAPI specification — edit the source code, not this page.