Skip to main content

Login

Authenticates a user and returns a JWT token to be used in the Authorization header of subsequent requests.

MethodPOST
Path/api/login
AuthenticationNone

Request body

{
"email": "usuario@example.com",
"password": "minhasenha"
}
FieldTypeRequiredDescription
emailstringYesUser's email. Must be a valid email address
passwordstringYesUser's password

Responses

200 OK — valid credentials.

The response body contains, among other fields, the JWT token to be used as the Bearer token in subsequent requests.

{
"expires_in": 1788542432,
"permissions": [],
"refresh_token": "",
"token": "",
"token_type": "Bearer",
"user_id": "",
"user_permission": ""
}

400 Bad Request — invalid body (missing field or malformed email):

{ "error": "Dados inválidos" }

4xx/5xx — error returned by the authentication process (status code and body passed through as received):

{ "error": "<reason>" }