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

# Create/Update project categories.

`POST /project_category/upsert`

This method can be used to create and update project categories.

 An effort is made to locate an existing project category using the selected primary key. If found, it will be modified,
 whereas if no project category is found, a new one is created. If the `deleteMissing` flag is set to true, all project categories absent
 from the request shall be purged. Please note that removed project categories may not be reinstated. You can enable the
 `dryRun` setting to simulate the action without altering any live data.

## Request body

- StandardProjectCategoryUpsertRequest
  - `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 category ID | | externalid | The external ID of the project category |
    - `data` ProjectCategoryUpsertRequestRecordData
      - `id` integer — The internal id of the project category.
      - `description` string — The name of the project category. (max. 255 characters)
      - `costCenter` string — The cost center of the project category. (max. 255 characters)
      - `externalId` string — The external ID of the project category. (max. 255 characters)
      - `namedId` string — The system internal ID of the project category. (max. 255 characters)
      - `export` boolean — Whether the projects in this project category should be exported.
      - `ignoreReverseGeocoding` boolean — Whether the projects in this project category should be used for geocpding and events.
      - `homeCategory` boolean — Whether the projects in this project category are a home project (No driving times will be added).
  - `deleteMissing` boolean — Do you want to delete all project categories 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:

- StandardProjectCategoryUpsertResponse
  - `createdProjectCategories` object[] — The created project categories.
    - `id` integer — The internal id of the project category.
    - `description` string — The description of the project category.
    - `externalId` string — The external ID of the project category.
    - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
  - `updatedProjectCategories` object[] — The changed project categories.
    - `id` integer — The internal id of the project category.
    - `description` string — The description of the project category.
    - `externalId` string — The external ID of the project category.
    - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
  - `deletedProjectCategories` object[] — The deleted project categories.
    - `id` integer — The internal id of the project category.
    - `description` string — The description of the project category.
    - `externalId` string — The external ID of the project category.
    - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx

---

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