Skip to content

Manage workforce through the API

Start with the customer API guide to activate access, get a token and choose scopes. Every path below is relative to https://workforce-api.vesta.services/api/customer/v1/employers/{employerId}.

TaskRequestScope
Create an employeePOST /employeesemployees:write
Update contact detailsPATCH /employees/{id}/contact-detailsemployees:write
Read contractsGET /contracts, /contracts/{id}contracts:read
Manage day contractsPOST /contracts, PUT and DELETE /contracts/{id}contracts:write
Read and file DimonaGET and POST /contracts/{id}/dimonadimona:read, dimona:write
Read payroll calculationsGET /accountancy/calculationsaccountancy:read
Push worked hoursPOST /prestation-batches, GET /prestation-batches/{id}prestations:write
Create and edit planningPOST /establishments/{establishmentId}/shifts, GET and PATCH /establishments/{establishmentId}/shifts/{id}planning:write
Correct time entriesGET and PUT /time-entries/{id}time-entries:read, time-entries:write

Every write needs an Idempotency-Key header. Retry the same write with the same key and the identical body; use a new key for a different write. A retry can return the stored response with Idempotency-Replayed: true. A reused key with a different body is refused.

Send POST /employees with JSON:

{ "firstName": "Alex", "culture": "en-GB", "sendWelcomeEmail": false }
  • Required: firstName and culture (nl-BE, fr-BE or en-GB).
  • Optional: lastName, email, phoneNumber, statuteId, functionId, establishmentId, costCenterId, ssin (the national register number), birthDate and address (street, houseNumber, boxNumber, zipCode, city and a two-letter country).
  • sendWelcomeEmail: true sends an invitation; it defaults to false. WhatsApp invitations, wages and bank accounts are not accepted.
  • A contract can only be created for an employee with an ssin; a birthDate must agree with it.
  • The answer is 201 with { "id": "<employee UUID>" }, never a kiosk PIN.

Reference fields take IDs from the employer’s own lists, which need employees:read or establishments:read:

FieldSource
statuteIdGET /employment-statutes: [{ "id": 1, "text": "..." }]. Never copy a statute ID from another employer.
functionIdGET /job-functions
establishmentIdid from GET /establishments: the payroll establishment
costCenterIdGET /cost-centers

A value that does not belong to the employer is refused with 422 and the code EmployeeDefaults.EmployerEstablishmentUniqueCode.Invalid or EmployeeDefaults.EmployerDepartmentId.Invalid. While the employer’s payroll runs in VestaPay, the employee exists in Vesta at once but waits for VestaPay until the payroll establishment, and the cost centre once the employer has cost centres, are set. Existing payroll-bridge ownership rules still apply.

A typical onboarding integration requests employees:read employees:write establishments:read:

VESTA_EMPLOYER_API="https://workforce-api.vesta.services/api/customer/v1/employers/$VESTA_EMPLOYER_ID"
curl "$VESTA_EMPLOYER_API/employment-statutes" --header "Authorization: Bearer $VESTA_ACCESS_TOKEN"
curl "$VESTA_EMPLOYER_API/job-functions" --header "Authorization: Bearer $VESTA_ACCESS_TOKEN"
curl "$VESTA_EMPLOYER_API/establishments" --header "Authorization: Bearer $VESTA_ACCESS_TOKEN"
curl --request POST "$VESTA_EMPLOYER_API/employees" \
  --header "Authorization: Bearer $VESTA_ACCESS_TOKEN" \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: employee-onboarding-2026-001' \
  --data '{"firstName":"Alex","lastName":"Example","culture":"en-GB","sendWelcomeEmail":false}'

Send PATCH /employees/{id}/contact-details with email, phoneNumber or both:

{ "phoneNumber": "+32470123456" }

An omitted field stays unchanged and an explicit null clears it. Invalid or duplicate email addresses are refused. A change revokes pending invitations sent to the previous details. The answer is 204.

GET /contracts (with limit and cursor) and /contracts/{id} return contract summaries: the integer id, employeeId, employmentStatuteId, from, to, isDayContract and isActive. Dates may be null. Archived contracts and employees are left out, and so are pay, documents and identity details.

Send POST /contracts:

