---
title: "Create a template"
method: POST
path: "/v1/documents/templates"
tags: ["Documents"]
---

# Create a template

`POST /v1/documents/templates`

Create a new template.

## Request body

- DocumentTemplateData
  - `name` string, required — The template name
  - `slug` string, required — The template slug
  - `template` string, required — The template content
  - `active` boolean — disable template flag.
  - `description` string — The template description
  - `metadata` object — The template metadata
  - `options` object — The template rendering options
  - `related_object` 'shipment' | 'order' | 'other' — The template related object

## Response `201`

- DocumentTemplate
  - `id` string — A unique identifier
  - `name` string, required — The template name
  - `slug` string, required — The template slug
  - `template` string, required — The template content
  - `active` boolean — disable template flag.
  - `description` string — The template description
  - `metadata` object — The template metadata
  - `options` object — The template rendering options
  - `related_object` 'shipment' | 'order' | 'other' — The template related object
  - `object_type` string — Specifies the object type

## Other responses

- `400`
- `500`

---

[API](https://skmtc.dev/karrio/apis/karrio-api.md) · [All operations](https://skmtc.dev/karrio/apis/karrio-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/karrio/karrio-api/revisions/76ab3b7c3a61/schema)
