---
title: "Create/Update maintenance logs."
method: POST
path: "/maintenance_log/upsert"
tags: ["Maintenance|Maintenance Log"]
---

# Create/Update maintenance logs.

`POST /maintenance_log/upsert`

This method can be used to create and update maintenance logs.

An effort is made to locate an existing maintenance log using the selected primary key. If found, it will be modified,
whereas if no maintenance log is found, a new one is created. You can enable the `dryRun` setting to simulate the action without altering any live data.

## Request body

- StandardMaintenanceLogUpsertRequest
  - `records` object[] — The records.
    - `keyField` string — This parameter specifier the name of the unique key used to distinctly assign each dataset in the API. | Value | Description | |-------|----------------------| | id | The internal maintenance log id |
    - `data` MaintenanceLogUpsertRequestRecordData
      - `id` integer — The internal id of the maintenance log.
      - `description` string — The description of the maintenance log. This value is required. (max. 255 characters)
      - `maintenanceId` integer — The internal id of the maintenance to create the log for. This value is required.
      - `date` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `employee` string — The name of the employee. (max. 60 characters)
      - `duration` integer — The duration of the maintenance in seconds.
      - `materialCost` number — The material costs of the maintenance.
      - `serviceCost` number — The service costs of the maintenance.
      - `invoiceNumber` string — The invoice number for the maintenance. (max. 50 characters)
      - `invoiceFileData` string — The data of the invoice file that is connected to the maintenance (base64 encoded).
      - `company` string — The company that carried out the maintenance. (max. 60 characters)
      - `note` string — Additional notes.
  - `dryRun` boolean — Simulate the operation. (No records will be created or changed) This Parameter is optional.

## Response `200`

Success Response:

