---
title: "Workday OAuth Refresh Token Endpoint & Basic Auth Guide"
description: "Send a POST request to /ccx/oauth2/<tenant>/token with HTTP Basic Auth and grant_type=refresh_token, plus exact fixes for invalid_client and invalid_grant."
url: https://kiweely.com/guides/workday-oauth-refresh-token-post-basic-auth-endpoint
---

# How to Call the Workday OAuth Refresh Token Endpoint with Basic Auth

Workday exchanges a refresh token for a Bearer access token via POST to your tenant Token Endpoint using application/x-www-form-urlencoded and HTTP Basic Authentication. This guide gives the exact request format, API client setup tasks, and error fixes.

-   **Checked** against Workday on December 5
-   Applies to **Workday Extend**
-   6 min read
-   Published December 5
-   By Kiweely

To exchange a Workday OAuth 2.0 refresh token for a new Bearer access token, send an HTTP `POST` request to your tenant’s Token Endpoint (`https://<host>/ccx/oauth2/<tenant>/token`) with `Content-Type: application/x-www-form-urlencoded` and an `Authorization: Basic <base64(client_id:client_secret)>` header. Pass `grant_type=refresh_token` and the `refresh_token` parameter in the URL-encoded request body, never as JSON.

## Exact HTTP Request and Response Format

Workday’s tenant Token Endpoint follows RFC 6749 Section 6 for refresh token grants. Every request requires three pieces: the tenant-specific URL, the `Authorization: Basic` header containing Base64-encoded client credentials, and a form-encoded body with two fields.

http

```
POST /ccx/oauth2/your_tenant/token HTTP/1.1
Host: wd2-impl-services1.workday.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic <base64(client_id:client_secret)>
```

Send these two keys in the `application/x-www-form-urlencoded` body:

| Form Field | Required Value |
| --- | --- |
| `grant_type` | `refresh_token` |
| `refresh_token` | The refresh credential issued by Workday for this API client and user |

### Building the Basic Authentication Header

Concatenate your Client ID and Client Secret with a single colon and no spaces:

text

```
client_id:client_secret
```

Encode that exact string in Base64 without a trailing newline. In a shell script, use `printf` rather than `echo`, because `echo` appends a newline character that corrupts the secret and triggers `invalid_client`:

bash

```
AUTH_HEADER=$(printf '%s:%s' "$WORKDAY_CLIENT_ID" "$WORKDAY_CLIENT_SECRET" | base64 | tr -d '\n')
```

Then send the `POST` request with `--data-urlencode` so special characters inside the refresh credential are safely encoded (reading the refresh value from standard input with `@-` keeps it out of shell history and process listings):

bash

```
printf '%s' "$WORKDAY_REFRESH_TOKEN" | curl --request POST \
  "https://wd2-impl-services1.workday.com/ccx/oauth2/your_tenant/token" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --header "Authorization: Basic ${AUTH_HEADER}" \
  --data-urlencode "grant_type=refresh_token" \
  --data-urlencode "refresh_token@-"
```

In Node.js, `URLSearchParams` sets the `application/x-www-form-urlencoded` body automatically:

js

```
const basic = Buffer.from(`${clientId}:${clientSecret}`).toString("base64");
const body = new URLSearchParams([
  ["grant_type", "refresh_token"],
  ["refresh_token", refreshToken],
]);
const response = await fetch("https://wd2-impl-services1.workday.com/ccx/oauth2/your_tenant/token", {
  method: "POST",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded",
    Authorization: `Basic ${basic}`,
  },
  body,
});
```

### Expected `200 OK` Response

When the client credentials and refresh credential are valid, Workday returns HTTP `200 OK` with a JSON payload containing the Bearer access credential.

json

```
{
  "access_token": "28tyw9mpe7huyyah7gftg4djg",
  "refresh_token": "1fndsc9ezoe4s4rbwrzzobgzw7l3os123o0qn1wckmf7zfv5o9v9r5l7cdra51e1",
  "token_type": "Bearer"
}
```

