Skip to content

Common

Base URL depends on deployment (e.g. http://localhost:8787 for local wrangler dev).

All /admin/* routes require POST (unless noted), Content-Type: application/json, encrypted Authorization header, JWT audience snr_dash (admin routes use snr_adm in some docs — verify route middleware).

All /app/* routes use JWT audience snr_usr.

All /pro/* routes use JWT audience snr_pro. The JWT id claim must match second_opinions.doctor_id for rows returned by POST /pro/sops.


FieldTypeMeaning
statusnumberApp status code (see below)
messagestringHuman-readable message
dataobject | arrayPresent on many success responses
paginationobjectPresent on list endpoints
metastringe.g. "warning" on auth failures
detailstringOptional; auth error detail when DEBUG=true

Typical status codes

HTTPstatus fieldMeaning
2001000Success
4001002Validation / bad input
4012000Unauthorized
4041002Resource not found (message describes)
4091002Conflict (e.g. duplicate)
5001001Server error