Documentation

Templates

Get a template

GET/templates/{id}

One template: its saved version as Markdown, with a {{Label}} token wherever a placeholder is blank, and the placeholder inventory a form or a field mapping is drawn from, each entry with the key to send and the label to show.

Parameters

NameTypeDescription
idrequireduuidThe template's id.

Request

curl https://usepaperclerk.com/api/v1/templates/4d1f0c2e-7b3a-4c1e-9d2f-1a2b3c4d5e6f \
  -H "Authorization: Bearer pc_YOUR_TOKEN"

Response

JSON
{
  "id": "4d1f0c2e-7b3a-4c1e-9d2f-1a2b3c4d5e6f",
  "title": "Consulting invoice",
  "markdown": "# Consulting invoice\n\nInvoice {{Invoice number}} for {{Client name}} …",
  "html": "<div class=\"doc-page\" …>…</div>",
  "html_truncated": false,
  "placeholders": [
    {
      "label": "Client name",
      "key": "client_name",
      "count": 2,
      "value": "",
      "type": "text",
      "description": "The client's legal name, not the contact person."
    },
    {
      "label": "Payment terms",
      "key": "payment_terms",
      "count": 1,
      "value": "Net 30",
      "type": "select",
      "options": [
        "Net 15",
        "Net 30",
        "Due on receipt"
      ]
    },
    {
      "label": "Due date",
      "key": "due_date",
      "count": 1,
      "value": "",
      "type": "date",
      "format": "08/27/2026"
    },
    {
      "label": "Invoice number",
      "key": "invoice_number",
      "count": 1,
      "value": "",
      "type": "counter",
      "auto": true,
      "format": "INV-0001",
      "start": 1
    },
    {
      "label": "Issue date",
      "key": "issue_date",
      "count": 1,
      "value": "",
      "type": "today",
      "auto": true,
      "format": "August 27, 2026"
    }
  ],
  "groups": [
    {
      "label": "Line items",
      "key": "line_items",
      "fields": [
        {
          "label": "Item",
          "key": "item",
          "type": "text"
        },
        {
          "label": "Quantity",
          "key": "quantity",
          "type": "number",
          "format": "1,234"
        },
        {
          "label": "Amount",
          "key": "amount",
          "type": "number",
          "format": "1,234.56"
        }
      ]
    }
  ],
  "generation_count": 12,
  "updated_at": "2026-09-10T09:14:03.201Z"
}
  • markdown — The saved version. A blank placeholder appears as {{Label}}.
  • html — A paper-true HTML preview of the saved version; html_truncated says whether it was cut for size.
  • placeholders — Top-level placeholders, one entry per placeholder: key (what values is keyed by), label (the human name), count (how many places it fills), value (the default), type (text, select, number, date, today or counter), and where set options, format, description, auto and start.
  • groups — Repeating groups: key, label and fields, where fields lists exactly the keys an instance object may carry, each with the same shape as a placeholder plus a default.
  • generation_count — How many documents have been generated from it.