> For the complete documentation index, see [llms.txt](https://api.senderwiz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.senderwiz.com/customer/templates/update-a-template.md).

# Update a Template

### 🔄 Update a Template

This endpoint allows you to modify the details of a template such as its name, content, or CSS preferences.

***

#### 🔹 HTTP Request

```http
PUT API-URL/templates/TEMPLATE-UNIQUE-ID
```

***

#### 🔸 URL Segments

| Segment              | Required | Description                          |
| -------------------- | -------- | ------------------------------------ |
| `TEMPLATE-UNIQUE-ID` | Yes      | Unique ID of the template to update. |

***

#### 📝 PUT Parameters

| Parameter | Type  | Required | Description                              |
| --------- | ----- | -------- | ---------------------------------------- |
| `data`    | array | Yes      | Array with the updated template details. |

> Refer to the **Create Template** documentation for full parameter definitions.

***

#### 🔐 Authorization Header

```
X-API-KEY: your-api-key-here
```

***

#### 💻 PHP Example

```php
// UPDATE A TEMPLATE
$response = $endpoint->update('TEMPLATE-UNIQUE-ID', [
    'name'          => 'My API template - updated' . $rand,
    'content'       => file_get_contents(__DIR__ . '/template-example.html'),
    //'archive'     => file_get_contents(__DIR__ . '/template-example.zip'),
    'inline_css'    => 'no', // yes|no
]);

// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
```

***

#### 📦 Sample JSON Response

```json
{
  "status": "success"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.senderwiz.com/customer/templates/update-a-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
