Skip to main content

Authentication

Overview

The API uses JWT (JSON Web Token) for authentication. Clients must exchange their credentials for an access token and include it in the Authorization header of all subsequent requests.

No Refresh Token

There is no refresh token endpoint in this API. When a token expires or becomes invalid, you must obtain a new one by logging in again.


Obtain Access Token

Endpoint: POST /auth/jwt/login
Content-Type: application/x-www-form-urlencoded

To obtain a token, send a POST request with the following parameters:

FieldTypeRequiredDescription
usernameStringYesYour assigned login (provided out-of-band).
passwordStringYesYour assigned password (provided out-of-band).

Example Request

curl -X POST https://<kyc_domain>/auth/jwt/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=user@example.com&password=your_secret_password"

Successful Response (200 OK)

{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI...",
"token_type": "bearer"
}
  • access_token: The JWT to use for authenticated calls.
  • token_type: Always "bearer".

Error Responses

  • 400 Bad Request:
    • LOGIN_BAD_CREDENTIALS: Wrong login/password or user is inactive.
    • LOGIN_USER_NOT_VERIFIED: User exists but is not verified.
  • 422 Unprocessable Entity: Validation errors (e.g., missing required fields).

Making Authenticated Requests

Once you have the access_token, include it in the Authorization header using the Bearer scheme for all API calls.

Header Format:

Authorization: Bearer <your_access_token>

Implementation Examples

# Example: Fetching a protected resource
curl -X GET https://<kyc_domain>/api/v1/resource \
-H "Authorization: Bearer <your_access_token>"