Rightwork OG Image
Browse API documentation
API docsWorkforce API v1

API conventions

Use the Workforce API to read employee records, published schedules, leave, timecards, and reports. Getting started walks through your first request.

Authentication and access

Send your integration key in the header Authorization: Bearer YOUR_INTEGRATION_KEY. Store it in your server’s secret manager. Keep it out of URLs, logs, and browser code.

The key determines the company, locations, and data you can access. Use the key for the environment Rightwork issued it for. To check access, call GET /connection (HEAD returns 405). Keys expire after 90 days. You can test a replacement key before revoking the old one.

Endpoint reference

Append the path below to https://getrightwork.dev/api/external/v1 without a trailing slash.

GET resourceRequired scopeDescription
GET /connection · Connection & accessValid integration keyCompany, permissions, key expiry, environment, and limits
GET /locations · Locationslocations:readExplicitly authorized open and closed locations
GET /employees · Employees & payroll IDsemployees:readEmployee identity, payroll mapping, authorized memberships
GET /roles · Rolesreference:readCompany-level role identifiers and names
GET /time-off-types · Time-off typesreference:readPTO, SICK, UNPAID definitions
GET /schedules · Published schedulesschedules:readAssigned published shifts, with publication history
GET /time-off-requests · Time-off requeststime_off:readLeave requests by type and status
GET /time-entries · Time entriestime_entries:readNative Rightwork timecards and paid/unpaid breaks
GET /reports/labor · Labor, sales & actual labor reportsreports_labor:readStaffing hours and costs
GET /reports/sales · Labor, sales & actual labor reportsreports_sales:readActual and base forecast Revenue, daily or quarter-hour
GET /reports/actual-labor · Labor, sales & actual labor reportsreports_actual_labor:readDaily payable hours and pay by time-entry source

Filters

Use the parameters listed on the endpoint’s page. Unknown, repeated, empty, or conflicting parameters return HTTP 400. Employee lookups accept either a Rightwork employee ID or an exact payroll ID. Preserve leading zeros and spaces in payroll IDs.

For schedules, leave, and timecards, send up to 31 days using date_from and date_to. The start date is included and the end date is excluded. For example, September 1 through 30 uses 2026-09-01 and 2026-10-01. Schedules and timecards use business dates. Leave uses local calendar dates. Reports require one approved location and allow up to seven days for 15-minute intervals.

Pagination and synchronization

  1. Request the first page with your filters. page_size defaults to 100 and can be up to 500.
  2. Collect the records in data. If meta.next_cursor has a value, send it as cursor with the same filters and page size. Each page belongs to the same snapshot.
  3. Update your destination only after every page succeeds and the final page has meta.complete: true. Match records by ID. Remove missing records only within a fully refreshed resource, date range, and set of filters with unchanged access.

Snapshots expire after 15 minutes. A change in permissions can invalidate a cursor. On HTTP 409 with snapshot_restart_required, discard the partial result and start again. If scope_revision changes, check which locations and data you can still access before removing any records.

Refresh both date ranges if a record moves, and periodically refresh older dates to catch edits. The API has no change feed or webhooks. meta.as_of gives the snapshot’s start time. Using it as a cutoff for later updates can miss changes.

Limits and errors

An integration shares 60 requests per minute across its keys and can keep four multi-page snapshots open at once. Single-page results do not use a slot. Queries can read up to 10,000 source rows and exports can contain up to 4 MiB. Supporting records count toward the row limit, so a short result can still exceed it. Check GET /connection for current limits.

StatusAction
400Correct dates, filters, page size, or narrow an oversized export
401Check that the key is active, unexpired, and valid for the environment
403Request the needed scope/location access through your administrator
409Resolve ambiguous data, or restart an expired/changed snapshot
429Wait for Retry-After. Finish open exports before starting new ones.
500Contact Rightwork with X-Request-ID
503Retry with bounded exponential backoff

Example error response

409 Conflict · An expired or invalid cursor requires a new export.

JSON
{
  "error": {
    "code": "snapshot_restart_required",
    "message": "Cursor is invalid or expired. Restart the complete export.",
    "request_id": "00000000-0000-4000-8000-000000000901"
  }
}

Use error.code to decide what to do. Include the request ID when contacting Rightwork.

Responses use Cache-Control: no-store. Do not cache them in a shared CDN.

Download the API specification

The OpenAPI specification (JSON) covers the read endpoints, including reporting. The previous specification covers the endpoints available before reporting.

Send time-off balances (pending release)

