REST API 401: invalid_token / Expired Access Token
The error HTTP 401 Unauthorized {"error":"invalid_token","error_description":"The access token is invalid or has expired"}
What it means
Your access token expired. Workday tokens are short-lived and your client held onto it too long without refreshing. Nothing is broken - you just need a fresh token.
Troubleshooting
- Decode the token's issue and expiry times and compare with the request time - most failures are simple expiry.
- Check that the token endpoint and tenant in the client config match the resource URL being called - IMPL tokens don't work on PROD.
- View the API client in Workday and confirm it's enabled and its scope covers the endpoint.
- If using a refresh token, check whether it's been rotated or revoked by a re-registration.
⚡ Quick fix
Get a new token from the token endpoint and replay the request.
✓ Permanent fix
Implement proactive token refresh - refresh before expiry, with a retry-once-on-401 as backstop. Alert on repeated 401s so credential rotations and client re-registrations get caught before they cause an outage.
Was this helpful?