Replace a schedule
Full replacement: send the complete schedule, as on creation. The next run is recomputed from now; a disabled schedule has no next run.
/v1/async/schedules/{schedule_id}Request
https://api.scrapercompany.com/v1/async/schedules/{schedule_id}Authenticate with your API key in the x-api-key header (see Authentication).
Parameters
- schedule_idstringpathrequired
Body
JSON object. Unknown fields are rejected with 422.
- itemsarray of object | nullmin items 1, max items 500
One to 500 operations. Each keeps its own method, path, body, query and label. Omit when submitting a single operation at the top level.
Show 7 child fieldsHide child fields
- items[].operationstring | nullmax length 200
Operation id (
google_calendar) orMETHOD /path(POST /v1/calendar). Get the list fromGET /v1/async/operations. - items[].methodstring | nullmax length 10
HTTP method for a
pathitem. Defaults toPOST. - items[].pathstring | nullmax length 200
Route path for a
pathitem, for example/v1/calendar. - items[].urlstring | nullmax length 2048
Shorthand for the generic scrape endpoint: this URL is fetched as a
/v1/scrapejob. Other item fields inbodyare passed through. - items[].bodyobject
The operation's JSON request body, exactly as the synchronous endpoint takes it.
- items[].queryobject
Query-string parameters, for a GET operation.
- items[].labelstring | nullmax length 200
Optional customer label returned with this item.
- operationstring | nullmax length 200
Single-job shorthand: operation id or
METHOD /path. - methodstring | nullmax length 10
Single-job shorthand: HTTP method for
path. - pathstring | nullmax length 200
Single-job shorthand: route path such as
/v1/calendar. - urlstring | nullmax length 2048
Single-job shorthand for the generic scrape endpoint.
- bodyobject
Single-job shorthand: the operation's JSON body.
- queryobject
Single-job shorthand: query-string parameters.
- labelstring | nullmax length 200
Single-job shorthand: label returned with the item.
- priorityintegerdefault
5min 0, max 9Queue priority from 0 (lowest) to 9 (highest). FIFO is preserved among jobs with the same priority.
- callback_urlstring | nullmax length 2048
Optional public HTTPS endpoint. A signed
async_job.completedevent is POSTed after the job reaches a terminal state. Verifyx-scrapercompany-signature(HMAC-SHA256 ofx-scrapercompany-timestamp+.+ the raw body) with the enabled HTTPS webhook secret for this URL, or withGET /v1/async/callback-secretwhen the URL is not an enabled registered webhook. For 24 hours after rotating the account secret the header lists both HMACs, comma-separated. Dedupe onx-scrapercompany-delivery. - callbackobject | null
ScraperAPI-style webhook callback object. An alternative to
callback_url.Show 2 child fieldsHide child fields
- callback.typestringdefault
webhookCallback transport.
webhookis the only supported value. - callback.urlstringrequiredmax length 2048
Public HTTPS endpoint that receives the signed completion event.
- destination_idstring | nullmax length 80
Saved S3/GCS destination (
POST /v1/async/destinations) to upload the finished job to. Delivery is independent of the scrape outcome. - metaobject
Caller metadata echoed unchanged in status responses and webhooks. Maximum 8 KB.
- max_creditsinteger | nullmin 0
Stop starting items once this many credits are spent or reserved. An item starts only when credits already spent, plus the listed price of items in flight, plus this item's listed price, fit under the limit. The listed price is the synchronous route cost; the charge is never higher. Items that do not fit are cancelled.
- include_resultsbooleandefault
falseWhen true, the completion webhook includes item response bodies if they fit in 256 KB. Otherwise the webhook is a summary plus
results_url. Polling follows its owninclude_resultsquery parameter. - namestringrequiredmin length 1, max length 80
Display name, unique per account.
- cadencestringdefault
dailyHow often to run.
hourlyis the fastest;manualcreates a schedule that onlyPOST .../runstarts. Missed slots are skipped, not replayed.One of
hourlyevery_6htwice_dailydailyweeklymanual - run_hourintegerdefault
0min 0, max 23Hour of the day in
timezonefordaily/weekly; ignored by interval cadences. - weekdayintegerdefault
0min 0, max 6Day for
weekly: 0 = Monday, 6 = Sunday. - timezonestringdefault
UTCmax length 64IANA timezone for
run_hour/weekday(America/New_York). Interval cadences advance from the previous run in UTC. - enabledbooleandefault
truePause a schedule (false) without deleting it.
Example request
curl -X PUT "https://api.scrapercompany.com/v1/async/schedules/asyncsched_0123456789abcdef0123456789abcdef" \
-H "x-api-key: $SCRAPERCOMPANY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cadence": "daily",
"destination_id": "asyncdst_0123456789abcdef0123456789abcdef",
"items": [
{
"body": {
"currency": "USD",
"days": 90,
"market": "US",
"token": "ChUIoben2Mv6-CYaCi9tLzA3czVwbjQQAQ"
},
"operation": "google_calendar"
}
],
"meta": {
"batch": "nightly"
},
"name": "nightly-comp-set",
"run_hour": 6,
"timezone": "America/New_York"
}'Response
200 — The schedule and its next/last run state.
{
"id": "asyncsched_0123456789abcdef0123456789abcdef",
"name": "nightly-comp-set",
"enabled": true,
"cadence": "daily",
"run_hour": 6,
"weekday": 0,
"timezone": "America/New_York",
"destination_id": "asyncdst_0123456789abcdef0123456789abcdef",
"next_run_at": "2026-10-23T10:00:00Z",
"last_run_at": "2026-10-22T10:00:00Z",
"last_job_id": "asyncjob_0123456789abcdef0123456789abcdef",
"created_at": "2026-10-20T09:00:00Z",
"updated_at": "2026-10-22T10:00:01Z",
"items": [
{
"operation": "google_calendar",
"body": {
"token": "ChUIoben2Mv6-CYaCi9tLzA3czVwbjQQAQ",
"days": 90,
"currency": "USD",
"market": "US"
}
}
],
"priority": 5,
"max_credits": 100,
"meta": {
"batch": "nightly"
},
"include_results": false,
"items_total": 1
}Errors
Errors return a JSON body with a detail field. Failed requests are not charged. See Errors for the full list and retry advice.
| Status | Meaning | Retry? |
|---|---|---|
401Unauthorized | Missing or invalid API key. {"detail":"missing or invalid API key"} | No, fix the request |
404Not Found | The property, stay, job or record was not found. {"detail":"job not found"} | No, fix the request |
422Unprocessable Content | Request validation failed. {"detail":[{"loc":["body","name"],"msg":"Field required","type":"missing"}]} | No, fix the request |
429Too Many Requests | Too many requests: the key's requests-per-minute limit was exceeded, or (in {"detail":"rate limit 60/min exceeded"} | Yes, with backoff |
503Service Unavailable | Temporarily unavailable: a dependency of this endpoint is down, or the upstream source changed its contract. Retry later. {"detail":"database unavailable: OperationalError"} | Yes, with backoff |
Try it
Async jobs, destinations, schedules and the callback secret are not changed from the docs; call this with your own key.
- Export your key:
export SCRAPERCOMPANY_API_KEY=sk_...(no key yet? start a free trial). - Copy the cURL example above and run it in a terminal.
Questions about this page?
Send the page link and your question, and the team will answer.