Login
POST/auth
The Login request allows users to authenticate themselves with ANSCER FMS by providing their email address and password.
Request
- application/json
Body
required
email emailrequired
Possible values: >= 5 characters and <= 255 characters
password stringrequired
Possible values: >= 6 characters and <= 255 characters
Responses
- 200
- 400
- 403
- 500
User logged in
Response Headers
x-auth-token string
JWT token
- application/json
- Schema
- Example (from schema)
Schema
_id uuid
name string
Possible values: >= 3 characters and <= 50 characters
email email
Possible values: >= 5 characters and <= 255 characters
role string
token string
JWT token
{
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"email": "user@example.com",
"role": "string",
"token": "string"
}
Bad Request due to validation errors in the request body
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Validation failed.",
"errors": [
{
"field": "email",
"message": "Email must be a valid email address."
},
{
"field": "password",
"message": "Password must be 6 characters or longer."
}
]
}
{
"message": "Validation failed.",
"errors": [
{
"field": "email",
"message": "Email must be a valid email address."
},
{
"field": "password",
"message": "Password must be 6 characters or longer."
}
]
}
Forbidden.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Access to this resource is forbidden."
}
{
"message": "Access to this resource is forbidden."
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Internal Server Error. Please try again later."
}
{
"message": "Internal Server Error. Please try again later."
}
Loading...