문서

템플릿

템플릿 가져오기

GET/templates/{id}

템플릿 하나: 저장된 버전의 Markdown(플레이스홀더가 비어 있는 곳마다 {{라벨}} 토큰)과 폼이나 필드 매핑을 만들 플레이스홀더 목록. 각 항목에는 보낼 키와 표시할 라벨이 있습니다.

매개변수

이름유형설명
id필수uuid템플릿의 ID.

요청

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

응답

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 — 저장된 버전. 빈 플레이스홀더는 {{라벨}}로 표시됩니다.
  • html — 저장된 버전의 종이 그대로의 HTML 미리보기. html_truncated는 크기 때문에 잘렸는지를 나타냅니다.
  • placeholders — 최상위 플레이스홀더, 플레이스홀더마다 한 항목: key(values의 키), label(사람이 읽는 이름), count(채우는 위치 수), value(기본값), type(text, select, number, date, today 또는 counter), 그리고 설정된 경우 options, format, description, auto, start.
  • groups — 반복 그룹: key, label, fields. fields는 인스턴스 객체가 가질 수 있는 키를 정확히 나열하며, 각각 플레이스홀더와 같은 형태에 기본값이 더해집니다.
  • generation_count — 이 템플릿에서 생성된 문서 수.