Pass the returned `access_token` on subsequent Workday REST API calls as `Authorization: Bearer <access_token>`. For user-delegated OAuth clients, Workday rotates the `refresh_token` on each exchange, so store the new value when one is returned. For integration clients configured with non-expiring refresh tokens, the stored refresh token continues to mint new access tokens until an administrator regenerates or revokes it. See [Managing Workday OAuth Refresh Token Expiration, Rotation, and Revocation](https://kiweely.com/guides/workday-oauth-refresh-token-expiration-rotation-revocation) for how rotation and fixed timeouts behave across both client types.

## HTTP Basic Auth vs. Body Credentials (and Tenant vs. Extend URLs)

Workday API clients authenticate with `client_id` and `client_secret`, and where you place those credentials determines whether the token endpoint accepts the request.

| Client Setup | Token Endpoint Host | Client Authentication | Body Parameters |
| --- | --- | --- | --- |
| Tenant API Client for Integrations (`Register API Client for Integrations`) | `https://<host>/ccx/oauth2/<tenant>/token` | `Authorization: Basic <base64(client_id:client_secret)>` | `grant_type` (`refresh_token`), `refresh_token` |
| Workday Extend Developer Site API Client | `https://auth.api.workday.com/v1/token` (or regional `api.<region>.wcp.workday.com/auth/v1/token`) | Base64 `client_id:client_secret` in `Authorization` header | `grant_type` (`refresh_token`), `client_id`, `refresh_token` |

For tenant endpoints (`/ccx/oauth2/<tenant>/token`), default to HTTP Basic Authentication in the `Authorization` header and omit `client_id` and `client_secret` from the form body. Placing client credentials only in the POST body fails on gateways and middleware configurations that enforce Basic authentication, and sending mismatched values in both places triggers `invalid_client`.

Do not mix tenant API clients with Workday Extend authorization base URLs. A client created inside a Workday tenant via **Register API Client for Integrations** only authenticates against that tenant’s `/ccx/oauth2/<tenant>/token` endpoint. Calling `auth.api.workday.com/v1/token` with a tenant Client ID returns `401 Unauthorized` or `invalid_client`.

## Setting Up the API Client and Finding Your Token Endpoint

Registering an API client and issuing its refresh token requires access to the *Integration Security* domain (Integration functional area) along with the *Set Up: Tenant Setup - Security* and *Security Administration* domains (System functional area).

1.  Run the **Register API Client for Integrations** task in Workday.
2.  Enter a unique **Client Name** and select the **Scope (Functional Areas)** that match the REST endpoints your integration calls.
3.  Choose the refresh token lifetime. Select **Non-Expiring Refresh Tokens** for unattended integrations that run continuously. If your security policy requires expiring tokens, leave that box unchecked and set **Refresh Token Timeout (in days)**. That timeout starts at initial authorization and does not reset when you exchange a refresh token.
4.  Click **OK**, then copy and store the **Client ID** and **Client Secret**. Workday does not display the Client Secret again after you leave the confirmation page.
5.  Run **View API Clients**, open the **API Clients for Integrations** tab, and locate your new client. Copy the exact **Token Endpoint** URL (`https://<host>/ccx/oauth2/<tenant>/token`) and **Workday REST API Endpoint** from the page rather than guessing the data center hostname.
6.  From the client’s related actions menu, select **API Client > Manage Refresh Tokens for Integrations**.
7.  Select the Integration System User (ISU) in the **Workday Account** field and click **OK**.
8.  Select **Generate New Refresh Token**, click **OK**, and copy the token from the **Successfully Regenerated Refresh Token** page.

Refresh tokens are bound to the specific Workday user account selected in step 7. If that ISU is deactivated or its username changes, every refresh token tied to it stops working immediately.

## Troubleshooting Workday Token Endpoint Errors

Token endpoint failures return HTTP `400 Bad Request` or `401 Unauthorized` with a JSON error payload. Match the returned `error` string to its cause below.

| HTTP Status | OAuth Error Code | Common Cause in Workday | Fix |
| --- | --- | --- | --- |
| `401` or `400` | `invalid_client` | Malformed `Authorization: Basic` header (extra space around `:`, trailing newline in Base64 input, or missing `Basic` prefix). | Re-encode `client_id:client_secret` with `printf '%s:%s'` and verify the header begins with `Basic` . |
| `401` or `400` | `invalid_client` | Client Secret was regenerated in Workday, or credentials were sent in the body instead of the `Authorization: Basic` header. | Update the stored secret from **View API Clients** (or generate a new secret) and send credentials in the `Authorization: Basic` header. |
| `401` or `400` | `invalid_client` | Tenant mismatch after a Sandbox refresh, where the URL points to one tenant while the Client ID belongs to another. | Copy the exact **Token Endpoint** from **View API Clients** in the target tenant and verify the Client ID exists there. |
| `400` | `invalid_grant` | The refresh token expired (fixed **Refresh Token Timeout** elapsed), was revoked, or was superseded by a newer token generated in **Manage Refresh Tokens for Integrations**. | Generate a new refresh token via **API Client > Manage Refresh Tokens for Integrations** (or repeat the authorization code flow for user-delegated clients). |
| `400` | `invalid_grant` | The bound ISU is locked, deactivated, has an expired password, or had its username changed. | Verify the ISU account status and security group policies in Workday, then regenerate the refresh token if the username changed. See [Troubleshooting Workday ISU Authentication Errors](https://kiweely.com/guides/workday-isu-authentication-errors). |
| `400` | `unsupported_grant_type` | `Content-Type` was set to `application/json`, `grant_type` is missing or misspelled, or the API client is not configured for the requested grant type. | Set `Content-Type: application/x-www-form-urlencoded`, send `grant_type=refresh_token` in the body, and confirm the client was registered for refresh token grants. |

## Verification Checklist Before Deploying

Before wiring a token refresh call into production middleware or a scheduled job, verify four details against your tenant:

1.  The request URL matches the **Token Endpoint** shown on **View API Clients** for that exact environment (Implementation, Sandbox, or Production).
2.  The `Authorization` header starts with `Basic` followed by single-line Base64 output of `client_id:client_secret` with no trailing newline.
3.  The request sends `Content-Type: application/x-www-form-urlencoded` and URL-encodes the `refresh_token` value.
4.  The Integration System User bound under **Manage Refresh Tokens for Integrations** is active, exempt from password expiration policies that break unattended jobs, and assigned to an activated Integration System Security Group with access to the target domains.

## Sources checked

-   [Workday Developers: Request a New Access Token with a Refresh Token](https://developer.workday.com/documentation/cqa1553122177664/RequestaNewAccessTokenwithaRefreshToken)
-   [Workday Administrator Guide: Register API Client for Integrations (Refresh Token Grant)](https://doc.workday.com/admin-guide/en-us/workday-data-cloud/data-out/workday-data-lake/register-api-client-for-data-lake--refresh-token-g.html)
-   [Workday Developers: Authenticate Using the Authorization Code Grant Type](https://developer.workday.com/documentation/yai1528997518068/AuthenticateUsingtheAuthorizationCodeGrantType)

## Related guides

[All guides](https://kiweely.com/guides)

### More guides on Integrations and APIs

[All 174 guides](https://kiweely.com/guides#integrations)

-   [Workday Configuration Migration Options: OX 2.0, Customer Central, and EIB](https://kiweely.com/guides/workday-configuration-migration-options-ox-customer-central-eib)
-   [Common Mistakes in Workday Studio Integration Development](https://kiweely.com/guides/workday-studio-integration-common-mistakes-anti-patterns)
-   [Workday Recruiting Job Multiposting and External Job Board Distribution](https://kiweely.com/guides/workday-job-multiposter-distribution-recruiting-integrations)
-   [Workday EIB Completed with Errors: Next Steps and Safe Reprocessing](https://kiweely.com/guides/workday-eib-completed-with-errors-next-steps-reprocessing)
-   [Workday Change Personal Information API: SOAP vs. REST](https://kiweely.com/guides/workday-change-personal-information-soap-rest-api)
-   [Spring Bean Annotations in Java Classes for Workday Studio](https://kiweely.com/guides/workday-studio-java-spring-bean-assembly)
-   [Person Reference Object and Phone Numbers in Workday: SOAP, EIB, and Reporting](https://kiweely.com/guides/workday-person-reference-object-phone-number)
-   [How to Make a Workday Inbound EIB Complete With Errors for Testing](https://kiweely.com/guides/workday-eib-complete-with-error-testing)

### From the blog on Integrations and APIs

[All posts](https://kiweely.com/blog)

-   [Turning Your Existing Workday RaaS Reports into Governed AI Tools](https://kiweely.com/blog/exposing-existing-workday-raas-reports-to-claude-and-chatgpt)
-   [How Workday’s Twice-Yearly Releases Break In-House MCP Servers and REST Integrations](https://kiweely.com/blog/how-workday-twice-yearly-releases-break-custom-mcp-servers)
-   [Sealed Client-Held Tokens: Running a Workday AI Connector with Zero Stored Credentials](https://kiweely.com/blog/sealed-client-held-oauth-tokens-stateless-workday-connectors)

## Build, validate, and run integrations in Workday.

Kiweely Vine builds EIBs, Studio assemblies, and connectors in your connected tenant, rehearses loads in Sandbox, and reads back every result.

[Get in touch](https://kiweely.com/vine#partners) [See Vine at work](https://kiweely.com/vine/work)

Want it built for you? [OnoeX](https://onoex.com/?utm_source=kiweely.com&utm_medium=referral&utm_campaign=cross-site&utm_content=guide-integrations) , a Workday consulting firm, delivers this with Kiweely Vine.

## Get the next guide in your inbox.

One email a month with new guides and one Extend tip. Nothing else.