- StandardMaintenanceLogUpsertResponse
  - `createdMaintenanceLogs` object[] — The created maintenances.
    - `id` integer — The internal id of the maintenance log.
    - `description` string — The description of the maintenance log.
    - `type` string — The maintenance type.
    - `tracker` StandardMaintenanceBaseTrackerItem
      - `id` integer — The internal vehicle ID.
      - `identifier` string — The customer-specific ID. (max. 64 characters)
      - `inventoryNumber` string — The inventory number. (max. 128 characters)
      - `licenseNumber` string — The vehicle license plate. (max. 255 characters)
      - `identificationNumber` string — The vehicle identification number. (max. 24 characters)
      - `importSource` string — External data source from which this vehicle originates. (max. 64 characters)
      - `importKey` string — External ID from the respective data source. (max. 64 characters)
      - `name` string — The vehicle name. (max. 255 characters)
      - `description` string — The vehicle description.
      - `driverName` string — The driver name. (max. 255 characters)
      - `driverPhoneNumber` string — The driver phone number. (max. 255 characters)
      - `costCenter` string — The cost center. (max. 25 characters)
      - `serialNumber` string — The serial number of the vehicle.
      - `manufacturingDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `tool` StandardToolBaseToolListItem
      - `id` integer — The internal id of the tool.
      - `name` string — The name of the tool.
      - `category` string — The name of the tool's category.
      - `serialNumber` string — The serial number of the tool.
      - `inventoryNumber` string — The inventory number of the tool.
      - `externalId` string — The external ID of the tool.
      - `status` string — The status of the tool.
      - `manufacturer` string — The name of the manufacturer of the tool.
      - `vehicleId` string — The id of the assigned locating device if it is a vehicle.
      - `beaconId` string — The id of the assigned locating device if it is a beacon.
      - `currentProject` StandardToolBaseProjectItem
        - `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.
      - `multipleProjectsPossible` boolean — Indicates if multiple current projects were possible.
      - `currentProjectChangedAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `licenseNumber` string — The license plate of the tool.
    - `date` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
    - `employee` string — The name of the employee.
    - `duration` integer — The duration of the maintenance in seconds.
    - `materialCost` number — The material costs of the maintenance.
    - `serviceCost` number — The service costs of the maintenance.
    - `invoiceNumber` string — The invoice number for the maintenance.
    - `invoiceFileData` string — The data of the invoice file (base64 encoded)
    - `company` string — The company that carried out the maintenance.
    - `note` string — Additional notes.
  - `updatedMaintenanceLogs` object[] — The changed maintenances.
    - `id` integer — The internal id of the maintenance log.
    - `description` string — The description of the maintenance log.
    - `type` string — The maintenance type.
    - `tracker` StandardMaintenanceBaseTrackerItem
      - `id` integer — The internal vehicle ID.
      - `identifier` string — The customer-specific ID. (max. 64 characters)
      - `inventoryNumber` string — The inventory number. (max. 128 characters)
      - `licenseNumber` string — The vehicle license plate. (max. 255 characters)
      - `identificationNumber` string — The vehicle identification number. (max. 24 characters)
      - `importSource` string — External data source from which this vehicle originates. (max. 64 characters)
      - `importKey` string — External ID from the respective data source. (max. 64 characters)
      - `name` string — The vehicle name. (max. 255 characters)
      - `description` string — The vehicle description.
      - `driverName` string — The driver name. (max. 255 characters)
      - `driverPhoneNumber` string — The driver phone number. (max. 255 characters)
      - `costCenter` string — The cost center. (max. 25 characters)
      - `serialNumber` string — The serial number of the vehicle.
      - `manufacturingDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `tool` StandardToolBaseToolListItem
      - `id` integer — The internal id of the tool.
      - `name` string — The name of the tool.
      - `category` string — The name of the tool's category.
      - `serialNumber` string — The serial number of the tool.
      - `inventoryNumber` string — The inventory number of the tool.
      - `externalId` string — The external ID of the tool.
      - `status` string — The status of the tool.
      - `manufacturer` string — The name of the manufacturer of the tool.
      - `vehicleId` string — The id of the assigned locating device if it is a vehicle.
      - `beaconId` string — The id of the assigned locating device if it is a beacon.
      - `currentProject` StandardToolBaseProjectItem
        - `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.
      - `multipleProjectsPossible` boolean — Indicates if multiple current projects were possible.
      - `currentProjectChangedAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `licenseNumber` string — The license plate of the tool.
    - `date` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
    - `employee` string — The name of the employee.
    - `duration` integer — The duration of the maintenance in seconds.
    - `materialCost` number — The material costs of the maintenance.
    - `serviceCost` number — The service costs of the maintenance.
    - `invoiceNumber` string — The invoice number for the maintenance.
    - `invoiceFileData` string — The data of the invoice file (base64 encoded)
    - `company` string — The company that carried out the maintenance.
    - `note` string — Additional notes.
  - `deletedMaintenanceLogs` object[] — The deleted maintenances.
    - `id` integer — The internal id of the maintenance log.
    - `description` string — The description of the maintenance log.
    - `type` string — The maintenance type.
    - `tracker` StandardMaintenanceBaseTrackerItem
      - `id` integer — The internal vehicle ID.
      - `identifier` string — The customer-specific ID. (max. 64 characters)
      - `inventoryNumber` string — The inventory number. (max. 128 characters)
      - `licenseNumber` string — The vehicle license plate. (max. 255 characters)
      - `identificationNumber` string — The vehicle identification number. (max. 24 characters)
      - `importSource` string — External data source from which this vehicle originates. (max. 64 characters)
      - `importKey` string — External ID from the respective data source. (max. 64 characters)
      - `name` string — The vehicle name. (max. 255 characters)
      - `description` string — The vehicle description.
      - `driverName` string — The driver name. (max. 255 characters)
      - `driverPhoneNumber` string — The driver phone number. (max. 255 characters)
      - `costCenter` string — The cost center. (max. 25 characters)
      - `serialNumber` string — The serial number of the vehicle.
      - `manufacturingDate` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `tool` StandardToolBaseToolListItem
      - `id` integer — The internal id of the tool.
      - `name` string — The name of the tool.
      - `category` string — The name of the tool's category.
      - `serialNumber` string — The serial number of the tool.
      - `inventoryNumber` string — The inventory number of the tool.
      - `externalId` string — The external ID of the tool.
      - `status` string — The status of the tool.
      - `manufacturer` string — The name of the manufacturer of the tool.
      - `vehicleId` string — The id of the assigned locating device if it is a vehicle.
      - `beaconId` string — The id of the assigned locating device if it is a beacon.
      - `currentProject` StandardToolBaseProjectItem
        - `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.
      - `multipleProjectsPossible` boolean — Indicates if multiple current projects were possible.
      - `currentProjectChangedAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `licenseNumber` string — The license plate of the tool.
    - `date` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
    - `employee` string — The name of the employee.
    - `duration` integer — The duration of the maintenance in seconds.
    - `materialCost` number — The material costs of the maintenance.
    - `serviceCost` number — The service costs of the maintenance.
    - `invoiceNumber` string — The invoice number for the maintenance.
    - `invoiceFileData` string — The data of the invoice file (base64 encoded)
    - `company` string — The company that carried out the maintenance.
    - `note` string — Additional notes.

---

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