Skip to main content
POST
Submit a job

Authorizations

Authorization
string
header
required

Your secret key as a bearer token, e.g. Authorization: Bearer sk_live_…. Secret keys are server-side only.

Body

application/json

Canonical job submission. Each entry in sources[] is a single source file plus the ordered steps[] to run on it. Step types compatible with the source's auto-detected fileType are kept; incompatible steps are recorded as skipped in the audit log. Async (201) by default; set sync: true to wait up to ~27 s for completion (200) or 202 + pending: true on timeout. An optional webhook is called when the job reaches a terminal status regardless of sync mode.

sources
any[]
required

List of source files to process. Each becomes its own Task under a single Job. steps is required on each unless ruleId, workflowId or previewWorkflow decides them.

Required array length: 1 - 50 elements
ruleId
string

Optional Rule id (rule_xxx). When present the Rule is authoritative: sources[].steps are discarded and the pipeline expands the Rule's matching accept entry once each file's type is known. A draft rule works too, so it can be tried on real files before it is published.

workflowId
string

Run the files through a workflow's intake (wf_xxx), as the storefront does for a product mapped to it: its intake rule replaces ruleId and sources[].steps. A draft workflow works too, so it can be tried before it is published.

Minimum string length: 1
previewWorkflow
object

Run the files through an unsaved workflow: the full workflow record, optionally with its rule embedded as rule (or intake.rule) instead of intake.ruleId. Both are kept for a day so the job can be read, then discarded. Use it to try a change to a workflow or rule before saving it. Validated against the workflow (and rule) schemas.

channel
enum<string>
default:api
Available options:
api,
store,
admin
customerId
string | null
orderId
string | null
policy
object
sync
boolean
default:false

When true, wait up to ~27 s for the job to reach a terminal status. Returns 200 with { job } on completion or 202 with pending: true on timeout. Default false (async 201).

webhook
any
metaData
any
context
any

Response

Sync completion (sync: true)

job
object