HTTP Transport Contracts

API Reference

Comprehensive specification of all endpoints, request payloads, response bodies, and error conditions.

Endpoints Overview

MethodEndpointAuth ScopeRate LimitDescription
POST/api/auth/signupPublic10 req / 15mRegister account, receive session cookie and JWT
POST/api/auth/loginPublic10 req / 15mVerify credentials and issue session cookie
GET/api/auth/meBearer / CookieNoneReturns active authenticated user record
POST/api/auth/logoutPublicNoneClears HTTP-only session cookie
GET/api/usersAdmin OnlyNoneReturns list of registered team members
POST/api/auth/signup

Creates a new member account, hashes password with bcryptjs, and sets an HTTP-only session cookie.

Request Body (application/json)
json
{
  "name": "Jane Developer",
  "email": "jane@example.com",
  "password": "SecurePassword123!"
}
Response (201 Created)
json
{
  "user": {
    "id": "6735e076b4a2c1b827e8d531",
    "name": "Jane Developer",
    "email": "jane@example.com",
    "role": "member"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
GET/api/users

Protected administrative route that lists registered members. Returns HTTP 403 Forbidden if current role is not admin.

Request Headers
bash
GET /api/users HTTP/1.1
Host: localhost:5000
Authorization: Bearer 
X-Requested-With: mern-client
Response (200 OK)
json
[
  {
    "_id": "6735e076b4a2c1b827e8d531",
    "name": "Jane Developer",
    "email": "jane@example.com",
    "role": "member",
    "createdAt": "2026-11-14T10:00:00.000Z"
  },
  {
    "_id": "6735e076b4a2c1b827e8d532",
    "name": "Lead Admin",
    "email": "admin@example.com",
    "role": "admin",
    "createdAt": "2026-11-13T09:00:00.000Z"
  }
]