Apilyn DocsDeveloper portal

Async jobs

Document pipelines (PDF, Office, OCR, web capture, and similar) run as async jobs. The executable curl sequence lives in the Quickstart; this page summarizes the lifecycle documented in Recipes.

Flow

  1. POST /v1/uploads — receive an upload id and presigned upload_url (not a raw storage key).
  2. PUT bytes to upload_url with the returned content headers.
  3. POST /v1/uploads/{id}/complete — intake/malware gate; status becomes ready_for_processing or rejection with a stable error.code.
  4. POST /v1/jobs with Idempotency-Key, pipeline name, and upload inputs.
  5. Poll GET /v1/jobs/{job_id} until a terminal state, or consume webhooks.
  6. Download artifacts via GET /v1/jobs/{job_id}/outputs/{alias}/download (signed URL) or the upload download route exercised in the quickstart.

Job states

Documented transitions:

queued → running → completed | failed | cancelled | expired

If no worker is running locally, jobs may remain queued; create and poll still validate API wiring (see quickstart step 7).

Idempotency

  • Idempotency-Key is required on POST /v1/jobs.
  • Same key and payload fingerprint → replay (200 with the existing job).
  • Same key with a different body → 409 with error.code=idempotency_conflict.

Sync tools (contrast)

Structured/text operations use POST /v1/tools/{tool_name} and return 200 immediately. List surfaces with GET /v1/operations?execution_mode=sync_tool|async_job. Details and examples are in Recipes.