Start a batch job run
const url = 'https://api.justcrawl.io/api/v1/batch-jobs/start';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"source":{"definitionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"},"maxJobs":1,"waitingCaller":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.justcrawl.io/api/v1/batch-jobs/start \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "source": { "definitionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "maxJobs": 1, "waitingCaller": true }'Requires jobs:submit. Count first and show the URL count before confirming a large launch. Accepted work spends credits, may run for hours and cannot be cancelled by customers. A dataset definition uses its stored exact workflow version and requires a live owned binding (409 invalid_dataset_binding otherwise). A definition source uses its saved configuration; a sealed input source requires workflowId (null selects automatic routing) and may include discoveryPolicy. Setting discovery tags or inheritance additionally requires urls:write. Client-authored tenant, creator, trigger, version and other authority fields are rejected. maxJobs caps seed and descendant admission. Keep one 1–256-character Idempotency-Key for the invocation and the same normalized intent. Exact replay resolves before mutable source, email and quota checks and returns the same run with its current summary and replayed=true, including after completion. Fresh starts require verified email. Principal or intent key reuse returns RUN_SUBMISSION_CONFLICT (409). Acceptance returns immediately; preparing count, lane and warning fields are null until measured. For a lost response, recover with GET /batch-job-runs?submissionKey=…&entryMode=api. Zero matches means acceptance never committed; repeat the same intent with the same key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Invocation key, preserved across retries and exact recovery.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
Frozen for each run. Setting additional tags or inheritance requires urls:write; generated provenance tag prefixes are reserved.
object
Optional credit-spending admission cap for seeds and descendants; reaching it closes admission with max_jobs.
Waiting-caller hint; acceptance returns immediately without waiting for completion.
Examplegenerated
{ "source": { "definitionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "maxJobs": 1, "waitingCaller": true}Responses
Section titled “Responses”Start a batch job run.
object
object
Frozen for each run. Setting additional tags or inheritance requires urls:write; generated provenance tag prefixes are reserved.
object
object
object
Frozen for each run. Setting additional tags or inheritance requires urls:write; generated provenance tag prefixes are reserved.
object
Null until preparation measures the finite initial set. Measured zero is distinct.
object
object
object
Example
{ "entryMode": "api", "skipReason": "overlap", "definitionSnapshot": { "input": { "kind": "tags" } }, "input": { "kind": "tags" }, "phase": "preparing", "lane": "interactive", "stopReason": "credits_exhausted", "outcome": "completed", "fundingDetail": "no_plan", "partialCauses": [ "credits_exhausted" ]}Validation failed — request body or query is missing/invalid
object
Example
{ "error": "Missing or invalid \"url\" field"}Missing or invalid authentication token
object
Example
{ "error": "Missing or invalid authentication token"}Insufficient credits. A definitive refusal; do not retry automatically.
Insufficient permissions for this operation
object
Example
{ "error": "No organization. Complete onboarding first."}Resource not found
object
Example
{ "error": "Workflow not found"}Operation conflicts with current resource state
object
Example
{ "error": "Resource already exists"}The selected provider has been retired. Choose and publish a supported workflow.
The starting workflow has no eligible published version (batch_workflow_unresolved).
Unexpected server error. Logs and PostHog $exception capture
object
Example
{ "error": "Something went wrong"}