Immutable rows — dependant fields are never updated in place. Every change produces a new row (
status = active); the old row becomes status = discarded. Follow previous_version_id links to walk version history.Overview
A dependant represents a family member linked to a primary user (spouse, child, parent, sibling, etc.). TheSELF dependant is a special row that mirrors the user’s own identity — it is managed automatically by the server and cannot be created or deleted via this API.
Immutability Model
When youPATCH /dependants/{id}, the server:
- Sets the old row
status → discarded - Inserts a new row with a fresh UUID and
previous_version_id = old_id - Returns the new (current) row
Auth Guards by Endpoint
| Endpoint | JWT user | Admin key | Notes |
|---|---|---|---|
POST /users/{user_id}/dependants | ✓ own only | ✓ | relationship = self not allowed |
POST /users/{user_id}/dependants/bulk | ✓ own only | ✓ | Atomic batch insert, max 50. relationship = self not allowed |
GET /users/{user_id}/dependants | ✓ own only | ✓ | Defaults to status = active |
GET /users/{user_id}/dependants/{id} | ✓ own only | ✓ | 403 if accessing another user’s |
PATCH /users/{user_id}/dependants/{id} | ✓ own only | ✓ | SELF not allowed |
DELETE /users/{user_id}/dependants/{id} | ✓ own only | ✓ | Sets status → discarded. SELF not allowed |
SELF Dependant
Every user has exactly one activerelationship = self dependant. It is created automatically on POST /users/{user_id}/complete_onboarding (which also accepts an optional salutation field) and re-versioned when PATCH /users/{user_id} changes first_name, last_name, dob, or gender. Attempting to create, update, or delete SELF via the dependants API returns 400 DE-603.
Exact-Duplicate Skip on Create
POST /users/{user_id}/dependants and POST /users/{user_id}/dependants/bulk both check, before inserting, whether an active row already exists with every field of the payload identical (relationship, salutation, first_name, last_name, date_of_birth, gender).
- Exact match found → no row is inserted. The response (still 201) carries the existing row.
- Any field differs (including
date_of_birth) → a new row is inserted.
Relationship Values
| Value | Description |
|---|---|
self | The user themselves (system-managed) |
spouse | Husband or wife |
mother | Mother |
father | Father |
child | Son or daughter |
father_in_law | Father-in-law |
mother_in_law | Mother-in-law |
sibling | Brother or sister |
Salutation Values
An optionalsalutation field is available on create, update, and response objects:
| Value | Description |
|---|---|
mr | Mr |
mrs | Mrs |
ms | Ms |
master | Master (typically for young males) |
Endpoints
POST /users/{user_id}/dependants
Add a new dependant.
relationship = self not allowed.POST /users/{user_id}/dependants/bulk
Atomically insert up to 50 dependants in one request.
relationship = self not allowed.GET /users/{user_id}/dependants
Paginated list. Defaults to
status = active. JWT users see only their own.GET /users/{user_id}/dependants/{id}
Fetch a single dependant by UUID.
PATCH /users/{user_id}/dependants/{id}
Update fields. Produces a new immutable row; old row is discarded.
DELETE /users/{user_id}/dependants/{id}
Discard a dependant (
status → discarded). SELF not allowed.Request / Response Examples
Error Codes
| Code | HTTP | Description |
|---|---|---|
DE-600 | 500 | Internal server error |
DE-601 | 404 | Dependant not found |
DE-602 | 403 | JWT user accessing another user’s dependant |
DE-603 | 400 | Operation not allowed on SELF dependant |
DE-604 | 400 | No fields provided to update |
DE-605 | 400 | Validation error |