---
title: "Create a template from a document"
method: POST
path: "/api/v1/templates"
tags: ["Templates"]
---

# Create a template from a document

`POST /api/v1/templates`

## Request

- Base URL: `https://www.ifillpdf.com`
- URL: `https://www.ifillpdf.com/api/v1/templates`
- Auth: HTTP bearer

Snapshots an analyzed document into a reusable template. Regular keys can create private or team templates only — public publishing is admin-only.

## Request body

- CreateTemplateRequest
  - `source_document_id` string, uuid, required
  - `name` string
  - `description` string, nullable
  - `category` string, nullable
  - `tags` string[]
  - `language` string
  - `visibility` 'private' | 'team': Public publishing is admin-only.

## Response `201`

Template created.

- TemplateEnvelope
  - `template` Template, required
    - `id` string, uuid, required
    - `name` string, required
    - `description` string, nullable
    - `category` string, nullable
    - `language` string, nullable
    - `tags` string[]
    - `visibility` 'public' | 'team' | 'private', required
    - `is_published` boolean
    - `page_count` integer
    - `preview_image_url` string, nullable
    - `created_at` string, date-time

## Other responses

- `400`: Invalid request.
- `401`: Missing or invalid API key.
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/ifillpdf/apis/ifillpdf-api.md) · [All operations](https://skmtc.dev/ifillpdf/apis/ifillpdf-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ifillpdf/apis/ifillpdf-api/revisions/17d927bde9ea?raw)
