Skip to content

Users (v4)

The Users API lets you create and manage employee accounts in Ditio — the typical backbone of an HR-system sync. Each user needs at minimum a name, phone number, date of birth, employee number, and employment start date.

Base URL: api/v4/integration/users · 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/users
Terminal window
curl -X POST "$DITIO_API_BASE/api/v4/integration/users" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"companyId": "YOUR_COMPANY_ID",
"employeeNumber": "1042",
"firstName": "Kari",
"lastName": "Nordmann",
"mobileWork": "+4798765432",
"birthDate": "1990-05-15",
"employmentStartDate": "2026-03-01",
"email": "kari.nordmann@example.com",
"department": "Anlegg",
"workTitle": "Maskinfører"
}'

Response: the created user, including identityId and companyProfileId.

{
"identityId": "auth0|abc123def456",
"companyProfileId": "67a1b2c3d4e5f6a7b8c9d0e3",
"companyId": "YOUR_COMPANY_ID",
"employeeNumber": "1042",
"firstName": "Kari",
"lastName": "Nordmann",
"mobileWork": "+4798765432"
}
FieldTypeFormatDescription
companyIdstringYour Ditio company ID
employeeNumberstringUnique employee number within the company
firstNamestringFirst name
lastNamestringLast name
mobileWorkstring+4798765432Work phone number (used for SMS login)
birthDatestringdd.MM.yyyy or yyyy-MM-ddDate of birth
employmentStartDatestringdd.MM.yyyy or yyyy-MM-ddEmployment start date
FieldTypeDescription
emailstringEmail address
mobilePrivatestringPrivate phone number
workTitlestringJob title
departmentstringDepartment name
employmentEndDatestringEmployment end date (to terminate employment forward in time)
mainProjectNumberstringDefault project number for this employee
carRegNumberstringCompany car registration number
addressstringHome address
closestRelativestringEmergency contact information
personalInfostringAdditional personal information
cardIdstringBuilder card / access card ID
cardExpirationDatestringCard expiration date
payrollbooltrue = hourly wage, false = fixed salary
isDisabledboolDisable the user account (default: false)
defaultResourceNumberstringDefault resource/machine number
worktimeArrangementNamestringWork time arrangement name
organizationNumberstringOrganization number (for sub-contractor companies)
tagsarrayList of user tags (see below)

Tags are key-value pairs attached to a user:

{
"tags": [
{ "key": "safety-course", "value": "true" },
{ "key": "crane-license", "value": "A" }
]
}
GET /api/v4/integration/users

Optional query parameters:

ParameterTypeDescription
changedSincedatetimeOnly return users modified after this date (note: slower query)
companyIdstringFilter to a specific company (useful if you have subsidiaries)
employmentLookbackDaysintOnly return users with active or recently ended employments (within X days)
Terminal window
# All users changed in the last 7 days
curl "$DITIO_API_BASE/api/v4/integration/users?changedSince=2026-06-27T00:00:00Z" \
-H "Authorization: Bearer $TOKEN"
# Only active employees (employment still active or ended within 30 days)
curl "$DITIO_API_BASE/api/v4/integration/users?employmentLookbackDays=30" \
-H "Authorization: Bearer $TOKEN"
GET /api/v4/integration/users/by-profile-id/{profileId}
GET /api/v4/integration/users/by-employee-number/{employeeNumber}
PUT /api/v4/integration/users/{identityId}

Replaces all fields. Send the complete user object including identityId, companyProfileId, and all required fields.

Terminal window
curl -X PUT "$DITIO_API_BASE/api/v4/integration/users/auth0%7Cabc123def456" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"identityId": "auth0|abc123def456",
"companyProfileId": "67a1b2c3d4e5f6a7b8c9d0e3",
"companyId": "YOUR_COMPANY_ID",
"employeeNumber": "1042",
"firstName": "Kari",
"lastName": "Nordmann",
"mobileWork": "+4798765432",
"birthDate": "1990-05-15",
"employmentStartDate": "2026-03-01",
"workTitle": "Anleggsleder"
}'
PATCH /api/v4/integration/users/{companyProfileId}

Updates only the fields you include. Note that PATCH uses companyProfileId in the URL, not identityId.

Terminal window
curl -X PATCH "$DITIO_API_BASE/api/v4/integration/users/67a1b2c3d4e5f6a7b8c9d0e3" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "workTitle": "Prosjektleder", "department": "Administrasjon" }'

Instead of deleting a user, disable and re-enable them:

Terminal window
# Disable
curl -X PATCH "$DITIO_API_BASE/api/v4/integration/users/disable/67a1b2c3d4e5f6a7b8c9d0e3" \
-H "Authorization: Bearer $TOKEN"
# Enable
curl -X PATCH "$DITIO_API_BASE/api/v4/integration/users/enable/67a1b2c3d4e5f6a7b8c9d0e3" \
-H "Authorization: Bearer $TOKEN"

Both return 204 No Content on success.

DELETE /api/v4/integration/users/{identityId}
Terminal window
curl "$DITIO_API_BASE/api/v4/integration/users/is-identity-deletable/auth0%7Cabc123def456" \
-H "Authorization: Bearer $TOKEN"
# Returns: true or false
  1. Initial load — create all employees with POST /api/v4/integration/users
  2. Ongoing sync — periodically fetch GET /api/v4/integration/users?changedSince=LAST_SYNC_TIME and compare with your HR system
  3. Updates — use PATCH to update changed fields
  4. OffboardingPATCH /disable/{companyProfileId} when an employee leaves (or set employmentEndDate)

employeeNumber is the primary identifier for matching users between systems. It must be unique within a company. If your HR system doesn’t have employee numbers, generate sequential ones (e.g. 001, 002, …).