Skip to main content

Endpoint

POST /api/auth/register
Create a new user account in the library management system. No authentication required.

Request body

email
string
required
User’s email address. Must be a valid email format.
password
string
required
User’s password. Must be at least 8 characters long.
firstName
string
required
User’s first name. Must be between 2 and 50 characters and contain only letters, spaces, dots, hyphens, and apostrophes.
lastName
string
required
User’s last name. Must be between 2 and 50 characters and contain only letters, spaces, dots, hyphens, and apostrophes.

Response

success
boolean
Indicates whether the request was successful.
timestamp
string
ISO 8601 timestamp of when the response was generated.
message
string
Success message indicating the user was registered successfully.

Example request

curl -X POST http://localhost:8080/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123",
    "firstName": "John",
    "lastName": "Doe"
  }'

Example response

{
  "success": true,
  "timestamp": "2026-03-03T10:30:00Z",
  "message": "User registered successfully. Please login."
}

Build docs developers (and LLMs) love