Skip to content

Work Orders (Tasks)

Work orders (called “tasks” in the API) represent the individual pieces of work within a project. Employees register their time against work orders, so a correct work-order structure is what makes hours land on the right cost codes in your ERP. A project must exist before you can create work orders in it.

Base URL: api/v4/integration/tasks · 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"
POST /api/v4/integration/tasks
Terminal window
curl -X POST "$DITIO_API_BASE/api/v4/integration/tasks" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"companyId": "YOUR_COMPANY_ID",
"projectId": "65f1a2b3c4d5e6f7a8b9c0d1",
"externalId": "WO-100",
"name": "Grunnarbeid",
"active": true,
"startDate": "2026-03-15T00:00:00Z",
"finishedDatePlanned": "2026-05-01T00:00:00Z",
"estimatedHourQty": 500
}'

Response: the created work order with its generated id.

FieldTypeDescription
companyIdstringYour Ditio company ID
projectIdstringThe Ditio project ID this work order belongs to
externalIdstringYour external work order number/ID (unique within the project)
FieldTypeDescription
namestringWork order name
activeboolWhether the work order is active (default: false)
externalProjectNumberstringExternal project number (for reference)
externalProjectNamestringExternal project name (for reference)
externalDim01stringProduction code / external dimension 1
workDescriptionShortstringShort description of the work
workDescriptionstringDetailed description
startDatedatetimeStart date
finishedDatePlanneddatetimePlanned completion date
finishedDatedatetimeActual completion date
estimatedHourQtydoubleEstimated hours for this work order
fixedResourcePricedoubleFixed resource price
unitIdstringUnit of measurement ID
costPricedoubleCost price
pricedoubleSales price
measureUnitQtyboolWhether to measure unit quantity
parentActivityIdstringParent work order ID (for hierarchical structure)
chapterIdstringChapter ID
mainForemanIdstringMain foreman ID
taskLeaderIdstringWork order leader ID
taskLocationLatitudedoubleGPS latitude
taskLocationLongitudedoubleGPS longitude
safeJobAnalysisApprovalRequiredboolRequire SJA approval before work starts
safeJobAnalysisUserPromptTextstringSJA text shown to users
isParentboolMark as a parent work order (container for sub-orders)

A project can contain one template work order — a work order marked as a template in the Ditio backoffice (planning view). When a new work order is created in that project through this API and a settings field is omitted, the value is copied from the template. Fields the integration provides always take precedence (“payload wins, template fills the gaps”).

Settings inherited from the template include: text-required, SJA approval requirement and prompt text, unit and unit-quantity measurement, summation type, prices, double-registration, mass-haul defaults, the unit-quantity report level, the work-order type and externalDim02. Identity and scope fields (externalId, name, chapterId, dates, parentActivityId, quantities) always come from your request.

A work order created through the API is never itself marked as a template — the template flag is managed only in the Ditio backoffice.

Work orders can be nested. Set parentActivityId to the ID of the parent work order and mark the parent with isParent: true.

Terminal window
# Create parent work order
curl -X POST "$DITIO_API_BASE/api/v4/integration/tasks" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"companyId": "YOUR_COMPANY_ID",
"projectId": "65f1a2b3c4d5e6f7a8b9c0d1",
"externalId": "WO-200",
"name": "Masseflytting",
"isParent": true,
"active": true
}'
# Create child work order under it
curl -X POST "$DITIO_API_BASE/api/v4/integration/tasks" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"companyId": "YOUR_COMPANY_ID",
"projectId": "65f1a2b3c4d5e6f7a8b9c0d1",
"externalId": "WO-201",
"name": "Graving",
"parentActivityId": "PARENT_TASK_ID",
"active": true
}'
WhatEndpoint
All in a project (by Ditio project ID)GET /api/v4/integration/tasks/project/{projectId}
All in a project (by project number)GET /api/v4/integration/tasks/by-project-number/{projectNumber}
All in a project (by external project number)GET /api/v4/integration/tasks/by-external-project-number/{externalProjectNumber}
Single by IDGET /api/v4/integration/tasks/{id}
By project number + task numberGET /api/v4/integration/tasks/by-project-number/{projectNumber}/by-task-number/{taskNumber}
All matches for project number + task numberGET /api/v4/integration/tasks/by-project-number/{projectNumber}/by-task-number/{taskNumber}/list
By external project number + external IDGET /api/v4/integration/tasks/by-external-project-number/{externalProjectNumber}/by-external-id/{externalId}
All with a production codeGET /api/v4/integration/tasks/by-production-code/{externalDim01}
Terminal window
curl "$DITIO_API_BASE/api/v4/integration/tasks/by-project-number/P-2026-001/by-task-number/WO-100" \
-H "Authorization: Bearer $TOKEN"
PUT /api/v4/integration/tasks/{id}

Replaces all fields — send the complete work order object. Any field you omit is reset to its default (e.g. an omitted costPrice becomes 0, an omitted safeJobAnalysisApprovalRequired becomes false); the template is not consulted on update. To change only some fields without resetting the rest, use PATCH.

PATCH /api/v4/integration/tasks/{id}
Terminal window
curl -X PATCH "$DITIO_API_BASE/api/v4/integration/tasks/66a1b2c3d4e5f6a7b8c9d0e2" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Grunnarbeid - fase 2", "estimatedHourQty": 750 }'
DELETE /api/v4/integration/tasks/{id}
  • Projects — the container work orders live in
  • Documents — attach method statements and drawings to a work order
  • Project Data guide — bulk export of the full work-order catalogue