Manage workforce through the API
Start with the customer API guide to activate access, obtain a token and choose scopes. Every endpoint below uses the employer-specific base URL https://workforce-api.test.vesta.services/api/customer/v1/employers/{employerId}.
Create an employee
Section titled “Create an employee”Grant and request employees:write. Existing integrations do not gain this scope automatically.
Send POST /employees with JSON and an Idempotency-Key header. Reuse the same key and identical
body when retrying the same creation; use a new key for a different employee. A successful call
returns 201 with { "id": "<employee UUID>" }, never a kiosk PIN. A retry can return the stored
response with Idempotency-Replayed: true; a reused key with a different body is refused.
firstName and culture (nl-BE, fr-BE or en-GB) are required. 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) are optional.
A contract can only be created for an employee with an ssin; a birthDate must agree with it. Set sendWelcomeEmail: true explicitly
to send an invitation; it defaults to false. WhatsApp invitations, wages and bank accounts are not accepted by this endpoint.
Use GET /employment-statutes and GET /job-functions with employees:read to select the
integer IDs for statuteId and functionId. Both return an array of { "id": 1, "text": "..." } choices without pagination. Use the statute list of the same employer; never
copy a statute ID from another employer. Existing payroll-bridge ownership rules still apply.
establishmentId and costCenterId set the employee’s payroll establishment and cost centre. Both
are optional and validated when given: establishmentId is the id of one of the employer’s
GET /establishments, which needs establishments:read, and costCenterId comes from
GET /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 is created in Vesta at once but waits for VestaPay until its placement is complete: the
payroll establishment, and the cost centre once the employer has cost centres.
{ "firstName": "Alex", "culture": "en-GB", "sendWelcomeEmail": false }
Create an employee using reference data
Section titled “Create an employee using reference data”A typical onboarding integration requests employees:read employees:write establishments:read. Fetch the choices to populate the optional reference fields described above. This example creates an employee with only basic details:
VESTA_EMPLOYER_API="https://workforce-api.test.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}'
Update employee contact details
Section titled “Update employee contact details”Send PATCH /employees/{id}/contact-details with employees:write, JSON and an Idempotency-Key. Only email and phoneNumber are accepted. Omitted fields stay unchanged; explicit null clears a field. Invalid or duplicate email addresses are refused. Changing contact details revokes pending invitations bound to the previous contact details. A successful update returns 204; retries with the same key and body replay that result.
{ "phoneNumber": "+32470123456" }
Read contracts
Section titled “Read contracts”Grant contracts:read to read /contracts with limit and cursor, or /contracts/{id} for one contract. The employer must have the contracts module. These summaries contain the integer contract id, employeeId, employmentStatuteId, from, to, isDayContract and isActive. Dates may be null. Archived contracts and employees are excluded; pay, documents and personal identity details are not returned. These endpoints do not create, sign or cancel contracts.
Manage day contracts
Section titled “Manage day contracts”Grant contracts:write. Send POST /contracts with an Idempotency-Key and { "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 same rules as the portal apply: national register number, age, student, extra and flexi wage rules. A successful call returns 201 with the integer contract id.
Send PUT /contracts/{id} with a new schedule body to move a day contract, and DELETE /contracts/{id} to cancel one nothing was worked on. Both return 204 and need an Idempotency-Key. A contract that is no day contract, or one with work registered on it, returns 409. While VestaPay owns the employee’s contracts the write is refused with 409.
Read and file Dimona
Section titled “Read and file Dimona”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. Grant dimona:read to read GET /contracts/{id}/dimona: status, dimonaNumber, latestDeclarationType, latestDeclarationDate and the anomalies RSZ reported. Grant dimona:write to queue the IN now with POST /contracts/{id}/dimona and an Idempotency-Key. It returns 202 with parked: a flexi or extra contract more than 14 days ahead is held until filesFrom. A declaration already pending returns 409; a contract with nothing left to declare returns 422. Read the outcome later with dimona:read.
Read payroll calculations
Section titled “Read payroll calculations”Grant accountancy:read and read GET /accountancy/calculations?year=2026&month=10. The employer needs the payroll administration module. The response contains 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.
Push worked hours
Section titled “Push worked hours”Grant prestations:write when another system, such as a planning or clocking tool, delivers the hours your employees worked. Send POST /prestation-batches with an Idempotency-Key and { "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, and costCenterId from /cost-centers is optional: without it the hours follow the contract’s cost centers. The employee needs a national register number. The employer needs the payroll administration module, and while VestaPay runs its 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 listed under its line, such as lines[2].hours. A valid batch returns 202 with its id and is the month’s prestations import, like an uploaded prestations file: within about a minute its hours replace the month’s imported hours of every contract it names, and contracts it does not name keep theirs. Sending the whole month again therefore 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.
Read GET /prestation-batches/{id} until status is Finished or Failed. A finished batch lists every line by its lineNumber, its position in lines from 1: Accepted, or Refused with reason EmployeeNotFound, NoContract (no contract that day) or MonthSettled (payroll already settled that month). A failed batch wrote nothing; push it again.
Create and edit planning
Section titled “Create and edit planning”Grant planning:write and use /establishments/{establishmentId}/shifts to create a draft with POST. Send date, local startsAt and endsAt; optionally include employeeId, teamId, taskId and breaks. An end before the start belongs to the following day. A null breaks follows automatic-break rules, while an array supplies explicit breaks. The result is 201 with the shift id. Publish the draft in the planning UI.
Read /establishments/{establishmentId}/shifts/{id} with GET to obtain its schedule and revision. Send PATCH to that same URL with expectedRevision, date, startsAt, endsAt and breaks. This edits one occurrence while preserving assignment and other details. Published shifts retain their current published schedule until the pending revision is published in the planning UI. The edit returns the new revision; a stale revision returns 409.
Both writes require an Idempotency-Key. Keep the key and body unchanged when retrying. The editable GET also requires planning:write because it includes unpublished planning.
Correct time entries
Section titled “Correct time entries”Grant time-entries:read time-entries:write. Find the entry in /time-entries, then GET /time-entries/{id}?workDate=YYYY-MM-DD using its original workDate. The editable response includes UTC startsAt/endsAt, manual breaks, automaticBreaksWaived, isPayrollLocked and revision.
Send PUT to /time-entries/{id} with the same original workDate query, an Idempotency-Key, and the complete editable timeline plus expectedRevision. Automatically calculated breaks are omitted from the editable list and recalculated on save. A successful correction returns 204. A stale revision or payroll lock returns 409. The existing timeline, overlap and employment rules still apply. A running entry must remain open, and a completed entry must keep an end time. This operation does not perform clock-out or submit a new Dimona declaration. If a permitted correction moves the start day, use the new work date for subsequent reads.