Skip to content

Machines & Equipment

The Machines API lets you register and manage machines (excavators, loaders, dumpers, trucks) and equipment (smaller tools and attachments) in Ditio — typically as a sync from your fleet management or asset system, so machine hours and usage in Ditio always reference the right fleet numbers.

Base URL: api/v4/integration/machines · Scope: ditioapiv3

Terminal window
# Test (default for all examples)
export DITIO_API_BASE="https://core-api.ditio.dev/core"
# Production: export DITIO_API_BASE="https://core-api.ditio.app/core"

Every machine in Ditio has a type (e.g. loader, dumper, truck). Machine types are configured per company and each type has a typeId — a string identifier like "hjullaster" or "dumper".

When creating a machine, you send the typeId string — not a numeric ID. The type must already exist in your Ditio company; otherwise the API returns the error MachineService.machineTypeInvalid.

Look up your company’s valid types via the API:

Terminal window
curl "$DITIO_API_BASE/api/MachineType" \
-H "Authorization: Bearer $TOKEN"

Common examples (actual types depend on your company’s configuration):

typeIdDescription
hjullasterWheel loader
beltemaskinTracked excavator
hjulgraverWheeled excavator
dumperDumper
lastebilTruck
tippbilTipper truck
bilCar
firmabilCompany car
traktorTractor
minidumperMini dumper

Contact support@ditio.no if you need new machine types added for your company.

POST /api/v4/integration/machines
Terminal window
curl -X POST "$DITIO_API_BASE/api/v4/integration/machines" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"companyId": "YOUR_COMPANY_ID",
"machineNumber": "M-001",
"name": "Volvo EC220E",
"typeId": "beltemaskin",
"active": true,
"buildYear": 2022,
"weight": 22000,
"serialNumber": "VCEC220EL00012345",
"registrationNumber": "AB 12345",
"costPrice": 450.00
}'
FieldTypeDescription
companyIdstringYour Ditio company ID
machineNumberstringYour internal machine number (unique within the company)
FieldTypeDescription
namestringMachine name / description
typeIdstringMachine type ID (must match an existing type in your company)
activeboolWhether the machine is active (default: false)
departmentstringDepartment
costPriceMachinedoubleMachine-specific cost price
costPricedoubleGeneral cost price
pricedoubleSales price
weightdoubleWeight (kg)
capacitydoubleCapacity
notestringNotes
buildYearintYear built
emissionClassstringEmission class
hourMeterdoubleCurrent hour meter reading
serviceDatedatetimeLast service date
purchasedDatedatetimePurchase date
serialNumberstringSerial number
engineNumberstringEngine number
registrationNumberstringRegistration / license plate number
responsibleIdstringResponsible person (Ditio user ID)
responsibleEmployeeNumberstringResponsible person (employee number)
isEquipmentbooltrue for equipment, false for machines (default: false)
POST /api/v4/integration/machines/create/array

Send an array of machines. Each is processed individually — if one fails, the others are still created.

WhatEndpoint
All machinesGET /api/v4/integration/machines
By IDGET /api/v4/integration/machines/{id}
By machine numberGET /api/v4/integration/machines/by-machine-number/{machineNumber}

Add ?includeEquipmentDetails=true to any GET endpoint to include linked equipment in the response.

PUT /api/v4/integration/machines/{id}

Bulk variant: PUT /api/v4/integration/machines/update/array (each item must include id).

PATCH /api/v4/integration/machines/{id}
Terminal window
curl -X PATCH "$DITIO_API_BASE/api/v4/integration/machines/68a1b2c3d4e5f6a7b8c9d0e4" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "hourMeter": 4200, "serviceDate": "2026-06-01T00:00:00Z" }'
PATCH /api/v4/integration/machines/{id}/esg

Updates ESG-relevant fuel fields on a machine. Send at least one supported field.

Terminal window
curl -X PATCH "$DITIO_API_BASE/api/v4/integration/machines/68a1b2c3d4e5f6a7b8c9d0e4/esg" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "fuelConsumptionRate": 12.5, "fuelConsumptionUnit": 0, "fuelType": 1 }'
  • fuelConsumptionUnit: 0 = L/hour, 1 = L/km, 2 = kWh/hour, 3 = kWh/km, 4 = kg/hour, 5 = kg/km
  • fuelType: 0 = none, 1 = diesel, 2 = biodiesel, 3 = gasoline, 4 = electric, 5 = gas, 6 = natural gas, 7 = dyed diesel
DELETE /api/v4/integration/machines/{id}

Check deletability first:

Terminal window
curl "$DITIO_API_BASE/api/v4/integration/machines/is-machine-deletable/68a1b2c3d4e5f6a7b8c9d0e4" \
-H "Authorization: Bearer $TOKEN"
# Returns: true or false
MachinesEquipment
WhatStandalone vehicles and heavy machinerySmaller tools, attachments, accessories
ExamplesExcavator, loader, dumper, truckHydraulic hammer, tilt rotator, GPS unit
isEquipmentfalse (default)true
Type validationtypeId is validated — must match an existing typetypeId is not validated
LinkingEquipment can be linked to machinesLinked to a parent machine

To create equipment, set isEquipment: true:

Terminal window
curl -X POST "$DITIO_API_BASE/api/v4/integration/machines" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"companyId": "YOUR_COMPANY_ID",
"machineNumber": "EQ-001",
"name": "Rammer S21 hydraulisk hammer",
"isEquipment": true,
"active": true
}'
  1. Fetch machine types first via GET /api/MachineType to know which typeId values are valid
  2. Create machines with matching typeId values
  3. Periodically update hour meters and service dates via PATCH
  4. Deactivate retired machines by patching active: false instead of deleting

Map your machine categories to Ditio types

Section titled “Map your machine categories to Ditio types”

If your system uses different category names, maintain a mapping table:

Your systemDitio typeId
Excavator (tracked)beltemaskin
Excavator (wheeled)hjulgraver
Wheel loaderhjullaster
Articulated haulerdumper
Trucklastebil
Passenger vehiclebil