Papely
Developer API

Generate PDFs from your own templates, with one REST call

Turn a PDF you already have into a reusable template, then fill it with your data over a REST API. Every call returns a generation you poll to completion — and can optionally email the finished PDF to your recipient, with per-recipient delivery status you read back over the API.

Start free — the API is available on every plan, including Free.

How it works

From your PDF to a finished document in three steps

  1. 01

    Upload your PDF template

    Bring a PDF you already use — an invoice, a certificate, a contract. It becomes a reusable template; there is no HTML or CSS to rebuild.

  2. 02

    Map your fields visually

    In the editor, place the fields you want to fill: text, date, image, and QR fields, positioned exactly where they belong on the page. Each field gets a key you send from your code.

  3. 03

    Generate over the API

    Send the template id and your data to the REST API. You get back a generation you poll until it is ready, then download the finished PDF — or let Papely email it for you.

Capabilities

Everything you need to generate documents at scale

  • Your existing PDF templates

    Generate from the PDFs you already have — no template rebuild and no markup. What you designed is what renders.

  • Visual field mapping

    Place text, date, image, and QR fields on the page in the editor; each becomes a named key your requests fill.

  • Single and batch generation

    Generate one document per request, or up to 100 in a single batch call — the same endpoints for polling and download either way.

  • Built-in email delivery

    Opt in per request and Papely emails the finished PDF to your recipient once it is generated — no separate mail service to wire up.

  • Generation and delivery tracking

    Poll a generation to completion, and — when email is enabled — read each recipient’s delivery status back over the API.

Use cases

Built for the documents you send every day

  • Invoices & receipts

    Generate a branded invoice or receipt per order and email it to the customer the moment it is ready.

  • Certificates

    Issue completion or attendance certificates in bulk, each personalized from your data.

  • Customer reports

    Turn per-customer data into a polished PDF report, on a schedule or on demand.

  • Quotes & contracts

    Produce quotes and contracts from a fixed layout, filled with each deal’s details.

The API

One call to generate, poll, and deliver

The request

Send your template id and data to the generate endpoint. Copy your own template id and image reference from Settings; the values below are placeholders.

curl -X POST 'https://papely.app/api/public/v1/generations' \
  -H 'Authorization: Bearer papely_sk_your_secret_here' \
  -H 'Content-Type: application/json' \
  -d '{
  "templateId": "YOUR_TEMPLATE_ID",
  "data": {
    "invoice_number": "INV-2026-0042",
    "issue_date": "2026-07-17",
    "payment_qr": "https://papely.app/pay/INV-2026-0042",
    "logo": "YOUR_IMAGE_REFERENCE",
    "line_items": [
      [
        "Consulting",
        "€1,200.00"
      ],
      [
        "Hosting",
        "€49.00"
      ]
    ],
    "email": "[email protected]",
    "name": "Ada Lovelace"
  },
  "email": {
    "subject": "Your invoice, {{name}}",
    "message": "Hi {{name}}, your invoice is attached. Download it with the button below.",
    "buttonText": "Download PDF"
  }
}'

202 Accepted — you get a generation id

Generation is asynchronous: the call returns immediately with an id, not a finished file.

{
  "generationId": "2f4e6a8c-1b3d-4e5f-8a9b-0c1d2e3f4a5b"
}

Poll the status until it is completed

Request the status endpoint every few seconds until the status is completed (or failed), then download the document.

{
  "id": "2f4e6a8c-1b3d-4e5f-8a9b-0c1d2e3f4a5b",
  "status": "completed"
}

Track email delivery per recipient

When a generation opts into email, poll this endpoint to follow each recipient. The list starts empty and fills as the worker sends, so check it once the generation has completed. Each entry carries a delivery status — one of pending, sent, delivered, bounced, or failed. Downloaded is not a status: it is derived from a non-null downloadedAt, set when the recipient opens the download link. A send failure surfaces on the entry only — it never fails the generation and never moves your quota. Emails are sent from a fixed address, [email protected], not from your own domain.

{
  "id": "2f4e6a8c-1b3d-4e5f-8a9b-0c1d2e3f4a5b",
  "emailEnabled": true,
  "emails": [
    {
      "email": "[email protected]",
      "name": "Ada Lovelace",
      "status": "delivered",
      "sentAt": "2026-07-17T09:00:05.000Z",
      "deliveredAt": "2026-07-17T09:00:07.000Z",
      "downloadedAt": "2026-07-17T09:15:00.000Z",
      "error": null
    }
  ]
}
For developers

Designed to integrate cleanly

Authentication, every endpoint, the rate limits, and the full field contract live in the API reference. This page is the overview; the reference is the detail.

Every error uses one envelope — { error: { code, message, details? }, requestId } — and every code is a stable, machine-readable string you can branch on.

Two things worth knowing up front: each download link is freshly signed and expires after one hour, so fetch the bytes soon after you request it; and generated PDFs are kept for a plan-dependent window before a scheduled cleanup removes them.

Create your key as the workspace owner in Settings → API credentials. The full secret is shown once, so store it somewhere safe.

FAQ

Frequently asked questions

Start generating PDFs today

Create an account, add your first template, and make your first API call.

Start free — the API is available on every plan, including Free.

PDF Generation & Email API – Create and Send PDFs | Papely