PATCH
/
users
/
{user_id}
cURL
curl --request PATCH \
  --url http://localhost:8080/users/{user_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "address": {
    "city": "Bengaluru",
    "country": "IN",
    "line1": "123, MG Road",
    "line2": "Flat 4B, Sunrise Apartments",
    "pincode": "560001",
    "state": "Karnataka"
  },
  "dob": "2000-01-15",
  "email": "<string>",
  "first_name": "<string>",
  "last_name": "<string>"
}
'
{
  "created_at": "2026-01-15T12:34:56",
  "last_modified_at": "2026-01-15T12:34:56",
  "phone_country_code": "<string>",
  "phone_number": "<string>",
  "user_id": "012345678901",
  "address": {
    "city": "Bengaluru",
    "country": "IN",
    "line1": "123, MG Road",
    "line2": "Flat 4B, Sunrise Apartments",
    "pincode": "560001",
    "state": "Karnataka"
  },
  "dob": "2000-01-15",
  "email": "<string>",
  "first_name": "<string>",
  "last_name": "<string>"
}

Path Parameters

user_id
string
required

User ID

Body

application/json
address
object

Structured address details for user profiles and insurance documents.

dob
string | null
Example:

"2000-01-15"

email
string | null
first_name
string | null
gender
null | enum<string>

User gender.

Available options:
MALE,
FEMALE,
OTHER
last_name
string | null

Response

User updated

created_at
string
required

User creation timestamp.

Example:

"2026-01-15T12:34:56"

last_modified_at
string
required

Last user update timestamp.

Example:

"2026-01-15T12:34:56"

phone_country_code
string
required
phone_number
string
required
status
enum<string>
required

User lifecycle status.

Available options:
ONBOARDING,
ACTIVE,
DEACTIVATED
user_id
string
required

A validated 12-digit numeric user identifier.

Every external entry point validates:

  • JSON Deserialize runs [UserId::parse] (outer whitespace trimmed, length and digit-only enforced) via #[serde(try_from = "String")].
  • DB FromSql runs [UserId::parse] on every row read.

Display / Deref<Target = str> / AsRef<str> / Into<String> are derived via derive_more — the inner String is pass-through for every read-only borrow, display, and move-out.

Example:

"012345678901"

address
object

Structured address details for user profiles and insurance documents.

dob
string | null

Date of birth as "YYYY-MM-DD".

Example:

"2000-01-15"

email
string | null
first_name
string | null
gender
null | enum<string>

User gender.

Available options:
MALE,
FEMALE,
OTHER
last_name
string | null