Skip to content

Customer API

The customer API gives your server read access to one employer’s establishments, public holidays, employees, agency workers, teams, tasks, published shifts, availability, time entries and operational labor costs. Separate write permissions allow employee creation and contact updates, draft shift creation and schedule editing, and time-entry corrections. Contract summaries are available with contracts:read; contracts:write creates, reschedules and cancels day contracts, dimona:read and dimona:write read and file their Dimona, accountancy:read returns the monthly payroll calculations an accountant books, and prestations:write pushes worked hours into the pay month. It uses OAuth 2.0 client credentials over HTTPS. The API origin is https://workforce-api.test.vesta.services.

Vesta activates API access per employer. An employer administrator opens Settings > Integrations > API access in the employer portal. While access is not active, that tab 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.

Expand Connection details on the integration and copy the Employer ID: every data URL contains it.

  • An integration belongs to the employer and reads only that employer’s data.
  • Select Edit on an integration to change its name or permissions. Renaming preserves existing tokens. Changing permissions invalidates existing tokens immediately; request a new token using the same client ID and secret.
  • An employer can have up to 25 active integrations.
  • Keep the client secret and access 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. Request one or more scopes, separated by spaces. Authenticate with HTTP Basic:

curl --request POST "https://workforce-api.test.vesta.services/oauth/customer/token" \
  --user "$VESTA_CLIENT_ID:$VESTA_CLIENT_SECRET" \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'scope=establishments:read planning:read'

Or send the credentials in the body (client_secret_post):

curl --request POST "https://workforce-api.test.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. There is no refresh token: reuse the token 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 body such as { "error": "invalid_scope" }:

ErrorStatusWhen
invalid_request400A required parameter is missing or malformed, or 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_client400The credentials are valid, but API 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 scope requires active API access. Some also require a product module.

ScopePortal permissionEndpointsAlso requires
establishments:readRead establishments/establishments, /public-holidays
employees:readRead employees/employees, /employment-statutes, /job-functions, /cost-centers
employees:writeManage employeesPOST /employees, PATCH /employees/{id}/contact-details
planning:writeEdit planning/establishments/{establishmentId}/shifts, /establishments/{establishmentId}/shifts/{id}Planning module
time-entries:writeCorrect time entries/time-entries/{id}Time registration module
contracts:readRead contracts/contracts, /contracts/{id}Contracts module
contracts:writeManage day contractsPOST /contracts, PUT and DELETE /contracts/{id}Contracts module
dimona:readRead DimonaGET /contracts/{id}/dimonaDimona module
dimona:writeFile DimonaPOST /contracts/{id}/dimonaDimona module
accountancy:readRead payroll calculations/accountancy/calculationsPayroll administration module
prestations:writePush worked hoursPOST /prestation-batches, GET /prestation-batches/{id}Payroll administration module
agency-workers:readRead agency workers/agency-workers
planning:readRead planning/teams, /tasks, /shifts, /availabilityPlanning module
time-entries:readRead time entries/time-entriesTime registration module
labor-cost:readRead labor costs/labor-costPlanning and time registration modules; also request planning:read and time-entries:read

The read endpoints below use GET under https://workforce-api.test.vesta.services/api/customer/v1/employers/{employerId} and need the header Authorization: Bearer <access_token>.

EndpointReturnsQuery
/establishmentsEstablishments with their IANA time zonelimit, cursor
/public-holidaysPublic holidays of one year and the date the employer observes each, after any replacementyear (2000 to 2100, required)
/employeesEmployees: name and active flag onlylimit, cursor
/employment-statutesAssignable employment statutesNone
/job-functionsJob functionsNone
/cost-centersCost centresNone
/agency-workersWorkers of the agencies the employer works withlimit, cursor
/teamsTeamslimit, cursor
/tasksPlanning taskslimit, cursor
/shiftsPublished shiftsfrom, to, limit, cursor
/time-entriesTime entriesfrom, to, limit, cursor
/availabilityRecorded availability per employee and dayfrom, to, limit, cursor
/labor-costPlanned and actual operational labor cost per group and periodfrom, to, groupBy, granularity
/establishments/{id}Establishment
/employees/{id}Employee
/agency-workers/{id}Agency worker
/teams/{id}Team
/tasks/{id}Task

Fetch one resource using the id returned by its list. These endpoints require the same scope as the corresponding list and return 404 for missing, archived or other-employer resources. No pagination parameters are needed.

curl "https://workforce-api.test.vesta.services/api/customer/v1/employers/$VESTA_EMPLOYER_ID/shifts?from=2026-10-01&to=2026-10-31" \
  --header "Authorization: Bearer $VESTA_ACCESS_TOKEN"

A token only works on its own employer’s URLs. The API reference lists every field.

Manage employees, contracts, planning and time

Section titled “Manage employees, contracts, planning and time”

See Manage workforce through the API for employee creation and contact updates, contract summaries, draft shifts, schedule edits and time-entry corrections.

