PDF4.dev
Templates
GET
/api/v1/templates/{id}

Authorization

AuthorizationRequiredBearer <token>

API key from Settings page. Keys start with p4_live_ prefix.

In: header

Path Parameters

idRequiredstring

Template ID (tmpl_xxx) or slug (e.g. monthly-invoice)

curl -X GET "https://docs.pdf4.dev/api/proxy/api/v1/templates/<string>" \
  -H "Authorization: Bearer <token>"

Template found

{
  "id": "tmpl_a1b2c3d4e5f6",
  "name": "Invoice",
  "slug": "invoice",
  "html": "string",
  "plain_text": "string",
  "pdf_format": {
    "preset": "a4",
    "width": "210mm",
    "height": "297mm",
    "margins": {
      "top": "20mm",
      "bottom": "20mm",
      "left": "15mm",
      "right": "15mm"
    },
    "background_color": "#ffffff",
    "font_family": "Inter, sans-serif",
    "font_size": "14px",
    "text_align": "left",
    "horizontal_align": "left",
    "vertical_align": "top",
    "google_fonts_url": "https://fonts.googleapis.com/css2?family=Roboto&display=swap",
    "color": "#333333",
    "line_height": "1.5",
    "component_gap": "5mm",
    "footer_position": "after-content"
  },
  "sample_data": {},
  "header_component_id": "string",
  "footer_component_id": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}