User authorization

POST /user/login


Description

The method is used to authorize a user by email and password. Upon successful authentication, a temporary JWT access token is returned.

The token is valid for 7 days unless a different period is set for the account. The token cannot be refreshed: when it expires, log in again to get a new one. The validity period cannot be set in the request.


Request format

  • HTTP method: POST
  • URL: /user/login
  • Content type: application/json
  • Authorization: not required

Query Parameters

ParameterTypeRequiredDescription
emailstring✅User’s email address
passwordstring✅User’s password

Using the token

All API methods are called with POST; a request to an unknown path returns 405. Pass the token you receive in the token: <jwt-token> header. Instead, you can pass a permanent API token in the token field of the request body. Without a valid token, methods respond with 401 access denied.


Example Request (cURL)

curl -X POST "https://api.neuro-vision.ru/v1/user/login" -H "Content-Type: application/json" -d '{"email": "user@example.com", "password": "password"}'

Example Answers

Success (200 OK)

{
  "status": "ok",
  "token": "<jwt-token>"
}

Error (400 Bad Request)

{
  "message": "invalid schema",
  "status": "error"
}

Error (403 Forbidden)

Wrong email or password. The status field in this response is "ok", so detect the refusal by the HTTP code 403.

{
  "status": "ok",
  "message": "access denied"
}