Auth guards vary by endpoint — Create and List accept JWT users and partner keys. Delete is admin-only. The JWT ownership check happens in core, not at the route level.
Overview
An MRN (Medical Record Number) links a dependant to a benefit provider with an external string identifier. Each MRN is uniquely scoped to one(dependant_id, benefit_provider_id) pair — only one active MRN per dependant per provider is allowed.
Routes are flat at /mrns (no user nesting). The primary_user_id is derived server-side from the dependant row — callers never supply it.
Create Flow
Auth Guards by Endpoint
| Endpoint | JWT user | Partner key | Admin key | Notes |
|---|---|---|---|---|
POST /mrns | ✓ | ✓ | — | JWT: dependant must belong to token user |
GET /mrns | ✓ | ✓ | — | All filters optional |
GET /mrns/{id} | ✓ | ✓ | — | Returns 404 if inactive |
DELETE /mrns/{id} | — | — | ✓ | Sets status → inactive |
Endpoints
POST /mrns
Create an MRN linking a dependant to a benefit provider.
GET /mrns
List MRNs. Filter by
dependant_id, benefit_provider_id, primary_user_id, or mrn string.GET /mrns/{id}
Fetch a single active MRN by its internal UUID.
DELETE /mrns/{id}
Soft-delete (
status → inactive). Admin key required.Request / Response Examples
Error Codes
| Code | HTTP | Description |
|---|---|---|
MR-900 | 500 | Internal server error |
MR-901 | 404 | MRN not found or inactive |
MR-902 | 403 | JWT user accessing MRN belonging to another user’s dependant |
MR-903 | 409 | MRN already exists for this dependant + provider combination |
MR-904 | 404 | Dependant not found or inactive |
MR-905 | 404 | Benefit provider not found or inactive |
MR-906 | 400 | Invalid UUID in filter or request body |