Skip to content

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 toScopesGuide
Read establishments, employees, planning and time entriesestablishments:read, employees:read, agency-workers:read, planning:read, time-entries:readEndpoints
Report planned and actual labor costlabor-cost:readLabor cost
Create employees, draft shifts, correct time entriesemployees:write, planning:write, time-entries:writeManage workforce
Manage day contracts and their Dimonacontracts:read, contracts:write, dimona:read, dimona:writeManage workforce
Read payroll calculations, push worked hoursaccountancy:read, prestations:writeManage workforce

The API reference lists every field of every endpoint.

  1. Ask an employer administrator to activate API access and create an integration with the scopes you need.
  2. Store the client ID, client secret and Employer ID on your server.
  3. 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 }

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.

  1. Sign in to the employer portal as an employer administrator.
  2. Open Settings > Integrations > API access and select Create integration.
  3. Enter a name and select only the permissions the software needs.
  4. 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.
  5. 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.

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" }:

ErrorStatusCause
invalid_request400A parameter is missing or malformed, or the credentials are sent both in the header and in the body.
invalid_client401Unknown client ID, wrong secret, or an integration that was revoked or whose secret was rotated.
unauthorized_client400API access is no longer active for the employer.
invalid_scope400No scope, an unknown scope, a scope the integration was not given, or a scope whose module the employer no longer has.
unsupported_grant_type400grant_type is not client_credentials.

Do not retry invalid_client or unauthorized_client automatically: they need a change in the portal.

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.

ScopeEndpointsAlso requires
establishments:readGET /establishments, /establishments/{id}, /public-holidays
employees:readGET /employees, /employees/{id}, /employment-statutes, /job-functions, /cost-centers
employees:writePOST /employees, PATCH /employees/{id}/contact-details
agency-workers:readGET /agency-workers, /agency-workers/{id}
planning:readGET /teams, /teams/{id}, /tasks, /tasks/{id}, /shifts, /availabilityPlanning module
planning:writePOST /establishments/{establishmentId}/shifts, GET and PATCH /establishments/{establishmentId}/shifts/{id}Planning module
time-entries:readGET /time-entriesTime registration module
time-entries:writeGET and PUT /time-entries/{id}Time registration module
labor-cost:readGET /labor-costPlanning and time registration modules; also request planning:read and time-entries:read
contracts:readGET /contracts, /contracts/{id}Contracts module
contracts:writePOST /contracts, PUT and DELETE /contracts/{id}Contracts module
dimona:readGET /contracts/{id}/dimonaDimona module
dimona:writePOST /contracts/{id}/dimonaDimona module
accountancy:readGET /accountancy/calculationsPayroll administration module
prestations:writePOST /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.

  • /shifts, /time-entries and /availability need from and to. /public-holidays needs year. Dates are YYYY-MM-DD between 2000 and 2100, both included, and a range covers at most 93 days.
  • Lists that accept limit and cursor return { "items": [...], "nextCursor": "..." }. limit is 1 to 200, default 100. Send nextCursor back as cursor, with the same other parameters, until nextCursor is null. A cursor only works on the list, employer and date range that returned it.
  • /employment-statutes, /job-functions and /cost-centers return a plain array without paging.
  • /{resource}/{id} returns one record by the id from its list, and 404 for 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"

There is no change feed and no modifiedSince filter. To stay in sync:

  1. Re-read the window you keep, for example the past two weeks and the coming four weeks of shifts, and page until nextCursor is null.
  2. Upsert every record by id.
  3. Only after the last page, treat a stored id in 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.

  • IDs. Employees, establishments, shifts and time entries have stable UUIDs. Contracts, employment statutes and job functions have integer IDs.
  • Times. In /shifts and /time-entries, startsAt, endsAt and break times are local times with the establishment’s UTC offset, such as 2026-10-03T22:00:00+02:00. Fields ending in Utc are UTC.
  • Shifts. /shifts contains published shifts only, selected by their planned date. A shift past midnight ends the next day. plannedMinutes is the real time between startsAt and endsAt minus breakMinutes, so a night shift across a daylight saving change counts one hour more or less. fillType is Internal for an employee and External for an agency or external worker.
  • Time entries. Selected by workDate, the local day the entry started at its establishment. status is Working, OnBreak, Completed or Cancelled. endsAt is empty while an entry is open and workedMinutes is present only when it is Completed. shiftId links the published shift, when there is one. reviewedAtUtc is set once the employer reviewed the entry. Cancelled entries do not count as worked time.
  • Availability. One item per employeeId and date, without a record id: sync by that pair. Each window has startTime, endTime (both null for a whole day), intent and confirmed. Want means the employee wants to work, Standby available if needed, Unavailable not 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 their employeeId on shifts and time entries.
  • Personal data. Employees contain firstName, lastName and isActive only: no national number, bank account, contact details or birth date.

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"
ParameterValues
from, toAt most 93 days. For a calendar month, send its first and last day.
groupByStatute (employment statute), Team or Task (planning)
granularityDay 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 in assignmentCount but have no price. Compare pricedAssignmentCount with assignmentCount, and check basis and hasCrossEstablishmentAmbiguity, before you present a total: unpriced assignments are not free labor.
  • Allocation. For Team and Task, allocationBasis states how the whole employee-day cost, premiums and forfaits included, is split by paid planned minutes. These shares are not separate payroll quotes. Statute uses the worker’s governing statute.
  • Actual. actual.total is the priced amount in EUR, and actual.estimatedTotal the part based on estimates. actual.pricedHours and actual.costPerHour cover priced hours only. actualCoverage reports pricedEntryCount, unpricedEntryCount and estimatedEntryCount: 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 null cost 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.

RequestsLimitCounted per
Token requests30 per 60 secondsIP address and client ID. With client_secret_post, all token requests from one IP address share one budget.
Data requests600 per 60 secondsEmployer, 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.

Data endpoints answer errors as problem details (application/problem+json).

StatusMeaningWhat to do
400A parameter is missing or malformed, such as from, to, year or limit.Fix the request.
401The 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.
403The token is for another employer, lacks the scope, or the employer lost the module that scope reads.Check the employer ID and scopes.
404The record is missing, archived or belongs to another employer.Re-read the list.
409The write conflicts with the record’s current state.Re-read the record, then decide.
422to 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.
429A rate limit was reached.Wait for Retry-After.
5xxVesta could not answer.Retry with increasing, jittered delays.

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.