---
search:
  tags:
    - Themes
    - POST
seo:
  description: >-
    Adds a new HTML, CSS or JavaScript template to a theme. The file_name…
    Reference for the POST /themes/{theme_id}/templates endpoint in the Bolder
    API v1.
sidebar:
  label: Create template
  badge: POST
title: Create template
type: openapi-operation
---
Adds a new HTML, CSS or JavaScript template to a theme. The `file_name` extension
determines the content type (`html`, `css`, `js`). Requires `admin` scope.

`POST /themes/{theme_id}/templates`

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

- `file_name` (string, required) — File name including extension, e.g. \`about.html\`
- `body` (string, required) — Template content

Request body example:

```json
{
  "file_name": "about.html",
  "body": "<h1>About Us</h1>"
}
```

**Responses**

- `201` — Template created

Response example, 201:

```json
{
  "id": "string",
  "file_name": "string",
  "name": "string",
  "content_type": "html",
  "body": "string",
  "updated_on": "2019-08-24T14:15:22Z",
  "_links": {}
}
```
