---
title: "Create/Update departments."
method: POST
path: "/department/upsert"
tags: ["Employees|Department"]
---

# Create/Update departments.

`POST /department/upsert`

This endpoint enables you to create departments or update the ones you created.

## Request body

- StandardDepartmentUpsertRequest
  - `records` object[] — The records.
    - `keyField` string — This parameter specifies the name of the unique key used to distinctly assign each dataset in the API. | Value | Description | |----------------|-----------------------------------| | id | The internal department id | | externalid | The external ID of the department |
    - `data` DepartmentUpsertRequestRecordData
      - `id` string — The internal id of the department.
      - `name` string — The name of the department. (max. 255 characters)
      - `identifier` string — The internal id of the department. This Parameter is optional. (max. 255 characters)
      - `locationId` string — The location id of the department. This Parameter is optional.
      - `timeSchemeId` string — The time scheme id of the department. This Parameter is optional.
      - `costCenter` string — The cost Center of the department. This Parameter is optional. (max. 255 characters)
      - `headId` string — The head id of the department. This Parameter is optional.
      - `resourcePlanning` boolean — Department is included in resource planning. This Parameter is optional. (Default: false)
      - `ignoreProjectWorktimeApprovalRule` boolean — Department ignore project worktime approval rules. This Parameter is optional. (Default: false)
      - `sequence` integer — The sequence of the department. This Parameter is optional. (Default: 0)
      - `driveSalaryTypeId` string — The drive salary type id of the department. This Parameter is optional.
      - `workSalaryTypeId` string — The work salary type id of the department. This Parameter is optional.
      - `worktimeApprovalRuleId` string — The worktime approval rule id of the department. This Parameter is optional.
      - `stampApplicationApprovalRuleId` string — The stamp approval rule id of the department. This Parameter is optional.
      - `absenceApplicationApprovalRuleId` string — The absence approvale rule id of the department. This Parameter is optional.
      - `sicknessApplicationApprovalRuleId` string — The sickness approval rule id of the department. This Parameter is optional.
      - `accountingEntryApplicationApprovalRuleId` string — The accounting entry approval rule id of the department. This Parameter is optional.
      - `allowedProjectCategoriesIds` integer[] — The allowed project category ids of the department. This Parameter is optional.
  - `deleteMissing` boolean — Do you want to delete all departments missing from this request? This Parameter is optional. (Default: false)
  - `dryRun` boolean — Simulate the operation. (No records will be created or changed) This Parameter is optional.

## Response `200`

Success Response:

