---
search:
  tags:
    - Themes
    - PUT
seo:
  description: >-
    Replace the body of an existing template. Reference for the PUT
    /themes/{theme_id}/templates/{id} endpoint in the Bolder API v2.
sidebar:
  label: Update a template
  badge: PUT
title: Update a template
type: openapi-operation
---
Replace the body of an existing template.

`PUT /themes/{theme_id}/templates/{id}`

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

- `body` (string) — New template source code

Request body example:

```json
{
  "body": "<html><head><title>{{ shop.name }}</title></head><body>{{ content }}</body></html>"
}
```

**Responses**

- `200` — Template updated
- `401` — Unauthorized
- `403` — Access denied
- `404` — Template not found

Response example, 200:

```json
{
  "_links": {
    "property1": {
      "href": "string",
      "templated": true,
      "method": "get",
      "title": "string",
      "type": "string"
    },
    "property2": {
      "href": "string",
      "templated": true,
      "method": "get",
      "title": "string",
      "type": "string"
    }
  },
  "id": "string",
  "file_name": "layout.html",
  "path": "string",
  "body": "string",
  "is_section": true,
  "schema": {},
  "parent_commit": "string",
  "updated_on": "2019-08-24T14:15:22Z"
}
```
