{
  "name": "Respectable Mobility demo API",
  "site": "respectablemobility.com",
  "note": "Demo only. Requests are stored in Postgres and queued (jobs table, FOR UPDATE SKIP LOCKED worker). Nothing is sent. Never contacts emergency services: call 112 / 911.",
  "endpoints": [
    {
      "method": "GET",
      "path": "/api/health",
      "returns": "{ok, db, env, queue}"
    },
    {
      "method": "GET",
      "path": "/api/categories",
      "returns": "the four categories"
    },
    {
      "method": "POST",
      "path": "/api/requests",
      "body": {
        "category": "connectivity|wearables|wheelchairs|care-homes",
        "name": "string",
        "contact": "email",
        "message": "string?",
        "for_whom": "me|parents?",
        "topic": "string?"
      },
      "returns": "{id, status:'queued'}"
    },
    {
      "method": "POST",
      "path": "/api/fall-help",
      "body": {
        "name": "string?",
        "contact": "email?",
        "hurt": "yes|no|unsure?",
        "message": "string?"
      },
      "returns": "{id, status:'queued', emergency:'Call 112 / 911'}"
    },
    {
      "method": "POST",
      "path": "/api/auth/signup",
      "body": {
        "email": "string",
        "password": "string (8+)",
        "role": "person|parent|orders"
      },
      "returns": "{user, redirect} + session cookie"
    },
    {
      "method": "POST",
      "path": "/api/auth/login",
      "body": {
        "email": "string",
        "password": "string"
      },
      "returns": "{user, redirect} + session cookie"
    },
    {
      "method": "POST",
      "path": "/api/auth/logout",
      "returns": "{ok}"
    },
    {
      "method": "GET",
      "path": "/api/me",
      "returns": "{user} or 401"
    },
    {
      "method": "POST",
      "path": "/api/chat",
      "body": {
        "messages": "[{role:'user'|'assistant', content:string}] (max 12 user turns, 500 chars each)",
        "message": "string (alternative to messages)"
      },
      "returns": "{reply, cards:[{id,name,category,category_name,reason}], emergency, mode:'grok'|'keyword', disclosure}",
      "notes": "Product guide for elder-care products and services. No prices, no medical diagnoses. Rate limited per IP (20 per 10 minutes)."
    }
  ],
  "roles": {
    "person": "/app/me",
    "parent": "/app/family",
    "orders": "/app/orders"
  }
}