curl --request PUT \
--url https://api.brightdata.com/billing/autorecharge/dataset \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"pmethod_id": "64f0c2a1e4b0a1b2c3d4e5f6"
}
'{
"available": true,
"enabled": true,
"pmethod_id": "<string>"
}{
"error": "<string>",
"error_code": "invalid_param"
}User authentication is requiredYour API key lacks the required permissions for this action. You can change your token permissions at https://brightdata.com/cp/setting/users<string>Account & status
Set dataset auto-recharge
Use PUT /billing/autorecharge/dataset in the Bright Data Account Management API to turn dataset auto-recharge on or off and pick its payment method.
PUT
/
billing
/
autorecharge
/
dataset
curl --request PUT \
--url https://api.brightdata.com/billing/autorecharge/dataset \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"pmethod_id": "64f0c2a1e4b0a1b2c3d4e5f6"
}
'{
"available": true,
"enabled": true,
"pmethod_id": "<string>"
}{
"error": "<string>",
"error_code": "invalid_param"
}User authentication is requiredYour API key lacks the required permissions for this action. You can change your token permissions at https://brightdata.com/cp/setting/users<string>The
The response returns the new dataset auto-recharge settings:
Turning dataset auto-recharge off is always allowed, also when
HTTP 401, the permission HTTP 403 and HTTP 429 return plain text. The billing endpoints allow 1,000 requests per minute and 5,000 requests per hour.
PUT /billing/autorecharge/dataset endpoint turns dataset auto-recharge on or off on your Bright Data account, and sets the payment method it charges. The regular auto-recharge settings do not change.
Paste your API key into the authorization field. To get an API key, create an account and learn how to generate an API key.
Which API key permission does this endpoint need?
PUT /billing/autorecharge/dataset requires the billing.write.pay.settings permission. API keys with the Admin or Finance permission level have it. Without it, the endpoint returns HTTP 403 with a plain-text message. Manage API key permissions in Account settings.
How do I turn on dataset auto-recharge?
Sendenabled: true with a pmethod_id. Dataset auto-recharge takes no amount:
- Get a payment method ID where
autorecharge_supportedistruefromGET /billing/pmethods. - Send the request:
curl -X PUT "https://api.brightdata.com/billing/autorecharge/dataset" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "pmethod_id": "64f0c2a1e4b0a1b2c3d4e5f6"}'
available, enabled and pmethod_id. Dataset auto-recharge is available when regular auto-recharge is available and the account has a dataset zone. Check dataset.available in GET /billing/autorecharge.
How much does dataset auto-recharge charge?
Dataset auto-recharge charges only when a dataset snapshot build starts and the balance cannot cover the snapshot cost. The charge happens at the start of the snapshot build and is the larger of $50 and the amount the balance is short for that snapshot:| Balance short for the snapshot | Charge |
|---|---|
| $120 | $120 |
| $20 | $50 |
How do I turn off dataset auto-recharge?
Sendenabled: false and no other field:
curl -X PUT "https://api.brightdata.com/billing/autorecharge/dataset" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
available is false. Turning off dataset auto-recharge does not turn off regular auto-recharge. Sending pmethod_id with enabled: false returns invalid_param.
How does PUT update the settings?
The request body holds all the settings for the dataset section, and the request is idempotent. Sending the same body twice leaves the same settings.Which errors can this endpoint return?
HTTP 400 and thenot_eligible HTTP 403 return JSON with error and error_code:
| HTTP status | error_code | Cause |
|---|---|---|
| 400 | invalid_param | Wrong type, unknown field, pmethod_id missing with enabled: true, or sent with enabled: false |
| 400 | pmethod_not_found | No active payment method with this ID on the account |
| 400 | pmethod_not_supported | The payment method does not support auto-recharge or is not confirmed |
| 400 | payment_required | The account has no completed payment |
| 403 | not_eligible | Auto-recharge is not available for the account (available: false) and the request has enabled: true |
Related endpoints
- Get auto-recharge settings. Current regular and dataset auto-recharge settings.
- Set regular auto-recharge. Turn regular auto-recharge on or off, or change its amount.
- Get payment methods. Payment method IDs and auto-recharge support.
Authorizations
Use your Bright Data API Key as a Bearer token in the Authorization header.
How to authenticate:
- Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
- Include the API Key in the Authorization header of your requests
- Format:
Authorization: Bearer YOUR_API_KEY
Example:
Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df
Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication
Body
application/json
Response
New dataset auto-recharge settings
Was this page helpful?