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

# Partially Update User

> Update only the fields you send — everything else is left unchanged.

Unlike [update user](/api-reference/users/update) (a full PUT that requires the complete body), this changes only the fields present in the request. `app_user_id` is immutable and not accepted.

### Path Parameters

<ParamField path="user_id" type="string" required>
  The user to update.
</ParamField>

### Request Body

<ParamField body="name" type="string">
  The user's display name.
</ParamField>

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

<ParamField body="username" type="string">
  The user's username.
</ParamField>

<ParamField body="phone_number" type="string">
  The user's phone number.
</ParamField>

<ParamField body="is_active" type="boolean">
  Activate or deactivate the user.
</ParamField>

### Response

The full updated user, same shape as [get user](/api-reference/users/get).

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "9a8b7c6d-...",
    "app_user_id": "user_123",
    "name": "New Name",
    "email": "alice@example.com",
    "username": "alice",
    "phone_number": "+23279000000",
    "is_active": true,
    "created_at": "2026-01-16T10:30:00Z",
    "stripe_connect_account_id": null,
    "stripe_connect_verified": false
  }
  ```

  ```json 400 theme={null}
  {
    "detail": "No fields to update"
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "User not found"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url https://hpay-api.host-sl.com/api/v1/users/9a8b7c6d-.../ \
    --header 'api-key: YOUR_API_KEY' \
    --header 'secret-key: YOUR_SECRET_KEY' \
    --header 'Content-Type: application/json' \
    --data '{ "name": "New Name" }'
  ```

  ```python Python theme={null}
  from hostpay import HostPay

  client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")

  user = client.users.patch("9a8b7c6d-...", name="New Name")
  print(user["name"])
  ```

  ```typescript TypeScript theme={null}
  import { HostPay } from "@hostpay/sdk";

  const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });

  const user = await client.users.patch("9a8b7c6d-...", { name: "New Name" });
  console.log(user.name);
  ```
</RequestExample>
