Skip to main content
POST
Call this endpoint once per scraper. It returns the ID of the saved settings, such as ash_lz3k9qw1, not the settings themselves.
Auto Self-Healing settings are created once and cannot be changed through the AI Flow API. A second call for the same scraper returns HTTP 409, and there is no endpoint to read, update, delete or disable them. Edit or turn off Auto Self-Healing in the Auto Self-Healing tab of Bright Data Scraper Studio. See Scraper Studio Auto Self-Healing.
Four rules decide whether a request is accepted:
  • Send collector, enabled, sr_threshold and trigger_frequency on every request. Add min_inputs_threshold when trigger_frequency is per_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_emails must belong to a user on the scraper’s account.
Set 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

Authorization
string
header
required

Use your Bright Data API Key as a Bearer token in the Authorization header.

How to authenticate:

  1. Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
  2. Include the API Key in the Authorization header of your requests
  3. Format: Authorization: Bearer YOUR_API_KEY

Example:

Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication

Body

application/json
collector
string
required

ID of the Scraper Studio scraper to configure, in the c_ format. Required.

Example:

"c_abc123"

enabled
boolean
required

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.

Example:

true

sr_threshold
integer
required

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.

Required range: 1 <= x <= 70
Example:

50

trigger_frequency
enum<string>
required

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.

Available options:
per_day,
per_job
Example:

"per_day"

min_inputs_threshold
integer | null
default:10

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.

Required range: x >= 10
Example:

100

auto_save
boolean
default:false

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.

Example:

true

cooldown_period
integer | null
default:3

Minimum hours to wait between consecutive Auto Self-Healing triggers for the scraper, 1 or higher. Send null for no cooldown. Defaults to 3.

Required range: x >= 1
Example:

5

max_jobs_per_day
integer | null
default:8

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.

Required range: 1 <= x <= 24
Example:

3

notification_emails
string[]

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.

Example:

Response

Auto Self-Healing settings saved

id
string

ID of the saved Auto Self-Healing settings.

Example:

"ash_lz3k9qw1"