All endpoints are relative to the base URL: /api
Endpoints that require authentication use JWT (JSON Web Token) in the Authorization
header.
Error responses follow standard HTTP status codes. Details of error responses are included in each endpoint's description.
URL: /users/login
Method: POST
Description: Authenticate a user to obtain a JWT token.
Request Body:
jsonCopy code
{
"email": "[email protected]",
"password": "password"
}
Success Response:
Code: 200 OK
Content:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
Error Responses:
{ "error": "Invalid credentials" }
{ "error": "Missing email or password" }
URL: /users
Method: POST
Description: Register a new user.
Request Body:
{
"name": "John Doe",
"email": "[email protected]",
"password": "password"
}