---
search:
  tags:
    - Templates
    - POST
seo:
  description: >-
    Create a template. Reference for the POST /templates endpoint in the
    BillionSend API.
sidebar:
  label: Create a template
  badge: POST
title: Create a template
type: openapi-operation
---
`POST /templates`

**Request body** (`application/json`, required)

- `name` (string, required)
- `subject` (string | null) — "" or null clears the subject
- `html` (string, required) — Stored as sent; the dashboard sanitizes at render
- `text` (string | null) — "" or null clears the text part
- `alias` (string | null) — Case-sensitive handle, unique per team; GET /templates/{alias} resolves it
- `from` (string | null) — Not supported: any value is a 422
- `reply_to` (string | string[] | null) — Not supported: any value is a 422
- `variables` (any[]) — Not supported: a non-empty list is a 422

Request body example:

```json
{
  "name": "string",
  "subject": "string",
  "html": "string",
  "text": "string",
  "alias": "string",
  "from": "string",
  "reply_to": "string",
  "variables": [
    null
  ]
}
```

**Responses**

- `200` — Template created. Every save through the API is live and publishes a new version, so status is always published. The dashboard editor keeps a working copy and publishes on request, with a version history.
- `401` — Missing, malformed, unknown or revoked API key
- `409` — Alias already in use
- `422` — Validation error, including from/reply\_to/variables (not supported)
- `429` — Over the rate limit (rate\_limit\_exceeded, with Retry-After)

Response example, 200:

```json
{
  "object": "template",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}
```
