fynepdf logo
Docs menu

Merge PDF API

Join PDFs into one, in the order given. Each file gets a bookmark with its name.

POST /v1/pdf/merge

Price: 1 credit per 100 pages (started). Takes: pdf. Makes: pdf.

The same as a one-step job with the action merge, which can be chained with other steps.

Request

curl -X POST https://api.fynepdf.com/v1/pdf/merge \
  -H "Authorization: Bearer $FYNEPDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_ids":["file_01jc8x4m2k9q7r3t5vwy6z","file_01jc8x5n7p2s4u6w8y0a1b"]}'

Body

ParameterTypeRequiredWhat it does
file_idstringThe input file.
file_idsarray of stringInput files, for actions that take several (merge, image_to_pdf).
waitintegerSeconds to wait for the result (default 30).
webhook_urlstring
metadataobjectYour own keys and values, returned on the job and in webhooks.

Response

A job: 200 when it finished within wait (30 seconds by default), 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": [
    "file_01jc8x4m2k9q7r3t5vwy6z"
  ],
  "steps": [
    {
      "action": "merge",
      "params": {}
    }
  ],
  "receipt": {
    "steps": [
      {
        "step": 1,
        "action": "merge",
        "status": "succeeded",
        "credits": 1,
        "pages_before": 14,
        "pages_after": 14,
        "bytes_before": 8700000,
        "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.