Pull published employee schedules and time-clock punch data from When I Work via its REST API for payroll export.
domain: apidocs.wheniwork.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Request API access from When I Work as an admin-level user by emailing your company name, admin name, developer contact info, and intended use — API keys are not self-service.
Authenticate by POSTing your private developer key (W-Key header) plus a When I Work user's email/password to https://api.login.wheniwork.com/login to receive a person object containing a Bearer token.
Use the returned token as an Authorization: Bearer header (or W-Token) on subsequent calls, and set the W-UserId header to select which When I Work account you are acting as.
Call the Primary service's Users, Shifts, and time-entry/punch resources under https://api.wheniwork.com/2/ to pull scheduled shifts and clock in/out punch records for the desired pay period.
Refresh the token before it expires by POSTing the current token to https://api.login.wheniwork.com/refresh — tokens are valid 7 days and should be refreshed at least 2 days before expiration.
For ongoing syncs, subscribe to When I Work webhooks rather than repeatedly polling shift/time-entry endpoints, since frequent large pulls can hit rate limits.
Known gotchas
There is no self-serve API key generation in the dashboard — access requires a manual request/approval email exchange with When I Work before you can authenticate at all.
If a token is missing the 'iat' (issued-at) claim, you must refresh immediately rather than relying on the standard 7-day/2-day-before-expiry refresh window.
The API is split across multiple independently documented services (Primary, Login, Forecast Tools, Tasks, Tags) rather than one unified spec — schedule/punch endpoints and login/auth endpoints are on different hostnames (api.wheniwork.com vs api.login.wheniwork.com).
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?