Service API · API Docs · eKYC Platform

Log in

POST/auth/users/login

Exchanges an account username and password for the JWT access token that every other Service API endpoint requires.

Request

MethodPOST
Path/auth/users/login
Content-Typeapplication/json
Auth requiredNo

The client authenticates using user_name and password to receive a JWT access token.

NameTypeRequiredDescription
user_namestringRequiredAccount username.
passwordstringRequiredAccount password.

Response

On success the HTTP status code is 200 and the token arrives on data.access_token. Send it as Authorization: Bearer <JWT> on every other Service API call — see Authorization.

JSON
{"data":{"access_token":"<JWT>"},"message":"login success","time":"2024-10-31T07:34:52Z","verdict":"success"}

Failure codes

NameDescriptionStatus codeResponse Body
Bad RequestInvalid username pattern400{"data":{"invalid_parameters":["user_name"],"parameter_formats":{"user_name":"[regex: ^[a-z0-9_]{1,63}$]"}},"message":"some parameters has invalid format","time":"2024-11-06T03:30:42Z","verdict":"invalid_parameters"}
UnauthorizedIncorrect username or password401{"data":{},"message":"username or password is incorrect","time":"2024-10-31T07:50:22Z","verdict":"invalid_credential"}
Invalid MethodInvalid URL or method405{"data":{},"message":"method is not correct for the requested route","time":"2024-11-06T03:23:26Z","verdict":"invalid_method"}
Too many requestsToo many failed login attempts429{"data":{},"message":"too many failed login attempts","time":"2024-11-06T03:33:43Z","verdict":"limit_exceeded"}
Internal Server ErrorInternal Server Error500{"data":{},"message":"Unexpected error. Error ID: ff4d5572d9df4560bb6dabc2eadd5a1e","time":"2024-11-06T03:32:09Z","verdict":"failure"}