REST DocumentationDepartmentsGET List departments

List departments

Returns a paginated list of departments, including the count of their children and whether a department manager is assigned.

Availability: Full version and ZEP Clock

Request

GET /api/v1/departments
curl --request GET \
     --url 'https://www.zep-online.de/zepinstanz/next/api/v1/departments' \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer {token}'

Query parameters

  • Name
    perPage
    Type
    integer, nullable
    Description

    Ignored on this endpoint — send limit instead. Any value given here is replaced by limit, or by the default when limit is absent.

  • Name
    page
    Type
    integer, nullable
    Description

    The page of results to return, counting from 1.

  • Name
    orderBy
    Type
    string, nullable
    Description

    Name of the field to sort by.

  • Name
    order
    Type
    string, nullable
    Description

    Sort direction, ascending or descending.

    One of: "asc", "desc"

  • Name
    limit
    Type
    integer, nullable
    Description

    The number of records per page, 1 to 200. Defaults to 15.

  • Name
    start_date
    Type
    string (date)
    Description
  • Name
    end_date
    Type
    string (date)
    Description

Response

{
  "data": [
    {
      "id": null,
      "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"
        }
      ],
      "children": [
        {}
      ],
      "manager_count": 2,
      "children_count": 10,
      "created": "2024-07-20T11:30:00.000000Z",
      "modified": "2024-07-20T12:30:00.000000Z"
    }
  ],
  "links": {
    "first": "string",
    "last": "string",
    "prev": "string",
    "next": "string"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": "string",
        "label": "string",
        "active": true
      }
    ],
    "path": "string",
    "per_page": 1,
    "to": 1,
    "total": 1
  }
}

Response fields

  • Name
    id
    Type
    any
    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

    Whether the department is currently 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
    children
    Type
    array of Department
    Description

    The departments directly nested under this department.

  • Name
    children.id
    Type
    any
    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

    Whether the department is currently 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

    Whether a department manager is 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

    Whether a department manager is 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.