Skip to main content
POST
Lender login
Authenticate a lender with the system and obtain an 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

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

Response

Using the Access Token

Once authenticated, include the access token as a Bearer token in the Authorization header of every subsequent API request:
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

lender
string
required

Your lender subdomain identifier, provided by ClearGrid during onboarding.

Body

application/json
email
string<email>
required

The lender email address provided by ClearGrid during onboarding.

Example:

"user@example.com"

password
string
required

The lender-specific password provided by ClearGrid. Store securely and never hardcode.

Example:

"password123"

phone
string

Optional phone number for authentication.

Example:

"+971501234567"

Response

Login successful

token
string

Access token. Include as a Bearer token in the Authorization header for all further API requests.

refreshToken
string

Refresh token. Use with the Refresh Token endpoint to obtain a new access token when the current one expires.

lenderPublicId
string

The lender's unique public identifier (UUID). Used as a path parameter in subsequent API calls.