Confirm availability with Rightwork before building against this draft. This endpoint accepts balances calculated by your payroll or HR system.

Request and access

POST /api/external/v1/time-off-balances

Your integration needs time_off_balances:write, company approval for balance writes, and access to the employee’s location. The key identifies the company and integration. Send these headers:

Text
Authorization: Bearer YOUR_INTEGRATION_KEY
Content-Type: application/json
Idempotency-Key: UUID

Example payload

This example sends one employee’s PTO balance.

JSON
{
  "source": "payroll_source_ukg",
  "balances": [
    {
      "payroll_external_id": "000123",
      "bank_id": "PTO_BANK",
      "bank_name": "Paid Time Off",
      "accrual_profile_name": "PTO - Full-Time",
      "period_start": "2026-01-01",
      "period_end": "2026-12-31",
      "source_updated_at": "2026-11-09T15:00:00Z",
      "current_accrued_hours": "40",
      "current_balance_days": "0",
      "current_balance_hours": "40",
      "projected_accrued_hours": "81.85",
      "taken_hours": null,
      "projected_balance_hours": "40.92",
      "available_balance_hours": "40",
      "scheduled_hours": null
    }
  ]
}

Payload fields

Send every field in the example, even when its value is null. Extra fields cause an error. source currently supports only payroll_source_ukg.

FieldContract
payroll_external_idExact nonblank string, at most 200 characters. Preserve case, whitespace and leading zeros.
bank_idNonblank source bank identifier, at most 200 characters; identifies the balance bank.
bank_nameNonblank balance category name, at most 200 characters.
accrual_profile_nameSend a nonblank name (up to 200 characters) or null.
period_startInclusive ISO calendar date, YYYY-MM-DD.
period_endLast day of the balance period (YYYY-MM-DD), including that day. For a one-day period, use the same date for both fields.
source_updated_atISO timestamp with seconds, a UTC offset, and up to 6 fractional digits. It can be at most 5 minutes in the future.

For the eight balance amounts in the example, send a decimal string (such as "40.5") or null for an unknown amount. Use "0" for a known zero. Only current_balance_days is measured in days. All other amounts are hours.

Amounts can be negative and allow up to 10 digits before and 4 after the decimal point. Omit extra leading zeros and exponent notation. All text fields must be valid Unicode and exclude NUL characters.

Updating a balance

Rightwork matches a balance by company, employee, source, bank ID, and period dates. The payroll ID must identify exactly one existing employee in your approved locations. Changing the accrual profile updates the same balance. A different bank or period creates a separate balance.

A newer source_updated_at replaces the balance. Sending the same timestamp and values leaves it unchanged. Conflicting values at the same timestamp or an older timestamp return HTTP 409. Omitting a balance leaves it in place.

Batch limits and retries

Send 1–100 balances and up to 1 MiB of JSON per request. Use each balance identity once. Duplicate JSON keys and query parameters are rejected. If any row fails, the whole batch fails. Reads and writes share the integration’s rate limit.

Use a new UUID in Idempotency-Key for each batch. If the connection drops, retry with the same key, rows, values, and order. An exact retry returns the original counts. Reusing the key with different content returns idempotency_conflict. Keys are retained for each integration without expiry.

Success response

200 OK

JSON
{
  "data": {
    "created": 1,
    "updated": 0,
    "unchanged": 0
  },
  "meta": {
    "request_id": "00000000-0000-4000-8000-000000000901"
  }
}

The response gives the number of balances created, updated, or unchanged.

Errors

JSON
{
  "error": {
    "code": "stale_balance",
    "message": "Row 0: source timestamp is older than the stored balance.",
    "request_id": "00000000-0000-4000-8000-000000000901"
  }
}
StatusCode / handling
400invalid_balance_batch: invalid JSON, keys, fields, query parameters or idempotency header. Correct the request.
401Authentication failure. Check credential, expiry, revocation and environment.
403balance_write_not_enabled: required balance-write access is not enabled.
409employee_not_available: generic error for missing, ambiguous or unauthorized employee mapping. Resolve mapping and authorized coverage; do not match by name.
409idempotency_conflict: the key was already used for different content.
409stale_balance or balance_timestamp_conflict: resolve source ordering or conflicting values before resubmitting.
413payload_too_large: reduce batch size.
415unsupported_media_type: use application/json.
429throttled: honor Retry-After.
500internal_error: retain the request ID for support.
503temporarily_unavailable: retry with bounded backoff and the unchanged batch/key.

Keep request IDs for support. Never log API keys, payroll IDs or request bodies.