# Create a campaign (/api/createCampaign)

Created as a `draft`. Nothing goes out until you start it.

Endpoint: POST /api/v1/campaigns
Full URL: https://app.sendkuy.com/api/v1/campaigns
- 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 "One channel, one group": {"name":"Promo Ramadan","channels":["whatsapp"],"group_id":"grp_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3"}
Success status: 201

cURL:

```bash
curl -X POST https://app.sendkuy.com/api/v1/campaigns \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Promo Ramadan",
  "channels": [
    "whatsapp"
  ],
  "group_id": "grp_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3"
}'
```

Node.js:

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

const sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

const result = await sendkuy.campaigns.create({
  name: 'Promo Ramadan',
  channels: [
    'whatsapp',
  ],
  group_id: 'grp_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3',
});
```

PHP:

```php
<?php

use SendKuy\SendKuy;

$sendkuy = new SendKuy('sk_live_YOUR_API_KEY');

$result = $sendkuy->campaigns()->create([
    'name' => 'Promo Ramadan',
    'channels' => [
        'whatsapp',
    ],
    'group_id' => 'grp_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3',
]);
```

Python:

```python
import requests

response = requests.request(
    "POST",
    "https://app.sendkuy.com/api/v1/campaigns",
    headers={"Authorization": "Bearer sk_live_YOUR_API_KEY"},
    json={
        "name": "Promo Ramadan",
        "channels": [
            "whatsapp"
        ],
        "group_id": "grp_9cBe3A1H-SLhW5fONWZ32wb-IIio5Ts3"
    },
)

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