> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thanx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update User

> This endpoint updates the specified user's information.

<Note>
  The user's phone number is not gathered by Thanx with the permission to use it
  for marketing.
</Note>

<Note>
  Please review proper request headers [here](/consumer/usage/headers).
</Note>

<RequestExample>
  ```bash theme={null}
  curl https://api.thanxsandbox.com/users/:id \
    -X PATCH \
    -H "Content-Type: application/json" \
    -H "Accept-Version: v4.0" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer ${token}" \
    -H "X-ClientId: ${client_id}" \
    -d '{
      "user": {
        "email": "<email>",
        "first_name": "<first_name>",
        "last_name": "<last_name>"
      }
    }'
  ```
</RequestExample>

### Parameters

<ParamField path="id" type="string" required>
  The user's id
</ParamField>

### Body

<ParamField body="email" type="string" required>
  The user's email
</ParamField>

<ParamField body="phone" type="string">
  The user's phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164),
  with the country code prefix (e.g. `+14157582345`). Phones submitted
  without the country code prefix are stored as-is — this endpoint does
  not normalize them — and will fail later phone-based lookups (such as
  Partner Auth Token) that depend on E.164 parsing.
</ParamField>

<ParamField body="first_name" type="string" required>
  The user's first name
</ParamField>

<ParamField body="last_name" type="string" required>
  The user's last name
</ParamField>

<ParamField body="birth_date" type="hash">
  The user's birthday information

  <Expandable title="birth_date">
    <ParamField body="year" type="integer" deprecated="true">
      The user's birth year
    </ParamField>

    <ParamField body="month" type="integer">
      The user's birth month
    </ParamField>

    <ParamField body="day" type="integer">
      The user's birth day
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="zip_code" type="string">
  The user's zip code
</ParamField>

### Response

<Snippet file="entities/user.mdx" />

<ResponseExample>
  ```json Response Example theme={null}
  {
    "user": {
      "id": "wroeiu2304hfwf",
      "email": "john.smith@example.com",
      "phone": "+14158672345",
      "first_name": "Jane",
      "last_name": "Smith",
      "birth_date": {
        "year": 1987,
        "month": 8,
        "day": 14
      },
      "zip_code": "12345"
    }
  }
  ```
</ResponseExample>