- StandardDepartmentUpsertResponse
  - `createdDepartment` object[] — The created department.
    - `id` string — The internal id of the department.
    - `name` string — The name of the department. (max. 255 characters)
    - `identifier` string — The internal id of the department. This Parameter is optional. (max. 255 characters)
    - `locationId` string — The location id of the department. This Parameter is optional.
    - `timeSchemeId` string — The time scheme id of the department. This Parameter is optional.
    - `costCenter` string — The cost Center of the department. This Parameter is optional. (max. 255 characters)
    - `headId` string — The head id of the department. This Parameter is optional.
    - `resourcePlanning` boolean — Department is included in resource planning. This Parameter is optional. (Default: false)
    - `ignoreProjectWorktimeApprovalRule` boolean — Department ignore project worktime approval rules. This Parameter is optional. (Default: false)
    - `sequence` integer — The sequence of the department. This Parameter is optional. (Default: 0)
    - `driveSalaryTypeId` string — The drive salary type id of the department. This Parameter is optional.
    - `workSalaryTypeId` string — The work salary type id of the department. This Parameter is optional.
    - `worktimeApprovalRuleId` string — The worktime approval rule id of the department. This Parameter is optional.
    - `stampApplicationApprovalRuleId` string — The stamp approval rule id of the department. This Parameter is optional.
    - `absenceApplicationApprovalRuleId` string — The absence approvale rule id of the department. This Parameter is optional.
    - `sicknessApplicationApprovalRuleId` string — The sickness approval rule id of the department. This Parameter is optional.
    - `accountingEntryApplicationApprovalRuleId` string — The accounting entry approval rule id of the department. This Parameter is optional.
    - `allowedProjectCategoriesIds` integer[] — The allowed project category ids of the department. This Parameter is optional.
  - `updatedDepartment` object[] — The changed department.
    - `id` string — The internal id of the department.
    - `name` string — The name of the department. (max. 255 characters)
    - `identifier` string — The internal id of the department. This Parameter is optional. (max. 255 characters)
    - `locationId` string — The location id of the department. This Parameter is optional.
    - `timeSchemeId` string — The time scheme id of the department. This Parameter is optional.
    - `costCenter` string — The cost Center of the department. This Parameter is optional. (max. 255 characters)
    - `headId` string — The head id of the department. This Parameter is optional.
    - `resourcePlanning` boolean — Department is included in resource planning. This Parameter is optional. (Default: false)
    - `ignoreProjectWorktimeApprovalRule` boolean — Department ignore project worktime approval rules. This Parameter is optional. (Default: false)
    - `sequence` integer — The sequence of the department. This Parameter is optional. (Default: 0)
    - `driveSalaryTypeId` string — The drive salary type id of the department. This Parameter is optional.
    - `workSalaryTypeId` string — The work salary type id of the department. This Parameter is optional.
    - `worktimeApprovalRuleId` string — The worktime approval rule id of the department. This Parameter is optional.
    - `stampApplicationApprovalRuleId` string — The stamp approval rule id of the department. This Parameter is optional.
    - `absenceApplicationApprovalRuleId` string — The absence approvale rule id of the department. This Parameter is optional.
    - `sicknessApplicationApprovalRuleId` string — The sickness approval rule id of the department. This Parameter is optional.
    - `accountingEntryApplicationApprovalRuleId` string — The accounting entry approval rule id of the department. This Parameter is optional.
    - `allowedProjectCategoriesIds` integer[] — The allowed project category ids of the department. This Parameter is optional.
  - `deletedDepartment` object[] — The deleted department.
    - `id` string — The internal id of the department.
    - `name` string — The name of the department. (max. 255 characters)
    - `identifier` string — The internal id of the department. This Parameter is optional. (max. 255 characters)
    - `locationId` string — The location id of the department. This Parameter is optional.
    - `timeSchemeId` string — The time scheme id of the department. This Parameter is optional.
    - `costCenter` string — The cost Center of the department. This Parameter is optional. (max. 255 characters)
    - `headId` string — The head id of the department. This Parameter is optional.
    - `resourcePlanning` boolean — Department is included in resource planning. This Parameter is optional. (Default: false)
    - `ignoreProjectWorktimeApprovalRule` boolean — Department ignore project worktime approval rules. This Parameter is optional. (Default: false)
    - `sequence` integer — The sequence of the department. This Parameter is optional. (Default: 0)
    - `driveSalaryTypeId` string — The drive salary type id of the department. This Parameter is optional.
    - `workSalaryTypeId` string — The work salary type id of the department. This Parameter is optional.
    - `worktimeApprovalRuleId` string — The worktime approval rule id of the department. This Parameter is optional.
    - `stampApplicationApprovalRuleId` string — The stamp approval rule id of the department. This Parameter is optional.
    - `absenceApplicationApprovalRuleId` string — The absence approvale rule id of the department. This Parameter is optional.
    - `sicknessApplicationApprovalRuleId` string — The sickness approval rule id of the department. This Parameter is optional.
    - `accountingEntryApplicationApprovalRuleId` string — The accounting entry approval rule id of the department. This Parameter is optional.
    - `allowedProjectCategoriesIds` integer[] — The allowed project category ids of the department. This Parameter is optional.

---

[API](https://skmtc.net/geocapture/apis/geocapture-api.md) · [All operations](https://skmtc.net/geocapture/apis/geocapture-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/geocapture/geocapture-api/versions/15839b24c497/schema)