{ "employeeId": "...", "schedule": { "date": "2026-12-15", "startsAt": "18:00:00", "endsAt": "02:00:00" } }
  • Times are Belgian local time; an end at or before the start is on the next day. plannedHours is optional for a student contract.
  • The contract takes the employee’s employment statute and the portal’s rules: national register number, age, student, extra and flexi wage rules.
  • The answer is 201 with the integer contract id.

Send PUT /contracts/{id} with a new schedule to move a day contract, or DELETE /contracts/{id} to cancel one nothing was worked on. Both answer 204. A contract that is not a day contract, or has work registered on it, returns 409, and so does any write while VestaPay owns the employee’s contracts.

Dimona is never sent synchronously. The Dimona sweep files the IN of a new contract; a reschedule or cancellation updates or cancels its Dimona as the portal does.

  • GET /contracts/{id}/dimona (dimona:read) returns status, dimonaNumber, latestDeclarationType, latestDeclarationDate and the anomalies RSZ reported.
  • POST /contracts/{id}/dimona (dimona:write) queues the IN now and answers 202 with parked: a flexi or extra contract more than 14 days ahead is held until filesFrom. A pending declaration returns 409; nothing left to declare returns 422. Read the outcome later.

GET /accountancy/calculations?year=2026&month=10 returns year, month and items: the hours and EUR amounts booked per employee, employment statute, salary group, cost center and performance code, the same lines as the accountancy export. National register numbers are left out; join on employeeId. A month not yet calculated returns no items.

Use prestations:write when another system, such as a planning or clocking tool, delivers the hours your employees worked. Send POST /prestation-batches:

{ "year": 2026, "month": 12, "lines": [{ "employeeId": "...", "date": "2026-12-02", "code": "1", "hours": 7.5, "costCenterId": 12 }] }
  • A batch holds 1 to 5000 lines of one pay month.
  • code is a performance code, such as 1 for worked hours or 2210 for night hours.
  • hours is more than 0 and at most 24, with at most two decimals.
  • costCenterId from /cost-centers is optional; without it the hours follow the contract’s cost centers.
  • The employee needs a national register number. While VestaPay runs the employer’s payroll the push is refused with 409 PayrollLead.Employer.VestaPay.

A batch with an unknown employee, code or cost center, a day outside the month or invalid hours is refused whole with 422, each error under its line, such as lines[2].hours. A valid batch answers 202 with its id. Within about a minute its hours replace the month’s imported hours of every contract it names, just like an uploaded prestations file; contracts it does not name keep theirs, so sending the whole month again never counts hours twice. One batch per month is processed at a time: another batch while one is queued returns 409 ImportPrestations.Request.InProgress, and the same batch again returns that batch with isReplay.

Poll GET /prestation-batches/{id} until status is Finished or Failed. A finished batch lists each line by its lineNumber (its position in lines, from 1) as Accepted or Refused with reason EmployeeNotFound, NoContract (no contract that day) or MonthSettled (payroll already settled). A failed batch wrote nothing: push it again.

Create a draft. Send POST /establishments/{establishmentId}/shifts with date and local startsAt and endsAt, and optionally employeeId, teamId, taskId and breaks. An end before the start is on the next day. breaks: null follows the automatic break rules; an array sets explicit breaks. The answer is 201 with the shift id. Publish the draft in the planning screen.

Edit a shift. GET /establishments/{establishmentId}/shifts/{id} returns its schedule and revision; it needs planning:write because it includes unpublished planning. Send PATCH to the same URL with expectedRevision, date, startsAt, endsAt and breaks. This edits one occurrence and keeps its assignment and other details. A published shift keeps its published schedule until the pending revision is published in the planning screen. The answer holds the new revision; a stale revision returns 409.

  1. Find the entry in /time-entries.
  2. GET /time-entries/{id}?workDate=YYYY-MM-DD with its original workDate. The answer has UTC startsAt and endsAt, manual breaks, automaticBreaksWaived, isPayrollLocked and revision.
  3. PUT /time-entries/{id} with the same workDate query and the complete editable timeline plus expectedRevision.

Automatic breaks are not in the editable list; they are recalculated on save. A successful correction answers 204. A stale revision or a payroll lock returns 409. The timeline, overlap and employment rules still apply: a running entry stays open and a completed entry keeps an end time. A correction neither clocks out nor files a new Dimona. When a correction moves the start day, use the new work date afterwards.