Skip to main content
POST
Re-run a finished pipeline job from a later step

Authorizations

Authorization
string
header
required

varg API key (varg_...). Get one at app.varg.ai or run bunx vargai login. App sessions may alternatively send a Supabase JWT.

Headers

Idempotency-Key
string

Any unique string. Retrying a request with the same key returns the existing job (HTTP 200) instead of creating and charging a new one (HTTP 202).

X-Workspace-Id
string

Folder id (uuid) or slug. The job's output is filed into this folder when the job completes. An unknown folder returns 404 workspace_not_found and no job is created. If you cannot set headers, send a top-level workspace_id field in the JSON body instead. Not part of the generation input, so it does not affect caching.

Path Parameters

id
string
required
Pattern: ^job_

Body

application/json
step
string
required

Key of the pipeline step to run again. Must come after the first step.

Minimum string length: 1
Example:

"extend"

overrides
object

Input fields to change for the new job, for example an edited prompt. Cannot change model.

Response

Idempotency replay — the existing job for this Idempotency-Key (no new charge).

id
string
required
Example:

"job_a1b2c3d4e5f6"

status
enum<string>
required

The status only moves forward: queued → running → completed, failed or cancelled. Everything a running job goes through — sending to the provider, uploading references, switching to another provider — is a stage of running; a job never goes back to queued. (Older API builds also reported submitting; treat it as running.)

awaiting_confirmation (multi-step pipelines only): the job finished a step that asks for review and waits for POST /jobs/{id}/confirm. It is not terminal.

Available options:
queued,
running,
awaiting_confirmation,
completed,
failed,
cancelled
stage
enum<string> | null
required

What the job is doing right now. null once the job is terminal, and while the job is awaiting_confirmation.

  • queued — waiting for a slot; no attempt yet
  • submitting — being sent to the provider
  • uploading_references — the provider is taking the reference files into its asset library (progress_message shows n/m)
  • rendering — the provider accepted the task and is generating
  • retrying — an attempt failed (the provider refused, failed or rate limited it); the job waits for its next attempt, usually on another provider. See attempts.
  • finalizing — the result is being saved and billed
Available options:
queued,
submitting,
uploading_references,
rendering,
retrying,
finalizing,
null
attempts
object[]
required

Every provider tried for this job, oldest first. provider / provider_model are the newest one.

tool
string
required

Internal tool id (e.g. tool_2001a2b3c4d5 for video), not the tool_key. Do not compare it against GET /tools keys.

Example:

"tool_2001a2b3c4d5"

input
object
required

The request body as submitted (model, prompt, ...)

output
object | null
required

Canonical output envelope. Present only when the job is completed.

error
string | null
required

Human-readable failure message. null unless the job failed or was cancelled.

progress_message
string | null
required
Example:

"stitching 3/8 (40%)"

progress
number | null
required

Fraction 0..1

progress_metadata
object | null
required
step_state
object | null
required

Multi-step pipeline jobs only: the current step and each step's status, intermediate output and cost. null for ordinary jobs.

estimated_duration_ms
integer | null
required
estimated_cost_cents
integer | null
required
actual_cost_cents
integer | null
required
pricing
object
required

Structured pricing. 1 credit = 1 cent = $0.01.

provider
string | null
required
Example:

"fal"

provider_model
string | null
required
Example:

"fal:flux_schnell"

provider_status
string | null
required

The provider's raw status string

provider_job_id
string | null
required
completed_by_provider_model_id
string | null
required

Provider model route that completed the job

last_attempt_provider_model_id
string | null
required

Provider model route of the most recent attempt

workspace_id
string | null
required

Folder the outputs are filed into (see X-Workspace-Id)

created_at
string<date-time>
required
started_at
string<date-time> | null
required
completed_at
string<date-time> | null
required
warnings
string[]

Present on creation responses when the request was adjusted (for example a resolution fallback)

urls
object

Lifecycle URLs (present on creation responses)