Documentation

Get started with Pdfmote: sign up, create templates, and use the API with your X-API-Key for PDF conversion and template-based generation.

Getting started

Follow these steps to sign up, obtain an API key, create templates, and call the API from your app.

Sign up and get your API key
  1. Sign up in the Pdfmote app (or use your existing Clerk-backed account).
  2. Onboard via the app: complete onboarding to create your user record and receive an API key. The key is returned only once — store it securely (e.g. environment variable or secrets manager).
  3. Use the key in the X-API-Key header for all API calls documented below (HTML-to-PDF conversion and template-based PDF creation).

Account and key management (create key, revoke key, usage) are available in the app and use Clerk JWT; they are not covered in this API reference.

Create and manage templates

Templates are created and managed in the app (or via Clerk-authenticated endpoints). Use the visual editor to design HTML with placeholders like {{variableName}}.

  1. Create a template — Add name, optional description/category/tags, and HTML content with {{placeholders}}.
  2. Get the template key — After creation, the server returns a unique template key (UUID). Use this key when calling the API to generate PDFs from the template.
  3. Update templates — Edit name, HTML, or variables in the app; keep the same key for existing integrations.
Features you can use
  • HTML to PDF — Send raw HTML (or base64) to the API and receive a PDF or S3 metadata.
  • Template to PDF — Send your template key and variables; the API renders the template and returns a PDF or S3 URL.
  • Usage dashboard — In the app, view usage (calls used/limit), quota reset, and plan.
  • Key rotation — Request rotation via the app; use the emailed token to get a new key. Revoke your own key from the account section when needed.

API Reference

These endpoints require the X-API-Key header. Other endpoints (onboarding, account, templates CRUD) use Clerk JWT and are used from the app.

Authentication

Send your API key in the request header:

X-API-Key: your-api-key-value
POST/convert

Converts HTML (or base64-encoded HTML) to a PDF. When uploadToS3 is true, uploads the PDF to S3 and returns JSON metadata instead of the PDF bytes.

Request body

  • html — Raw HTML string to convert.
  • htmlBase64 — Base64-encoded HTML (alternative to html).
  • uploadToS3 — Optional boolean; when true, upload to S3 and return JSON.

Response

200 — application/pdf (binary) or application/json (when uploadToS3: true) with id, bucket, key, location. 400 validation error, 401 missing/invalid API key, 500 server error.

curl -X POST "https://api.pdfmote.com/convert" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Hello</h1><p>World</p>", "uploadToS3": false}' \
  --output output.pdf
POST/internal/create-pdf

Creates a PDF from a stored HTML template. Send the template key (UUID) and variables in the request body. Usage is counted toward your convert plan. Returns PDF bytes or S3 JSON when uploadToS3 is true.

Request body

  • userId — Your user ID (required).
  • key — Template key (UUID) (required).
  • variables — Object mapping variable names to values for {{placeholder}} substitution (required).
  • uploadToS3 — Optional boolean; when true, returns JSON with url, bucket, key, location.

Response

200 — application/pdf or application/json (S3). 400 validation or missing variables, 401 invalid API key, 404 template not found, 500 server error.

curl -X POST "https://api.pdfmote.com/internal/create-pdf" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "your-user-id",
    "key": "template-uuid-from-create",
    "variables": { "invoiceDate": "2025-03-05", "totalAmount": "99.00" },
    "uploadToS3": true
  }'

API Status

Systems operational