Login
Authenticates a user and returns a JWT token to be used in the
Authorization header of subsequent requests.
| Method | POST |
| Path | /api/login |
| Authentication | None |
Request body
{
"email": "usuario@example.com",
"password": "minhasenha"
}
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | User's email. Must be a valid email address |
password | string | Yes | User'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>" }