401 Unauthorized when no valid session exists. The logout endpoint destroys the session, and GET /api/admin/me lets you inspect the currently authenticated user at any time.
POST /api/admin/login
Validates the provided credentials and creates a new admin session. Returns the authenticated user’s name, email, and role on success, or a422 error when credentials do not match.
The email address of the admin account. Must be a valid email format.
The plaintext password for the account.
A human-readable status message. Value is
"Login successful." on success.The authenticated user object.
| Status | Condition |
|---|---|
422 | Credentials do not match any known user. Body: {"message": "Invalid credentials."} |
POST /api/admin/logout
Destroys the current admin session. No request body is required. The endpoint always returns200 regardless of whether a session was active.
Confirmation string. Value is
"Logged out successfully.".GET /api/admin/me
Returns the user data stored in the current session. Use this endpoint to verify that a session cookie is still valid or to retrieve the logged-in user’s identity without re-authenticating.A human-readable status message. Value is
"Authenticated user loaded." on success.Session user data.
| Status | Condition |
|---|---|
401 | No active session found. Body: {"message": "Unauthorized."} |