# Change a template (/api/updateTemplate)

`channel` cannot be changed and is refused by name. A template's body
lives under a different key per channel, so switching it would silently
change the meaning of everything that uses the template.

Endpoint: PATCH /api/v1/templates/{id}
Full URL: https://app.sendkuy.com/api/v1/templates/{id}
- path parameter id (required): string — The prefixed id of the object.
- header parameter Idempotency-Key (optional): string — Any unique string, one per logical request. Retrying with the same key returns the first answer instead of doing the work twice, and answers with `Idempotent…
Request body (JSON, required); required fields: none
Example "New name": {"name":"Order shipped v2"}
Success status: 200

cURL:

```bash
curl -X PATCH https://app.sendkuy.com/api/v1/templates/tpl_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3 \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Order shipped v2"
}'
```

Node.js:

```ts
import { SendKuy } from 'sendkuy';

const sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

const result = await sendkuy.templates.update('tpl_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3', {
  name: 'Order shipped v2',
});
```

PHP:

```php
<?php

use SendKuy\SendKuy;

$sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

$result = $sendkuy->templates()->update('tpl_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3', [
    'name' => 'Order shipped v2',
]);
```

Python:

```python
import requests

response = requests.request(
    "PATCH",
    "https://app.sendkuy.com/api/v1/templates/tpl_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3",
    headers={"Authorization": "Bearer sk_live_YOUR_API_KEY"},
    json={
        "name": "Order shipped v2"
    },
)

data = response.json()["data"]
```