Docs / API reference

API reference 9 endpoints Session auth

Auth, bootstrap, onboarding and settings

Create business accounts or 24-hour demo sessions, load initial workspace state, complete onboarding and manage settings.

Authentication

POST /api/auth/signup Public · 201 Created

Creates a business user and private workspace and sets the 30-day session cookie. Rate-limited to prevent abuse.

FieldTypeConstraints
namestringRequired, 1 to 120 chars.
business_namestringRequired, 1 to 120 chars.
emailstringRequired, valid email, 3 to 200 chars, unique.
passwordstringRequired, 10 to 200 chars.
curl -s -c cookies.txt -X POST https://dhvani.aware.co.in/api/auth/signup \
  -H "Content-Type: application/json" \
  -d '{"name":"Riya Sharma","business_name":"Sharma Services","email":"riya@example.in","password":"strong-pass-123"}'
{"ok": true, "adopted_local_data": false}
POST /api/auth/login Public · 200 OK

Signs in with email and password and sets the 30-day session cookie. Returns 401 on invalid credentials or 429 after repeated failed attempts.

curl -s -c cookies.txt -X POST https://dhvani.aware.co.in/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"riya@example.in","password":"strong-pass-123"}'
POST /api/auth/demo Public · 200 OK

Creates an isolated 24-hour demo workspace pre-loaded with sample data and sets a 24-hour session cookie.

curl -s -c cookies.txt -X POST https://dhvani.aware.co.in/api/auth/demo
POST /api/auth/logout Public · 200 OK

Ends the active session and clears the session cookie.

GET /api/auth/me Public · 200 OK

Returns current sign-in status and workspace identity.

{
  "signed_in": true,
  "auth_required": true,
  "demo": false,
  "name": "Riya Sharma",
  "email": "riya@example.in",
  "workspace_name": "Sharma Services",
  "is_admin": false
}

Workspace bootstrap, onboarding and settings

GET /api/bootstrap Session required · 200 OK

Returns the full workspace payload for the app, including settings, agents, contacts, first 200 calls, follow-ups, integrations, knowledge notes, wallet, daily stats, 7-day volume, pricing and greeting presets.

POST /api/onboarding Session required · 200 OK

Saves first-run business details, updates the primary agent's language, tone and greeting, optionally adds an initial knowledge note, and marks onboarding complete.

FieldDefault / Validation
business_name, owner_nameRequired, 1 to 120 chars.
phoneOptional 10-digit Indian mobile/business number (+91 optional).
city, hoursOptional (max 80 chars). Hours defaults to Mon-Sat, 9:00 AM-7:00 PM.
languageOne of the 12 supported languages (default Hinglish).
tonecasual (default) or formal.
knowledge_title, knowledge_text, knowledge_sourceOptional initial business note saved across all agents when non-empty.
{"ok": true, "agent_id": "agent-front-desk"}
PUT /api/settings Session required · 200 OK

Updates business profile, call handling, notification toggles (whatsapp_updates, email_summary) and data_retention_days (1 to 3650). Calls older than the retention window are purged on save.

POST /api/demo/reset Demo workspace only · 200 OK

Restores the default sample dataset inside a demo workspace. Returns 403 for business accounts.

curl -s -b cookies.txt -X POST https://dhvani.aware.co.in/api/demo/reset