{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lucca/main/json-schema/lucca-department-update-schema.json",
  "title": "department",
  "description": "A department represents a subdivision of the employee workforce, most often erected around \nthe type of activity they do.\n\nDepartments are a tree-like structure, as any department may be child to another.\n\nNote: contrary to most resources, departments are not attached to business-establishments.\nThis means:\n  - business-establishments listed in access rights management do not affect departments.\n  - employees may work in different business-establishments (or even legal-entities) and yet\n    still belong to the same department.",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lucca-api-2024-11-01.json#/components/schemas/department.update",
  "x-tags": [
    "organization"
  ],
  "type": "object",
  "properties": {
    "remoteId": {
      "description": "Identifier of this object in a third-party software.",
      "type": [
        "null",
        "string"
      ],
      "maxLength": 255
    },
    "isArchived": {
      "description": "If this department is archived. Only possible if there are no more employees attached.",
      "type": "boolean"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "description": {
      "type": [
        "null",
        "string"
      ]
    },
    "parent": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "title": "department-reference",
          "description": "Reference to a [department](../organization/department) resource.",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "id"
          ]
        }
      ]
    },
    "manager": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "title": "employee-reference",
          "description": "Reference to an employee resource.",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "id"
          ]
        }
      ]
    },
    "sortOrder": {
      "description": "Index (0-based) of the department among its siblings.",
      "type": "integer",
      "format": "int32",
      "minimum": 0
    },
    "owningApplication": {
      "description": "**Can only be set by an authenticated Lucca application.** \nWhen not null, indicates that this department is read-only, given that it is managed by another application (designated by its ID) that is charged with its synchronization.\n**Any write request attempt made from anyone other than the application will be rejected with a 403 Forbidden error.**",
      "type": [
        "null",
        "string"
      ],
      "minLength": 1
    }
  },
  "required": [
    "name"
  ]
}