Submit a managed async job

post/jobs/v1/runs

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/jobs/v1/runs
  • Auth: HTTP bearer

Headers

Idempotency-Keystring required

Request body

job_typestring required

Whitelisted managed job type configured by run402.

max_cost_usd_microsinteger required

Hard customer charge ceiling in micro-USD.

callback_urlstring uri

Optional absolute https URL pushed once when the job reaches a terminal state (completed/failed/cancelled), so you need not poll GET /jobs/v1/runs/{job_id}. http and malformed URLs are rejected (400 invalid_job_request, code INVALID_CALLBACK_URL). Delivery is durable (at-least-once, retried, dead-lettered) and unsigned; the body is the canonical webhook envelope { id, type, created_at, schema_version, idempotency_key, payload } where type is one of job_completed/job_failed/job_cancelled and payload is { job_id, status, artifacts?, error? }. The Run402-Webhook-Id header equals the idempotency_key (<job_id>:terminal) — dedupe on it and re-fetch authoritative state via GET before acting; the callback is a trigger, not the source of truth. Submit-only; never returned on read.

Response

Idempotency hit

job_idstring required
job_typestring required
status'queued' | 'running' | 'completed' | 'failed' | 'cancelled' required
created_atstring date-time required
started_atstring date-time
completed_atstring date-time
artifactsobject

Per-artifact download references for a completed job, keyed by filename. sha256/size_bytes are omitted for legacy jobs created before per-artifact integrity capture.

Example response

{
  "job_id": "job_abc123"
}

Changes

No recorded changes to this operation across all 1 revision of this API.