Lender login
curl --request POST \
--url https://v3-api.cleargrid.ai/admin/auth/{lender}/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"password": "password123"
}
'import requests
url = "https://v3-api.cleargrid.ai/admin/auth/{lender}/login"
payload = {
"email": "user@example.com",
"password": "password123"
}
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({email: 'user@example.com', password: 'password123'})
};
fetch('https://v3-api.cleargrid.ai/admin/auth/{lender}/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"token": "<access_token>",
"refreshToken": "<refresh_token>",
"lenderPublicId": "<lender_uuid>"
}{
"error": "Incorrect username or password."
}Authentication
Lender Login
Authenticate with the ClearGrid API and obtain an access token
POST
/
admin
/
auth
/
{lender}
/
login
Lender login
curl --request POST \
--url https://v3-api.cleargrid.ai/admin/auth/{lender}/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"password": "password123"
}
'import requests
url = "https://v3-api.cleargrid.ai/admin/auth/{lender}/login"
payload = {
"email": "user@example.com",
"password": "password123"
}
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({email: 'user@example.com', password: 'password123'})
};
fetch('https://v3-api.cleargrid.ai/admin/auth/{lender}/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"token": "<access_token>",
"refreshToken": "<refresh_token>",
"lenderPublicId": "<lender_uuid>"
}{
"error": "Incorrect username or password."
}Authenticate a lender with the system and obtain an
This response indicates that the provided email or password is incorrect. Verify your credentials and try again.An unexpected server error occurred. If this persists, contact ClearGrid support.
auth_token for subsequent API calls. The login endpoint returns both an access token (used for all API requests) and a refresh token (used to obtain a new access token when the current one expires).
Request
Your lender identifier and credentials are provided by ClearGrid during onboarding. Store the password securely — it should never be exposed in client-side code or version control.
Endpoint
POST {{base_url}}/admin/auth/{{lender}}/login
| Environment | Base URL |
|---|---|
| Production | https://v3-api.cleargrid.ai/ |
| Staging | https://stage-v3-api.cleargrid.ai/ |
Body Parameters
string
required
The lender email address provided by ClearGrid during onboarding.
string
required
The lender-specific password provided by ClearGrid. This should be stored securely and never hardcoded.
Example Request
curl -X POST https://v3-api.cleargrid.ai/admin/auth/{your_lender_id}/login \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepassword"
}'
const response = await fetch(
'https://v3-api.cleargrid.ai/admin/auth/{your_lender_id}/login',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: 'user@example.com',
password: 'securepassword'
})
}
);
const data = await response.json();
console.log(data.token);
import requests
response = requests.post(
"https://v3-api.cleargrid.ai/admin/auth/{your_lender_id}/login",
json={
"email": "user@example.com",
"password": "securepassword"
}
)
data = response.json()
print(data["token"])
Response
- 200 — Success
- 401 — Unauthorized
- 500 — Server Error
{
"lenderPublicId": "<lender_uuid>",
"token": "<access_token>",
"refreshToken": "<refresh_token>"
}
| Field | Type | Description |
|---|---|---|
lenderPublicId | string | The lender’s unique public identifier (UUID). Used as a path parameter in subsequent API calls. |
token | string | The access token. Include this as a Bearer token in the Authorization header for all further API requests. |
refreshToken | string | The refresh token. Use this with the Refresh Token endpoint to obtain a new access token when the current one expires. |
{
"error": "Incorrect username or password."
}
{
"error": "Something went wrong. Please try again later."
}
Using the Access Token
Once authenticated, include the access token as a Bearer token in theAuthorization header of every subsequent API request:
curl -X POST https://v3-api.cleargrid.ai/admin/v3/lenders/{lenderPublicId}/accounts \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{ ... }'
Access tokens expire after a set period. When a token expires, use the Refresh Token endpoint to obtain a new one without requiring the user to re-enter credentials.
Security Best Practices
- Store credentials securely — Use environment variables or a secrets manager. Never hardcode passwords in source code.
- Rotate tokens — Use the refresh token flow to keep sessions alive without storing long-lived credentials.
- Use HTTPS only — All API communication must use HTTPS. Plain HTTP requests will be rejected.
- Limit credential access — Restrict who on your team has access to lender API credentials.
Path Parameters
Your lender subdomain identifier, provided by ClearGrid during onboarding.
Body
application/json
The lender email address provided by ClearGrid during onboarding.
Example:
"user@example.com"
The lender-specific password provided by ClearGrid. Store securely and never hardcode.
Example:
"password123"
Optional phone number for authentication.
Example:
"+971501234567"
Response
Login successful
Access token. Include as a Bearer token in the Authorization header for all further API requests.
Refresh token. Use with the Refresh Token endpoint to obtain a new access token when the current one expires.
The lender's unique public identifier (UUID). Used as a path parameter in subsequent API calls.