fynepdf logo
Docs menu

Run a job

Input files through up to eight steps; each step feeds the next. Send an Idempotency-Key header so a retry never runs twice. Set wait to get the finished job in the same call.

POST /v1/jobs

Request

curl -X POST https://api.fynepdf.com/v1/jobs \
  -H "Authorization: Bearer $FYNEPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inputs":["file_01jc8x4m2k9q7r3t5vwy6z"],"steps":[{"action":"compress","params":{"target_size_bytes":5000000}},{"action":"page_numbers","params":{"position":"bottom-right"}}],"wait":30,"webhook_url":"https://example.com/hooks/fynepdf","metadata":{"order_id":"A-1042"}}'

Body

ParameterTypeRequiredWhat it does
inputsarray of stringFile ids, in order.
stepsarray of objectyes
waitintegerSeconds to wait for the job to finish before answering (0 to 60). Finished jobs answer 200; others 202.
webhook_urlstringAn https URL told when the job finishes (Standard Webhooks signatures).
metadataobjectYour own keys and values, returned on the job and in webhooks.

Response

A job: 200 when it finished within wait, 202 if it is still running; then poll it or use a webhook. The receipt says what each step did and cost, and outputs holds the result with a download link (good for an hour; the file is kept 24 hours).

{
  "object": "job",
  "id": "job_01jc9a2b3c4d5e6f7g8h9j",
  "status": "succeeded",
  "mode": "live",
  "inputs": [],
  "steps": [
    {
      "action": "compress",
      "params": {}
    }
  ],
  "receipt": {
    "steps": [
      {
        "step": 1,
        "action": "compress",
        "status": "succeeded",
        "credits": 1,
        "pages_before": null,
        "pages_after": 14,
        "bytes_before": null,
        "bytes_after": 4600000,
        "duration_ms": 4200
      }
    ],
    "credits": 1,
    "credits_quoted": 1,
    "duration_ms": 4300
  },
  "outputs": [
    {
      "object": "file",
      "id": "file_01jc9b7c8d9e0f1g2h3j4k",
      "filename": "result.pdf",
      "kind": "pdf",
      "bytes": 4600000,
      "pages": 14,
      "download_url": "https://files.fynepdf.com/…",
      "expires_at": "2026-11-02T10:30:00.000Z"
    }
  ],
  "error": null
}

Errors

Errors are problem details (RFC 9457) with a code you can branch on and a request_id for support.