Open Webmail
Developer & API·4 min read

REST API overview & auth

Authenticate against Zinq Mail HTTP endpoints, handle Zod validation errors, and monitor server health.

Authentication & cookies

Webmail and settings endpoints authenticate via the HttpOnly zinq_session JWT cookie issued by POST /api/auth/login. Every request is scoped strictly to the authenticated user_id and org_id.

Sign in
curl -c cookies.txt -X POST https://zinqmail.com/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"alex@yourcompany.com","password":"your-password"}'

Healthcheck & error format

GET/api/health
Public

Verifies SQLite connectivity and returns server health status.

{ "status": "ok", "db": "connected" }
Validation errors
All write endpoints validate input with Zod and return HTTP 400 with { error, fieldErrors } when fields fail validation.