> ## 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's Communication Settings

> This endpoint allows the update of a user's notification / email settings for the specified merchant.

<Info>
  Scopes: `users.write`, `communication_settings.write`
</Info>

### Parameters

<ParamField path="id" type="string" required>
  User ID
</ParamField>

<ParamField query="merchant_id" type="string" required>
  Merchant ID
</ParamField>

<ParamField body="reward_progress" type="hash">
  Settings for when a user earns loyalty progress

  <Expandable title="reward_progress">
    <ParamField body="email" type="boolean">
      email setting
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="reward_offer" type="hash">
  Settings for when a merchant sends an offer

  <Expandable title="reward_offer">
    <ParamField body="notification" type="boolean">
      app notification setting
    </ParamField>

    <ParamField body="email" type="boolean">
      email setting
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="marketing_general" type="hash">
  Settings for when a merchant sends general marketing

  <Expandable title="marketing_general">
    <ParamField body="email" type="boolean">
      email setting
    </ParamField>
  </Expandable>
</ParamField>

### Response

<Snippet file="entities/communication-setting-partner.mdx" />

<RequestExample>
  ```bash theme={null}
  curl https://api.thanxsandbox.com/partner/users/:id/communication_settings?merchant_id=owierywtwt \
    -X PATCH \
    -H 'X-ClientId: {client_id}' \
    -H 'Accept-Version: v4.0' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {access_token}' \
    -d '{
      "communication_setting": {
        "reward_progress": {
          "email": false
        },
        "reward_offer": {
          "notification": false,
          "email": false
        },
        "marketing_general": {
          "email": false
        }
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "communication_setting": {
      "id": "weoruoisdhf",
      "merchant_id": "owierywtwt",
      "merchant_handle": "example-merchant",
      "user_id": "woerushfwe",
      "reward_progress": {
        "email": true
      },
      "reward_offer": {
        "notification": true,
        "email": true
      },
      "marketing_general": {
        "email": true
      }
    }
  }
  ```
</ResponseExample>
