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.

Three things happen once, before any call

  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

    Create your API key

    As the workspace owner, mint a key in Settings. From then on every document is one HTTP call away.

One generation, start to finish

Everything below is a single session against the live API: the same generation id runs through every response, so you can read it top to bottom as one document being made.

  1. POST01

    /api/public/v1/generations

    Send the template id and your data

    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"
      }
    }'

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

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

    /api/public/v1/generations/:id

    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.

    200 OK
    {
      "id": "2f4e6a8c-1b3d-4e5f-8a9b-0c1d2e3f4a5b",
      "status": "completed"
    }
  3. GET03

    /api/public/v1/generations/:id/emails

    Follow each recipient

    When a generation opts into email, this endpoint reports delivery per recipient. The list starts empty and fills as the worker sends, so check it once the generation has completed.

    200 OK
    {
      "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
        }
      ]
    }
    • Each entry carries one delivery status: 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 Papely's own sending domain, not from yours.

What the API gives you

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.

Your designs, turned into personalized documents

  • 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.

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.

Errors
Every error uses one envelope — { error: { code, message, details? }, requestId } — and every code is a stable, machine-readable string you can branch on.
Links and retention
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.
Credentials
Create your key as the workspace owner in Settings → API credentials. The full secret is shown once, so store it somewhere safe.

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