curl --request POST \
--url https://api.brightdata.com/dca/auto_self_healing/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collector": "c_abc123",
"enabled": true,
"sr_threshold": 50,
"trigger_frequency": "per_day"
}
'{
"id": "ash_lz3k9qw1"
}{
"validation_errors": [
"Collector must be active"
]
}"collector_not_found"Enable Auto Self-Healing
Use the Bright Data Scraper Studio AI Flow API to enable Auto Self-Healing on a scraper and set its success rate, frequency, cooldown and daily job limits.
curl --request POST \
--url https://api.brightdata.com/dca/auto_self_healing/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collector": "c_abc123",
"enabled": true,
"sr_threshold": 50,
"trigger_frequency": "per_day"
}
'{
"id": "ash_lz3k9qw1"
}{
"validation_errors": [
"Collector must be active"
]
}"collector_not_found"ash_lz3k9qw1, not the settings themselves.
- Send
collector,enabled,sr_thresholdandtrigger_frequencyon every request. Addmin_inputs_thresholdwhentrigger_frequencyisper_job. - Send whole numbers. Decimals are rejected.
- The scraper must be active. An inactive one returns HTTP 400 with
Collector must be active. - Every address in
notification_emailsmust belong to a user on the scraper’s account.
notification_emails when auto_save is false. The healing job runs but does not save its code, and the notification email is the only way a person sees the suggested fix.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
ID of the Scraper Studio scraper to configure, in the c_ format. Required.
"c_abc123"
true turns Auto Self-Healing on for the scraper, false saves the settings with Auto Self-Healing off. Required. Send false here to keep it off, because this endpoint cannot be called a second time to disable it later.
true
Success rate percentage below which Auto Self-Healing triggers, from 1 to 70. At 50, a healing job can start once the scraper's success rate falls below 50 percent. Required, with no default. Decimals are rejected.
1 <= x <= 7050
How often Scraper Studio checks the trigger rules. per_day checks once per day. per_job checks on every job run. Required. Any other value returns HTTP 400.
per_day, per_job "per_day"
Minimum number of job inputs required before Auto Self-Healing triggers, 10 or higher. A job with fewer inputs does not start a healing job. Required with trigger_frequency: per_job. Optional with per_day, which does not use it: the server stores 10 when the field is omitted, and null is accepted.
x >= 10100
When true, any successful healing job saves the newly extracted code to production and updates the scraper's template version, with no human review. When false, the healing job runs but the generated code is not saved. Defaults to false.
true
Minimum hours to wait between consecutive Auto Self-Healing triggers for the scraper, 1 or higher. Send null for no cooldown. Defaults to 3.
x >= 15
Maximum number of Auto Self-Healing jobs allowed for the scraper in one day, from 1 to 24. Send null for no daily limit. Defaults to 8. A failed healing job still counts toward this limit and still starts the cooldown period.
1 <= x <= 243
Email addresses that receive the Auto Self-Healing notifications for this scraper. Each address must belong to a user on the collector's account. Defaults to an empty array, which leaves nobody to review a fix when auto_save is false.
["data-team@example.com"]
Response
Auto Self-Healing settings saved
ID of the saved Auto Self-Healing settings.
"ash_lz3k9qw1"
Was this page helpful?