> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/platform-service/zbc/account/modifybalancealert.md).

# ModifyBalanceAlert

## 1. API Description

This API (ModifyBalanceAlert) is used to enables or disables the balance alert for the current account, and can set the alert threshold at the same time. Once enabled, the system sends a reminder email when the purchasing power (account balance + credit) falls below the threshold.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| enabled        | Yes      | Boolean | <p>Whether to enable the balance alert.</p><p>true indicates enabled, and false indicates disabled.</p><p>Disabling only stops the reminder emails. The configured threshold is retained and can be reused directly when the alert is enabled again.</p>                                                                                                                                    |
| alertThreshold | No       | Float   | <p>Balance alert threshold.</p><p>When the purchasing power (account balance + credit) falls below this value, a reminder email is sent daily until the purchasing power rises back above the threshold.</p><p>Required when the balance alert is enabled for the first time. If not specified, the existing threshold of the account is retained.</p><p>Value range: \[0.0, 999999.99]</p> |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                                           |
| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Enable the balance alert and set the alert threshold.**

```json
POST /api/v2/zbc HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyBalanceAlert
<Common Request Params>

Request:
  {
    "enabled": true,
    "alertThreshold": 100.00
  }

Response:
  {
    "requestId": "T7B4E9C21-5A38-4D6F-B012-8E3C7A5D91B4",
    "response": {
      "requestId": "T7B4E9C21-5A38-4D6F-B012-8E3C7A5D91B4"
    }
  }
```

**2. Disable the balance alert and retain the configured threshold.**

```json
POST /api/v2/zbc HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyBalanceAlert
<Common Request Params>

Request:
  {
    "enabled": false
  }

Response:
  {
    "requestId": "TA2F6D08C-91B3-4E75-8C24-5D7F0A6B3E19",
    "response": {
      "requestId": "TA2F6D08C-91B3-4E75-8C24-5D7F0A6B3E19"
    }
  }
```

**3. Adjust only the alert threshold and keep the alert enabled.**

```json
POST /api/v2/zbc HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyBalanceAlert
<Common Request Params>

Request:
  {
    "enabled": true,
    "alertThreshold": 500.00
  }

Response:
  {
    "requestId": "TC8039E1B-4A72-4F63-9D85-2B6E1C4A87D0",
    "response": {
      "requestId": "TC8039E1B-4A72-4F63-9D85-2B6E1C4A87D0"
    }
  }
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                                   | Description                                                                                |
| ---------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------ |
| 404              | INVALID\_ACCOUNT\_NOT\_FOUND                 | The account does not exist.                                                                |
| 400              | INVALID\_BALANCE\_ALERT\_THRESHOLD\_REQUIRED | The alert threshold is not specified when the balance alert is enabled for the first time. |
