Customer API
The customer API lets your server read and update one employer’s data in Vesta. It uses OAuth 2.0 client credentials over HTTPS at https://workforce-api.vesta.services.
| You want to | Scopes | Guide |
|---|---|---|
| Read establishments, employees, planning and time entries | establishments:read, employees:read, agency-workers:read, planning:read, time-entries:read | Endpoints |
| Report planned and actual labor cost | labor-cost:read | Labor cost |
| Create employees, draft shifts, correct time entries | employees:write, planning:write, time-entries:write | Manage workforce |
| Manage day contracts and their Dimona | contracts:read, contracts:write, dimona:read, dimona:write | Manage workforce |
| Read payroll calculations, push worked hours | accountancy:read, prestations:write | Manage workforce |
The API reference lists every field of every endpoint.
Quickstart
Section titled “Quickstart”- Ask an employer administrator to activate API access and create an integration with the scopes you need.
- Store the client ID, client secret and Employer ID on your server.
- Request a token and make your first call:
VESTA_API="https://workforce-api.vesta.services"
VESTA_ACCESS_TOKEN=$(curl --silent --request POST "$VESTA_API/oauth/customer/token" \
--user "$VESTA_CLIENT_ID:$VESTA_CLIENT_SECRET" \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=establishments:read' | jq -r .access_token)
curl "$VESTA_API/api/customer/v1/employers/$VESTA_EMPLOYER_ID/establishments" \
--header "Authorization: Bearer $VESTA_ACCESS_TOKEN"
{ "items": [{ "id": "1f0c...", "name": "Brasserie Centrum", "timeZoneId": "Europe/Brussels", "isActive": true }], "nextCursor": null }
Create an integration
Section titled “Create an integration”Vesta activates API access per employer. Until it is active, Settings > Integrations > API access in the employer portal shows API access is not active and a Request API access button that emails Vesta.
- Sign in to the employer portal as an employer administrator.
- Open Settings > Integrations > API access and select Create integration.
- Enter a name and select only the permissions the software needs.
- Copy the client ID and client secret into your server’s secret store, then select I have stored the secret. The secret is shown only once.
- Expand Connection details and copy the Employer ID: every data URL contains it.
- An integration reads only its own employer’s data. An employer can have up to 25 active integrations.
- Edit changes the name or the permissions. A new name keeps existing tokens; new permissions invalidate them at once, so request a new token.
- Keep the client secret and tokens on your server. Never put them in browser code, mobile apps, URLs or logs.
Request an access token
Section titled “Request an access token”Send POST /oauth/customer/token with a form-encoded body and one or more scopes separated by spaces. Authenticate with HTTP Basic, as in the quickstart, or send the credentials in the body (client_secret_post):
curl --request POST "https://workforce-api.vesta.services/oauth/customer/token" \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode "client_id=$VESTA_CLIENT_ID" \
--data-urlencode "client_secret=$VESTA_CLIENT_SECRET" \
--data-urlencode 'scope=establishments:read planning:read'
{ "access_token": "eyJhbGciOi...", "token_type": "Bearer", "expires_in": 300 }
A token is valid for 300 seconds and there is no refresh token. Reuse it for every call until shortly before it expires, then request a new one with the same credentials.
A refused token request returns an OAuth error such as { "error": "invalid_scope" }:
| Error | Status | Cause |
|---|---|---|
invalid_request | 400 | A parameter is missing or malformed, or the credentials are sent both in the header and in the body. |
invalid_client | 401 | Unknown client ID, wrong secret, or an integration that was revoked or whose secret was rotated. |
unauthorized_client | 400 | API access is no longer active for the employer. |
invalid_scope | 400 | No scope, an unknown scope, a scope the integration was not given, or a scope whose module the employer no longer has. |
unsupported_grant_type | 400 | grant_type is not client_credentials. |
Do not retry invalid_client or unauthorized_client automatically: they need a change in the portal.
Scopes and endpoints
Section titled “Scopes and endpoints”Every data URL starts with https://workforce-api.vesta.services/api/customer/v1/employers/{employerId} and needs the header Authorization: Bearer <access_token>. A token works only on its own employer’s URLs. Each scope matches a permission of the same name in the portal.
| Scope | Endpoints | Also requires |
|---|---|---|
establishments:read | GET /establishments, /establishments/{id}, /public-holidays | |
employees:read | GET /employees, /employees/{id}, /employment-statutes, /job-functions, /cost-centers | |
employees:write | POST /employees, PATCH /employees/{id}/contact-details | |
agency-workers:read | GET /agency-workers, /agency-workers/{id} | |
planning:read | GET /teams, /teams/{id}, /tasks, /tasks/{id}, /shifts, /availability | Planning module |
planning:write | POST /establishments/{establishmentId}/shifts, GET and PATCH /establishments/{establishmentId}/shifts/{id} | Planning module |
time-entries:read | GET /time-entries | Time registration module |
time-entries:write | GET and PUT /time-entries/{id} | Time registration module |
labor-cost:read | GET /labor-cost | Planning and time registration modules; also request planning:read and time-entries:read |
contracts:read | GET /contracts, /contracts/{id} | Contracts module |
contracts:write | POST /contracts, PUT and DELETE /contracts/{id} | Contracts module |
dimona:read | GET /contracts/{id}/dimona | Dimona module |
dimona:write | POST /contracts/{id}/dimona | Dimona module |
accountancy:read | GET /accountancy/calculations | Payroll administration module |
prestations:write | POST /prestation-batches, GET /prestation-batches/{id} | Payroll administration module |
An existing integration never gains a scope automatically: edit it in the portal, then request a new token.
Lists, dates and paging
Section titled “Lists, dates and paging”/shifts,/time-entriesand/availabilityneedfromandto./public-holidaysneedsyear. Dates areYYYY-MM-DDbetween 2000 and 2100, both included, and a range covers at most 93 days.- Lists that accept
limitandcursorreturn{ "items": [...], "nextCursor": "..." }.limitis 1 to 200, default 100. SendnextCursorback ascursor, with the same other parameters, untilnextCursorisnull. A cursor only works on the list, employer and date range that returned it. /employment-statutes,/job-functionsand/cost-centersreturn a plain array without paging./{resource}/{id}returns one record by theidfrom its list, and404for a missing, archived or other-employer record.- Paging is not a snapshot: a record that changes while you page can be missed or returned twice. The next full read corrects it.
curl "https://workforce-api.vesta.services/api/customer/v1/employers/$VESTA_EMPLOYER_ID/shifts?from=2026-10-01&to=2026-10-31&limit=200" \
--header "Authorization: Bearer $VESTA_ACCESS_TOKEN"
Keep data in sync
Section titled “Keep data in sync”There is no change feed and no modifiedSince filter. To stay in sync:
- Re-read the window you keep, for example the past two weeks and the coming four weeks of shifts, and page until
nextCursorisnull. - Upsert every record by
id. - Only after the last page, treat a stored
idin that window that was not returned as deleted. A shift that disappears was deleted or unpublished.
Re-read reference lists in full the same way. Archived employees drop out of /employees; use isActive for everything else.
Data semantics
Section titled “Data semantics”- IDs. Employees, establishments, shifts and time entries have stable UUIDs. Contracts, employment statutes and job functions have integer IDs.
- Times. In
/shiftsand/time-entries,startsAt,endsAtand break times are local times with the establishment’s UTC offset, such as2026-10-03T22:00:00+02:00. Fields ending inUtcare UTC. - Shifts.
/shiftscontains published shifts only, selected by their planneddate. A shift past midnight ends the next day.plannedMinutesis the real time betweenstartsAtandendsAtminusbreakMinutes, so a night shift across a daylight saving change counts one hour more or less.fillTypeisInternalfor an employee andExternalfor an agency or external worker. - Time entries. Selected by
workDate, the local day the entry started at its establishment.statusisWorking,OnBreak,CompletedorCancelled.endsAtis empty while an entry is open andworkedMinutesis present only when it isCompleted.shiftIdlinks the published shift, when there is one.reviewedAtUtcis set once the employer reviewed the entry. Cancelled entries do not count as worked time. - Availability. One item per
employeeIdanddate, without a recordid: sync by that pair. Each window hasstartTime,endTime(bothnullfor a whole day),intentandconfirmed.Wantmeans the employee wants to work,Standbyavailable if needed,Unavailablenot available. A missing employee and day means unknown, not unavailable. Private notes are not returned. - Removed records. Shifts and time entries at a deleted establishment are left out. A reference to a deleted team, task, agency or agency worker is
null. An archived employee keeps theiremployeeIdon shifts and time entries. - Personal data. Employees contain
firstName,lastNameandisActiveonly: no national number, bank account, contact details or birth date.
Read labor cost
Section titled “Read labor cost”Grant and request labor-cost:read planning:read time-entries:read. /labor-cost compares planned cost with the operational cost of registered working time per group and period. It is not finalized payroll, an invoice or paid-out wages.
curl "https://workforce-api.vesta.services/api/customer/v1/employers/$VESTA_EMPLOYER_ID/labor-cost?from=2026-10-01&to=2026-10-31&groupBy=Team&granularity=Day" \
--header "Authorization: Bearer $VESTA_ACCESS_TOKEN"
| Parameter | Values |
|---|---|
from, to | At most 93 days. For a calendar month, send its first and last day. |
groupBy | Statute (employment statute), Team or Task (planning) |
granularity | Day or Month. Month buckets are clipped to your dates. |
The response has from, to, groupBy, granularity, asOf and rows. Each row has its bucket from and to, key, name, statuteGroup, planned, actual, workedHours and actualCoverage. A null group is unattributed work. Groups without data have no row.
- Planned includes draft and published shifts, unlike
/shifts. Assigned work counts once per employee, day and group. Open shifts count inassignmentCountbut have no price. ComparepricedAssignmentCountwithassignmentCount, and checkbasisandhasCrossEstablishmentAmbiguity, before you present a total: unpriced assignments are not free labor. - Allocation. For
TeamandTask,allocationBasisstates how the whole employee-day cost, premiums and forfaits included, is split by paid planned minutes. These shares are not separate payroll quotes.Statuteuses the worker’s governing statute. - Actual.
actual.totalis the priced amount in EUR, andactual.estimatedTotalthe part based on estimates.actual.pricedHoursandactual.costPerHourcover priced hours only.actualCoveragereportspricedEntryCount,unpricedEntryCountandestimatedEntryCount: always show missing coverage and estimates next to amounts. - Scope of actuals. Running registrations count up to
asOf, so actuals change as entries close or wages are corrected. Breaks, paid absences and final payroll settlement are excluded. Overnight work belongs to the local start date. - A
nullcost means unknown, never zero. Do not label an incomplete or estimated amount as an exact total.
For worked hours per employee and day, read every page of /time-entries, keep Completed entries, group by employeeId and workDate, and sum workedMinutes divided by 60. For planned minutes, group /shifts by employeeId and date. For assistant access to these reports, see MCP connection.
Rate limits
Section titled “Rate limits”| Requests | Limit | Counted per |
|---|---|---|
| Token requests | 30 per 60 seconds | IP address and client ID. With client_secret_post, all token requests from one IP address share one budget. |
| Data requests | 600 per 60 seconds | Employer, shared by all its integrations |
Vesta’s general limit of 500 requests per minute per IP address also applies. Over a limit the API answers 429 with a Retry-After header in seconds: wait at least that long. Reusing tokens keeps you well within the token budget.
Errors
Section titled “Errors”Data endpoints answer errors as problem details (application/problem+json).
| Status | Meaning | What to do |
|---|---|---|
400 | A parameter is missing or malformed, such as from, to, year or limit. | Fix the request. |
401 | The token is missing, invalid or expired; its integration was revoked, rotated or given new permissions; or the employer lost API access or every module the token’s scopes read. | Request a new token once. If that is refused, stop. |
403 | The token is for another employer, lacks the scope, or the employer lost the module that scope reads. | Check the employer ID and scopes. |
404 | The record is missing, archived or belongs to another employer. | Re-read the list. |
409 | The write conflicts with the record’s current state. | Re-read the record, then decide. |
422 | to is before from, a date is outside 2000 to 2100, the range exceeds 93 days, the cursor does not belong to this list, or a write fails validation. | Fix the request. |
429 | A rate limit was reached. | Wait for Retry-After. |
5xx | Vesta could not answer. | Retry with increasing, jittered delays. |
Rotate or revoke
Section titled “Rotate or revoke”On API access, each integration’s menu offers Rotate secret and Revoke access. Last used shows when the integration last received a token.
- Rotate secret shows a new secret once. The old secret and every token issued with it stop working immediately, so update your server straight away.
- Revoke access permanently disables the integration and all its tokens, even after API access has ended.
- Support sessions, in which Vesta staff act in your portal, can revoke but cannot create or edit integrations or rotate secrets.