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

# Create a template

`POST /api/v1/templates`

## Request

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

## Request body

- TemplateCreateBody
  - `slug` string, required: URL-safe identifier; referenced by `POST /reviews.template`.
  - `name` string, required
  - `description` string
  - `fields` TemplateField[], required
    - `name` string, required
    - `label` string, required
    - `type` 'text' | 'markdown' | 'json' | 'image' | 'video' | 'number' | 'boolean' | 'select' | 'buttons' | 'date' | 'url', required
    - `editable` boolean
    - `options` string[]: Required when `type` is `select` or `buttons`.
  - `actions` union[]: Optional. Defaults to approve/reject/request_changes.
    - union
      - string
      - ActionConfig
        - `type` 'approve' | 'reject' | 'request_changes', required
        - `label` string, required
        - `value` string, required
  - `default_priority` 'low' | 'normal' | 'high' | 'critical'
  - `enable_review_links` boolean
  - `auto_approve` boolean
  - `timeout_seconds` integer, nullable
  - `timeout_action` 'auto_approve' | 'auto_reject' | 'expire'
  - `instructions` string
  - `default_auth_level` 'public' | 'email_otp' | 'account'
  - `default_expiry_seconds` integer

## Response `201`

Created

- Template
  - `object` 'template', required
  - `id` string, required
  - `slug` string, required
  - `name` string, required
  - `description` string, nullable
  - `fields` TemplateField[], required
    - `name` string, required
    - `label` string, required
    - `type` 'text' | 'markdown' | 'json' | 'image' | 'video' | 'number' | 'boolean' | 'select' | 'buttons' | 'date' | 'url', required
    - `editable` boolean
    - `options` string[]: Required when `type` is `select` or `buttons`.
  - `actions` union[]: Either legacy string shorthand (`['approve','reject']`) or structured `ActionConfig[]`.
    - union
      - string
      - ActionConfig
        - `type` 'approve' | 'reject' | 'request_changes', required
        - `label` string, required
        - `value` string, required
  - `default_priority` 'low' | 'normal' | 'high' | 'critical'
  - `project_id` string, required
  - `status` 'draft' | 'active' | 'inactive'
  - `auto_approve` boolean
  - `enable_review_links` boolean
  - `default_auth_level` 'public' | 'email_otp' | 'account': Pre-fill auth tier for ShareViaLinkDialog (spec section 8.5).
  - `default_expiry_seconds` integer: Pre-fill link expiry in seconds (spec section 8.5). 86400 = 24h, 604800 = 7d, 2592000 = 30d.
  - `timeout_seconds` integer, nullable
  - `timeout_action` 'auto_approve' | 'auto_reject' | 'expire'
  - `instructions` string, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: 400 Bad Request. Validation failed.
- `401`: 401. Missing or invalid API key.

---

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