---
title: "Create/Update employees."
method: POST
path: "/employee/upsert"
tags: ["Employees|Employee"]
---

# Create/Update employees.

`POST /employee/upsert`

This method can be used to create and update employees.

An attempt will be made to find an existing employee based on the selected primary key. If found, adjustments are
made accordingly; otherwise, a new employee is created.You have the option to remove any absent employees from
your request. Also, you can specify the import source from which the missing employees should be removed. For
example, if the import source is tagged with *API, only the entries marked with this flag will be removed.
Enabling the dry run feature will not make any modifications to the actual system, but you will receive a
successful response.

## Request body

- StandardEmployeeUpsertRequest
  - `records` object[] — The records. This paramter is optional.
    - `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 employee ID | | reference | The personnel number of the employee | | cardNumber | The driver card number | | ibuttonNumber | The iButton number | | importKey | The external record ID |
    - `data` EmployeeUpsertRequestRecordData
      - `id` integer — The internal employee ID.
      - `reference` string — The personal number. (max. 20 characters)
      - `cardNumber` string — The driver card number.
      - `importSource` string — External data source from which this employee originates. (max. 16 characters)
      - `importKey` string — External ID from the respective data source. (max. 64 characters)
      - `firstName` string — The first name of the employee. (max. 128 characters)
      - `lastName` string — The last name of the Employee. (max. 128 characters)
      - `name` string — This field is deprecated. Please use firstName The complete Name of the Employee If first name or last name is set, name is ignored.
      - `phoneNumber` string — The phone number (max. 128 characters)
      - `ibutton` string — The iButton as hexadecimal value.
      - `ibuttonNumber` integer — The iButton as number. (max. 32 characters)
      - `email` string — The e-mail address. (max. 128 characters)
      - `costCenter` string — The cost center. (max. 32 characters)
      - `entryDate` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `dayOfBirth` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `gender` string — The employee's gender. (MALE, FEMALE, NONBINARY)
      - `numVacationDays` number — The number of vacation days the employee has per year.
      - `terminationDate` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `socialSecurityNumber` string — The social security number for the employee. (max. 25 characters)
      - `healthInsuranceFromDate` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `healthInsuranceType` string — The health insurance type (STATUTORY/PRIVATE).
      - `healthInsuranceCompanyNumber` string — The company number for the health insurance.
      - `locationExternalId` string — The external ID of the location.
      - `departmentId` string — The identifier of the department.
      - `timeTracking` boolean — Activates time tracking for the employee. (Default = true)
      - `imageName` string — The name of the image with extension.
      - `imageData` string — The data of the employee image (base64 encoded).
      - `assignedDispoQualifiationIds` integer[] — The ids of the dispo qualifications, that should be assigned to the employee.
  - `deleteMissing` boolean — Do you want to delete all employees missing from this request? This paramter is optional.
  - `deleteImportSource` string — The data source from which the missing employees can be deleted. This paramter is optional. (Standard is "*API")
  - `dryRun` boolean — Simulate the operation. (No records will be created or changed) This Parameter is optional.

## Response `200`

Success Response:

- StandardEmployeeUpsertResponse
  - `createdEmployees` object[] — The created employees.
    - `id` integer — The internal employee ID.
    - `reference` string — The personal number. (max. 20 characters)
    - `cardNumber` string — The driver card number.
    - `importSource` string — External data source from which this employee originates. (max. 16 characters)
    - `importKey` string — External ID from the respective data source. (max. 64 characters)
  - `updatedEmployees` object[] — The changed employees.
    - `id` integer — The internal employee ID.
    - `reference` string — The personal number. (max. 20 characters)
    - `cardNumber` string — The driver card number.
    - `importSource` string — External data source from which this employee originates. (max. 16 characters)
    - `importKey` string — External ID from the respective data source. (max. 64 characters)
  - `deletedEmployees` object[] — The deleted employees.
    - `id` integer — The internal employee ID.
    - `reference` string — The personal number. (max. 20 characters)
    - `cardNumber` string — The driver card number.
    - `importSource` string — External data source from which this employee originates. (max. 16 characters)
    - `importKey` string — External ID from the respective data source. (max. 64 characters)

---

[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/869b05603541/schema)