NeedEndpoint and calculation
Planned shifts per employee and day/shifts: group by employeeId and date; sum plannedMinutes.
Availability per employee and day/availability: one item per employeeId and date, with its recorded windows.
Effectively worked hours per employee and day/time-entries: read every page, retain Completed, group by employeeId and workDate, and sum workedMinutes divided by 60.
Planned and actual labor cost per group, day or month/labor-cost: select groupBy=Statute, Team or Task, and granularity=Day or Month.

For the combined cost report, grant and request labor-cost:read planning:read time-entries:read. All three scopes are read-only and remain limited to one employer. Existing integrations do not gain new scopes automatically: edit the integration to grant the required permissions, then request a new token.

curl "https://workforce-api.test.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"

Use Statute for employment statute, Team for the planning team or Task for the planning task. The report compares planned cost with the operational cost of registered working time. It does not represent finalized payroll, an invoice or paid-out wages. The inclusive range is at most 93 days. For a complete calendar-month report, request that month’s first through last day.

Availability windows expose startTime, endTime, intent and confirmed; both times are null for an all-day window. Want means the employee wants to work, Standby means available if needed, and Unavailable means not available. A missing employee/day means unknown, not unavailable. Private notes are not returned. Follow every nextCursor; synchronize availability by the pair employeeId and date, since these rows have no record id.

For assistant access to these reports, see MCP connection.

The response contains from, to, groupBy, granularity, asOf and rows. Each row has its inclusive from/to bucket, key, name, statuteGroup, planned, actual, workedHours and actualCoverage. A null group identity means unattributed work. Month buckets are clipped to your requested dates; absent groups are not synthetic zero rows.

  • planned includes draft and published shifts. Open shifts count in assignmentCount but have no price. Assigned work counts once per employee/day/group, rather than once per shift. This differs from /shifts, which returns published shifts only. Read pricedAssignmentCount against assignmentCount, the pricing basis, and hasCrossEstablishmentAmbiguity before presenting a total. A partial projection is not a complete budget; unpriceable assignments are not free labor.
  • Planned allocationBasis makes attribution explicit: Team and Task split the whole employee-day cost proportionally by paid planned minutes, including daily premiums and forfaits. These shares are not independently calculated payroll quotes for each task. Statute grouping uses the governing worker statute.
  • actual.total is the priced operational amount in EUR. actual.estimatedTotal identifies the part based on reporting estimates. actual.pricedHours and actual.costPerHour describe priced hours, not all worked hours. actualCoverage reports pricedEntryCount, unpricedEntryCount and estimatedEntryCount; always show missing coverage and estimates alongside amounts.
  • Actuals include running registrations up to asOf. They can change as entries close or wages are corrected. Breaks are excluded; overnight work belongs to the establishment-local start date. Paid absences and final payroll settlement are excluded.
  • A null cost means unknown, never zero. Keep planned pricing basis and actual coverage visible when comparing the two; do not label an incomplete or estimated amount as an exact total.
  • from and to are required YYYY-MM-DD dates between 2000 and 2100. Both are included. A range covers at most 93 days.
  • Shifts are selected by their planned date. Time entries are selected by the local day they started at their own establishment, the day workDate reports.
  • limit is 1 to 200, default 100. A list returns { "items": [...], "nextCursor": "..." }. Send nextCursor as cursor, with the same other parameters, until nextCursor is null. A cursor is opaque and only works on the list, employer and date range that returned it.
  • Paging is not a snapshot. A record that changes while you page can be missed or returned twice; the next full read corrects it.

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

  1. Re-read the date 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 any stored id in that window that was not returned as deleted. A shift that disappears was deleted or unpublished.

Reference lists are small: re-read them in full the same way. Archived employees drop out of /employees; use isActive for everything else.

  • Employee, establishment, shift and time-entry IDs are stable UUIDs. Contract IDs are integers. Employment statute and job function IDs are integers used by employee creation.
  • In the /shifts and /time-entries lists, startsAt, endsAt and break times are local times with the establishment’s UTC offset, for example 2026-10-03T22:00:00+02:00. Fields ending in Utc are UTC.
  • The /shifts list contains published shifts only. date is the planned day. A shift that runs past midnight ends on the next day. plannedMinutes is the time that actually passes between startsAt and endsAt, minus breakMinutes: a night shift across a daylight saving change counts one hour more or less than its clock times suggest. fillType is Internal for an employee or External for an agency or external worker.
  • Time entry 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 the entry was worked on, when there is one. reviewedAtUtc is set once the employer has reviewed the entry. Cancelled entries are kept for history and do not count as worked time.
  • Shifts and time entries at a deleted establishment are left out. A reference to a deleted team, task, agency or agency worker is null, just as that record is gone from its own list. An archived employee is the exception: shifts and time entries keep their employeeId.
  • Employees contain firstName, lastName and isActive only: no national number, bank account, contact details or birth date.
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, its secret was rotated or its permissions changed, the employer lost API access, or none of the token’s scopes is still available.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.
422to is before from, a date is outside 2000 to 2100, the range exceeds 93 days, or the cursor is invalid or belongs to another list, employer or date range.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. You can revoke even after API access has ended.
  • Support sessions, in which Vesta staff act in your portal, cannot create or edit integrations or rotate secrets. They can revoke.