Authentication: All endpoints require
Authorization: Bearer <access_token>.Overview
The User Profile module manages all personal details. Auth creates the baseusers row on first login — this module reads and writes the profile fields on top of that.
Updatable Fields
first_name, last_name, email, dob, gender, address, occupation, employerImmutable Fields
phone (identity, set by Auth), aadhaar (set via separate KYC flow — returns 400 if attempted via PATCH)GET /user/profile
Fetches the authenticated user’s complete profile. Theprofile_complete boolean is computed server-side on every request.
What happens server-side
- Extracts
user_idfrom JWT claims - Queries
users WHERE id = user_id - Computes
profile_complete = (first_name IS NOT NULL AND last_name IS NOT NULL) - Returns the profile with Aadhaar masked as
XXXX-XXXX-{last4}
Bearer <access_token>Permanent unique identifier for the user.
10-digit mobile number with
+91 prefix. Set by Auth — never changes.Always returned as
XXXX-XXXX-{last4}. The full Aadhaar number is never returned. Only the last 4 digits are stored in the database.true when both first_name and last_name are non-null and non-empty. Used by the app to decide whether to show the onboarding screen.Format:
YYYY-MM-DD. Null if not set. Used for insurance premium age-loading calculation.One of
MALE, FEMALE, OTHER. Null if not set. See enum values below.One of the
OccupationType values. Null if not set. See full list below.PATCH /user/profile
Partially updates the user’s profile. Only the fields included in the request body are updated — all other fields remain unchanged.What happens server-side
- Extracts
user_idfrom JWT claims - Validates all provided fields against their respective constraints
- Checks that no immutable fields (
phone,aadhaar) are included — returns400if so - Applies a partial SQL
UPDATE(only non-null fields from the request body) - Recomputes
profile_complete - Returns the full updated profile
profile_complete Transition
When this PATCH sets bothfirst_name and last_name for the first time (transitioning profile_complete from false to true), the app should:
- Dismiss the onboarding screen
- Persist the
profile_complete: truestate locally - Navigate to the home screen
Field Validation Rules
| Field | Type | Constraints |
|---|---|---|
first_name | string | Max 100 chars; trimmed whitespace |
last_name | string | Max 100 chars; trimmed whitespace |
email | string | Valid RFC 5322 format; max 255 chars |
dob | string | YYYY-MM-DD; must be strictly in the past; age 18–100 years |
gender | string (enum) | MALE | FEMALE | OTHER |
address | string | Max 500 chars; free text |
occupation | string (enum) | See OccupationType list below |
employer | string | Max 100 chars; free text |
Gender Enum Values
| Value | Notes |
|---|---|
MALE | |
FEMALE | |
OTHER | Inclusive — covers non-binary, prefer-not-to-say, and all other identities |
OccupationType Enum Values
| Value | Description |
|---|---|
Driver | Cab, auto, or bike taxi driver (Ola, Namma Yatri, Uber, Rapido) |
Delivery Partner | Package or food delivery (Swiggy, Zomato, Blinkit, Amazon, DTDC) |
Domestic Worker | House cleaner, cook, nanny, or care assistant |
Construction Worker | Daily-wage labourer on construction sites |
Factory Worker | Manufacturing or industrial floor worker |
Healthcare Worker | Nursing aide, ASHA/ANM worker, hospital support staff |
Retail Worker | Kirana, mall, or shop employee |
Security Guard | Building, campus, or premises security |
Other | Any gig or informal work not listed above |
PII Policy
Aadhaar Masking Logic
| PII Field | Stored As | Returned As | Rationale |
|---|---|---|---|
| Aadhaar number | Last 4 digits only (aadhaar_last4) | XXXX-XXXX-1234 | Minimises PII footprint; avoids DPDP Act compliance overhead for full national ID storage |
| Phone | +91XXXXXXXXXX | As stored | Primary identity anchor |
| Plaintext | As stored | Low-sensitivity; used for notifications | |
| Name | Plaintext | As stored | Required for insurance |
| DOB | DATE column | YYYY-MM-DD string | Sensitive but necessary for age-rated insurance |