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

# Create a template

`POST /v1/templates`

## Request body

- TemplateCreate
  - `name` string, required
  - `subject` string, required
  - `html` string, required
  - `text_body` string
  - `artifact_id` string, nullable — Scope to an artifact; null = account-level.
  - `variables` TemplateVariable[]
    - `name` string, required — Accessed via `{{data.name}}`.
    - `type` 'string' | 'number' | 'boolean' | 'date', required
    - `required` boolean
    - `default` unknown
    - `description` string

## Response `200`

Created

- object
  - `success` boolean
  - `data` object
    - `template` Template
      - `id` string
      - `artifact_id` string, nullable
      - `owner_id` string
      - `name` string
      - `subject` string
      - `html` string
      - `text_body` string
      - `is_system` boolean
      - `created_at` integer
      - `updated_at` integer

## Other responses

- `400` — Invalid request

---

[API](https://skmtc.net/shareout/apis/shareout-rest-api.md) · [All operations](https://skmtc.net/shareout/apis/shareout-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/shareout/shareout-rest-api/revisions/804359ead65a/schema)
