Refresh access token
curl --request POST \
--url https://v3-api.cleargrid.ai/admin/auth/{lender}/refresh-token \
--header 'Content-Type: application/json' \
--data '
{
"refreshToken": "eyJhbGciOiJIUzUxMiJ9..."
}
'import requests
url = "https://v3-api.cleargrid.ai/admin/auth/{lender}/refresh-token"
payload = { "refreshToken": "eyJhbGciOiJIUzUxMiJ9..." }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({refreshToken: 'eyJhbGciOiJIUzUxMiJ9...'})
};
fetch('https://v3-api.cleargrid.ai/admin/auth/{lender}/refresh-token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"token": "<new_access_token>"
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Failed to read request",
"instance": "/api/v1/auth/{lender}/refresh-token"
}{
"code": 401,
"message": "Token Type is not refresh",
"body": null
}Authentication
Refresh Token
Refresh an expired access token using the refresh token
POST
/
admin
/
auth
/
{lender}
/
refresh-token
Refresh access token
curl --request POST \
--url https://v3-api.cleargrid.ai/admin/auth/{lender}/refresh-token \
--header 'Content-Type: application/json' \
--data '
{
"refreshToken": "eyJhbGciOiJIUzUxMiJ9..."
}
'import requests
url = "https://v3-api.cleargrid.ai/admin/auth/{lender}/refresh-token"
payload = { "refreshToken": "eyJhbGciOiJIUzUxMiJ9..." }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({refreshToken: 'eyJhbGciOiJIUzUxMiJ9...'})
};
fetch('https://v3-api.cleargrid.ai/admin/auth/{lender}/refresh-token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"token": "<new_access_token>"
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Failed to read request",
"instance": "/api/v1/auth/{lender}/refresh-token"
}{
"code": 401,
"message": "Token Type is not refresh",
"body": null
}Use the refresh token obtained from the Lender Login endpoint to obtain a new access token without re-authenticating with email and password. This enables seamless token rotation for long-running integrations.
This error occurs when you pass an access token instead of a refresh token. Make sure to use the The request body is malformed or missing required fields. Ensure the JSON body includes a valid
Request
Endpoint
POST {{base_url}}/admin/auth/{{lender}}/refresh-token
| Environment | Base URL |
|---|---|
| Production | https://v3-api.cleargrid.ai/ |
| Staging | https://stage-v3-api.cleargrid.ai/ |
Body Parameters
string
required
The refresh token obtained from the Lender Login response.
Example Request
curl -X POST https://v3-api.cleargrid.ai/admin/auth/{your_lender_id}/refresh-token \
-H "Content-Type: application/json" \
-d '{
"refreshToken": "<refresh_token>"
}'
const response = await fetch(
'https://v3-api.cleargrid.ai/admin/auth/{your_lender_id}/refresh-token',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
refreshToken: '<refresh_token>'
})
}
);
const data = await response.json();
console.log(data.token);
import requests
response = requests.post(
"https://v3-api.cleargrid.ai/admin/auth/{your_lender_id}/refresh-token",
json={
"refreshToken": "<refresh_token>"
}
)
data = response.json()
print(data["token"])
Response
- 200 — Success
- 401 — Invalid Token
- 400 — Bad Request
{
"token": "<access_token>"
}
| Field | Type | Description |
|---|---|---|
token | string | The new access token. Use this as a Bearer token in the Authorization header for all subsequent API requests. |
{
"code": 401,
"message": "Token Type is not refresh",
"body": null
}
refreshToken value from the original login response.{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Failed to read request",
"instance": "/api/v1/auth/{lender}/refresh-token",
"properties": null
}
refreshToken field.Token Refresh Flow
Implement automatic token refresh in your integration. When any API call returns a
401 response, call the refresh token endpoint and retry the failed request with the new access token.Path Parameters
Your lender subdomain identifier.
Body
application/json
The refresh token obtained from the Lender Login response.
Example:
"eyJhbGciOiJIUzUxMiJ9..."
Response
Token refreshed successfully
New access token. Use as a Bearer token in the Authorization header.