# Enable Auto-Topup

Automatically add funds to your wallet when the balance falls below a specified threshold. Requires that a billing method is already set in the user interface.

### <mark style="color:green;">`POST`</mark> `/wallet/auto-topup/enable`

#### Required Permission

```
create:UserAutoTopUp
```

Your API key must have this permission enabled in order to use this endpoint.

#### Example Request

```bash
curl --location 'https://<hostname>/wallet/auto-topup/enable' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
    "amount": 15,
    "threshold": 10
  }'
```

Replace `YOUR_API_KEY` with your API key.

{% hint style="info" %}
All endpoints shown in this documentation use a **sample base URL**. The production API endpoint is provided by our team upon request.
{% endhint %}

#### Query Parameters

| Parameter | Type   | Required | Description                               |
| --------- | ------ | -------- | ----------------------------------------- |
| amount    | number | Yes      | Amount to top-up automatically.           |
| threshold | number | Yes      | Minimum balance that triggers the top-up. |

#### Response (HTTP 200)

```json
{
  "success": true,
  "autoTopupEnabled": true,
  "amount": 15,
  "threshold": 10
}
```

{% hint style="info" %}
**Auto-topup** requires a valid billing method set in the user interface.
{% endhint %}
