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

# Update User

> Update a widget user's details.

## Description

Updates a widget user's details. This is a partial update. Only the fields you send are changed, and today `email` is the only updatable field.

Use this when a user changes the email tied to their account. The new email becomes the recipient for OTP verification codes in the widget, so any code requested after the update is sent to the new address.

## Configuration

### Header Parameters

<ParamField required header="apikey" type="string">
  Your ZBD project API key.
</ParamField>

<ParamField initialValue="application/json" header="Content-Type" type="string">
  Content Type
</ParamField>

### Path Parameters

<ParamField required path="user_id" type="string">
  The ZBD user ID returned by Create User.
</ParamField>

### Body Parameters

<ParamField body="email" type="string">
  The user's new email address. Used for OTP verification in the widget.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.zbdpay.com/api/v1/widget/users/4ac4fd8a-cc2c-4d03-af09-a76f4e89d652 \
    -H "apikey: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "email": "new-email@example.com"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Cashout user updated successfully.",
    "data": {
      "id": "4ac4fd8a-cc2c-4d03-af09-a76f4e89d652",
      "reference_id": "player-42",
      "email": "new-email@example.com"
    },
    "error": null
  }
  ```
</ResponseExample>
