Skip to main content
POST
Start a batch
inputs is the list: one object of the skill’s inputs per run, 1 to 10,000 of them. Every input is checked before anything starts. One bad input refuses the list with 422, each problem named by its position, and nothing runs. The answer comes at once (202) with the batch, as Get a batch shows it. Poll its poll_url. Each input is an ordinary run and is charged like one. Check the price first with Estimate a batch. Send an Idempotency-Key so a retry does not start a second list. See Idempotency. What batches are: Run one skill over many inputs. Needs skills:invoke. MCP tool: run_skill_batch.

Authorizations

Authorization
string
header
required

API key with the vd_sk_ prefix, as Authorization: Bearer vd_sk_.... Create keys in Settings → API Keys.

Headers

Idempotency-Key
string

Any unique string (such as your order id). Resending the same request with the same key within 24 hours returns the first answer (with Idempotent-Replayed: true) and does nothing twice; the same key with a different request is a 422 idempotency_key_reused.

Required string length: 1 - 255

Path Parameters

slug
string
required

Body

application/json

Body of POST /v1/skills/{slug}/batches (and of its /estimate).

inputs
any[]
required

The list: one object of the skill's inputs per run, e.g. [{"query": "shoes"}, {"query": "hats"}]. 1 to 10,000. Every one is checked before anything starts.

Required array length: 1 - 10000 elements
max_results_per_input
integer | null

At most this many rows from each input's run. Omit for the skill's saved default.

Required range: 1 <= x <= 500
concurrency
integer | null

How many inputs run at once. Capped at your account's limit for this skill; default half of it, so your other runs are not kept waiting.

Required range: 1 <= x <= 100
webhook_url
string | null

https URL that receives the finished batch as a signed POST (X-Valendata-Signature), the same object GET /v1/batches/{batch_id} returns.

label
string | null

A short name for the list.

Maximum string length: 200
allow_partial
boolean
default:false

Start even when your balance covers under half the estimate: inputs run until the credits run out, then the rest are not_started.

Response

Successful Response

batch_id
string
required
status
enum<string>
required

queued, running, then completed (every input ended), cancelled, out_of_credits (the rest were not started) or failed.

Available options:
queued,
running,
completed,
cancelled,
out_of_credits,
failed
skill_id
string
required
skill_slug
string
required
total
integer
required

Inputs in the list.

done
integer
required

Inputs that ended, whichever way.

rows
integer
required

Rows collected so far, across every input.

counts
BatchCounts · object
required

Inputs by status.

credits_used
number
required

Credits charged so far by the list's runs.

estimated_credits
number
required

The estimate when it started.

credits_per_input
number
required

The per-input price the estimate used.

concurrency
integer
required

How many inputs run at once.

poll_url
string
required
rows_url
string
required
csv_url
string
required
status_url
string
required
read-only

Where to read it — the same URL as poll_url (kept as an alias): every long job's answer names its URL status_url.

label
string
default:""
max_results_per_input
integer | null
stop_reason
string | null

Why it stopped early, in plain words.

cancel_requested
boolean
default:false
created_at
string<date-time> | null
started_at
string<date-time> | null
ended_at
string<date-time> | null
idempotent_replay
boolean
default:false

An Idempotency-Key matched a batch you already started; this is that batch.