# Update Template

<brEndpoint: `PUT https://api.mailjet.com/v1/REST/templates/:id/`

You can easily update a template using this endpoint. Add new labels, modify the name, add it as a favorite and more.

### URL Parameters:

`id` = The ID of the template

### Body Parameters:

| Name | Type | Description |
|  --- | --- | --- |
| `Name` | string | Required. A unique identifier for the template. |
| `EditMode` | integer | Specifies the mode in which the template can be edited. Default value: 2. Learn more about edit modes. |
| `LabelIDs` | array of integers | Labels associated with the template. See how to retrieve a list of labels here. |
| `Purposes` | array of strings | The category or categories of the template in the UI. Accepted values: marketing, transactional, automation, and opt-in. |
| `Description` | string or null | A brief description of the template. |
| `IsStarred` | boolean | Indicates whether the template is marked as a favorite. True = favorite. |
| `IsTextPartGenerationEnabled` | boolean | Determines if text part generation functionality is enabled for this template. True = enabled |


#### Example

```
curl --request PUT \
  --url https://api.mailjet.com/v1/rest/templates/27 / \
  --header 'Authorization: Bearer 612d5125131d406081abb9cd2afdc4e3' \
  --header 'Content-Type: application/json' \
  --data '{
    "Name": "New version",
    "EditMode": 2,
    "IsStarred": false,
    "Purposes": ["marketing"],
}'
```

Status Code  `200`

### Response Data Field Structure

| Name | Type | Description |
|  --- | --- | --- |
| `ID` | integer | The ID of the template |
| `Name` | string | The name of the template. |
| `EditMode` | integer | Specifies the mode in which the template can be edited. |
| `LabelIDs` | array of integers | An array of IDs representing labels associated with the template. |
| `Purposes` | array of strings | The type of template. Learn more about template purposes |
| `ExternalID` | string or null | The ID that must be used to send the template. |
| `Description` | string or null | A brief description of the template. |
| `IsPublished` | boolean | Indicates whether the template is published. |
| `IsStarred` | boolean | Indicates whether the template is marked as a favorite. |
| `IsTextPartGenerationEnabled` | boolean | Determines if text part generation functionality is enabled for this template. |
| `CreatedAt` | Date RFC3339 | The date and time when the template was created. |
| `UpdatedAt` | Date RFC3339 | The date and time when the template was last updated. |


#### Example API Response

```
{
    "Count": 1,
    "Total": 1,
    "Data": [
        {
            "ID": 27,
            "OrganisationID": 2,
            "Name": "New version.",
            "EditMode": 2,
            "LabelIDs": [],
            "LastContentType": null,
            "PartialIDs": [],
            "Purposes": [
                "marketing"
            ],
            "Categories": [
                "e-commerce"
            ],
            "Presets": null,
            "ExternalID": "123",
            "Description": null,
            "IsPublished": false,
            "IsStarred": false,
            "SoftDeleted": false,
            "IsTextPartGenerationEnabled": false,
            "CreatedAt": "2024-05-23T09:05:22.21546Z",
            "UpdatedAt": "2024-05-23T09:11:28.779525Z"
        }
    ]
}
```