# Create a template (/api/createTemplate)

Endpoint: POST /api/v1/templates
Full URL: https://app.sendkuy.com/api/v1/templates
- 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 "A WhatsApp template": {"channel":"whatsapp","name":"Order shipped","body":"Your order is on its way."}
Success status: 201

cURL:

```bash
curl -X POST https://app.sendkuy.com/api/v1/templates \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "channel": "whatsapp",
  "name": "Order shipped",
  "body": "Your order is on its way."
}'
```

Node.js:

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

const sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

const result = await sendkuy.templates.create({
  channel: 'whatsapp',
  name: 'Order shipped',
  body: 'Your order is on its way.',
});
```

PHP:

```php
<?php

use SendKuy\SendKuy;

$sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

$result = $sendkuy->templates()->create([
    'channel' => 'whatsapp',
    'name' => 'Order shipped',
    'body' => 'Your order is on its way.',
]);
```

Python:

```python
import requests

response = requests.request(
    "POST",
    "https://app.sendkuy.com/api/v1/templates",
    headers={"Authorization": "Bearer sk_live_YOUR_API_KEY"},
    json={
        "channel": "whatsapp",
        "name": "Order shipped",
        "body": "Your order is on its way."
    },
)

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