---
title: "Create/Update projects."
method: POST
path: "/project/upsert"
tags: ["Projects|Project"]
---

# Create/Update projects.

`POST /project/upsert`

This method can be used to create and update projects.

An attempt is made to find an existing project based on the selected primary key.
If one is found, it will be updated with the data provided in the request. Otherwise, a new project is created.

## Request body

- StandardProjectUpsertRequest
  - `records` object[] — The records. This Parameter 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 project ID | | reference | The project number | | importKey | The external record ID |
    - `data` ProjectUpsertRequestRecordData
      - `id` integer — The internal project ID.
      - `reference` string — The project number.
      - `importSource` string — External data source from which this project originated.
      - `importKey` string — External ID from the respective data source.
      - `name` string — The project name. (max. 255 characters)
      - `description` string — The project description.
      - `extraName1` string — The name1 address addition. (max. 255 characters)
      - `extraName2` string — The name2 address addition. (max. 255 characters)
      - `extraName3` string — The name3 address addition. (max. 255 characters)
      - `street` string — The street.
      - `zipCode` string — The zip code.
      - `city` string — The city.
      - `countryCode` string — The two-digit ISO 3166 country code.
      - `latLng` number[] — Represents a geo coordinate. An array of two double values, representing the latitude and longitude.
      - `costCenter` string — The cost center. (max. 64 characters)
      - `orderReference` string — The order reference. (max. 255 characters)
      - `offerReference` string — The offer reference. (max. 255 characters)
      - `contactPerson` string — Contact person. (max. 255 characters)
      - `phoneNumber` string — Telephone number. (max. 255 characters)
      - `mobileNumber` string — Mobile number. (max. 255 characters)
      - `email` string — Email. (max. 255 characters)
      - `validFrom` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `validTo` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `resourcePlanningFrom` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `resourcePlanningTo` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `projectLeader` ApiHelperResponseProjectLeaderReference
        - `id` integer — The internal Project Leader ID. (EmployeeId or UserId)
        - `type` string — The internal Project Leader type. | Value | Description | | ----- | ----------- | | E | Project Leader type Employee | | U | Project Leader type User |
      - `openingHours` DynamicWeekdayTime — Represents dynamic weekday times ~~~ JSON format: ~~~ {"MO":[["08:00","13:00"],["15:00","18:00"]],"WE":[["08:00","13:00"],["15:00","18:00"]],"FR":[["08:00","13:00"],["15:00","18:00"]]} ~~~
        - `MO` array[]
          - string[] — Represents dynamic weekday times
        - `TU` array[]
          - string[] — Represents dynamic weekday times
        - `WE` array[]
          - string[] — Represents dynamic weekday times
        - `TH` array[]
          - string[] — Represents dynamic weekday times
        - `FR` array[]
          - string[] — Represents dynamic weekday times
        - `SA` array[]
          - string[] — Represents dynamic weekday times
        - `SU` array[]
          - string[] — Represents dynamic weekday times
      - `approvalRuleId` integer
      - `categoryExternalId` string — The external ID of the projectCategory.
      - `radius` integer — The project radius in meters.
      - `distanceToOffice` integer — The distance from the project to the office (in m).
      - `workSalaryTypeId` integer — A project-specific wage type. For time entries on this project, the selected wage type will be used. Note: This wage type overrides other wage type settings (e.g. from app settings or department assignment).
      - `allowance` number — A project-specific allowance.
  - `deleteMissing` boolean — Do you want to delete all projects missing from this request? This Parameter is optional. (Default: false)
  - `deleteImportSource` string — The data source from which the missing projects can be deleted. This Parameter is optional. (Default: "*API")
  - `dryRun` boolean — Simulate the operation. (No records will be created or changed) This Parameter is optional.

## Response `200`

Success Response:

- StandardProjectUpsertResponse
  - `createdProjects` object[] — The created projects.
    - `id` integer — The internal project ID.
    - `reference` string — The project number.
    - `importSource` string — External data source from which this project originated.
    - `importKey` string — External ID from the respective data source.
  - `updatedProjects` object[] — The changed projects.
    - `id` integer — The internal project ID.
    - `reference` string — The project number.
    - `importSource` string — External data source from which this project originated.
    - `importKey` string — External ID from the respective data source.
  - `deletedProjects` object[] — The deleted projects.
    - `id` integer — The internal project ID.
    - `reference` string — The project number.
    - `importSource` string — External data source from which this project originated.
    - `importKey` string — External ID from the respective data source.

---

[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)
