Export & import templates

Move templates from staging to production — or between any two PDFEx deployments — without copying the database.

Exports are saved as .pdfex-templates.json files containing template content, variables, sample data, custom fonts, and engine settings — but not environment-specific IDs.

In the dashboard

  1. On Templates, click the download icon on a template card to export one template, or click Export All to download every template you can see.
  2. On the target environment, click Import and select your .pdfex-templates.json file.
  3. Choose Update existing to replace templates that have the same name (recommended for production rollouts), or Create new to always add copies without overwriting.
  4. After import, open Templates and note the new template IDs — they will differ from staging. Update any integrations, webhooks, or saved template_id values accordingly. API keys are not exported; create new keys on each environment.
Import counts toward your plan's template limit. If a template is skipped, check the toast message — common reasons are duplicate names (when using Create new) or reaching your max template count.

Export file format

{
  "pdfex_export_version": 1,
  "exported_at": "2026-06-28T12:00:00.000Z",
  "templates": [
    {
      "name": "Invoice",
      "engine": "html",
      "html_template": "<html>...</html>",
      "variables": ["invoice_number", "customer_name"],
      "sample_data": { "invoice_number": "INV-001" },
      "fonts": [{ "name": "CustomFont", "data": "<base64>" }],
      "page_format": "Letter",
      "is_public": false
    }
  ]
}

REST API (same bundle format)

/api/templates/:id/export
/api/templates/import
{
  "bundle": { "pdfex_export_version": 1, "templates": [...] },
  "mode": "upsert"
}
// mode: "create" (default) or "upsert" (match by template name)
// Response: { "result": { "created": [], "updated": [], "skipped": [] } }