What you can do with the Jobs API
Enqueue several ScoutAPI primitives as one async job. ScoutAPI runs them in order and returns results via poll or an optional signed webhook. Use stop_if to skip the rest of the job when an early check fails (for example restock: stop when Add to cart is not visible). Re-run the same job from your cron.
- Multiple requests in one job (screenshot, extract, visibility, inspect, …)
- stop_if on a step: early exit with stopped_early (still completed, not failed)
- Optional signed webhooks when the job finishes
- Poll status and results via GET /v1/jobs/:id
Smoke check like monitoring jobs: change selector and visible, then run.
Not run yet
Assert: p visible=true on example.com
Endpoints & parameters
Pick an endpoint for a sample request and a clear list of parameters.
POST /v1/jobs
Enqueue a batch job; credits = sum of nested requests.
Example request
{
"webhook_url": "https://hooks.shop.example/restock",
"requests": [
{
"type": "visibility",
"body": {
"url": "https://shop.example/p/trail-runner",
"selector": "button.add-to-cart"
},
"stop_if": {
"visible": false
}
},
{
"type": "extract",
"body": {
"url": "https://shop.example/p/trail-runner",
"fields": [
{
"name": "price",
"selector": ".price"
}
]
}
},
{
"type": "screenshot",
"body": {
"url": "https://shop.example/p/trail-runner",
"format": "jpeg",
"mode": "viewport"
}
}
]
}Parameters
| Name | Type | Description |
|---|---|---|
requestsreq | array | List of { type, body, stop_if? } — type: screenshot, extract, visibility, inspect, performance, journey, crawl. |
requests[].stop_if | object | Optional. Match step result (visible, exists, overall_pass, status). On match: skip remaining steps; completed + stopped_early. |
webhook_url | string | Callback URL for job result. |
webhook_secret | string | HMAC secret; otherwise key/env default. |