> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getreply.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Campaigns

> Send one template to many people, now or later.

A campaign sends one approved template to many people. Give the people in **one** of three ways:

* `numbers`: a list, each with `to` and that person's own values.
* `tag`: everyone with a tag in your contacts.
* `saved_audience`: a saved audience from the app.

Values in `values` are for everyone. With a tag or saved audience you can take a value from each contact, for example `"contact.name"` or `"field.city"`, with a fallback: `{"from": "contact.name", "default": "there"}`.

```bash cURL theme={null}
curl https://api.getreply.in/v1/campaigns \
  -H "Authorization: Bearer gr_live_…" \
  -H "Idempotency-Key: campaign-diwali-2026" \
  -H "Content-Type: application/json" \
  -d '{"name": "Diwali offer", "template": {"name": "diwali_offer", "language": "en"}, "audience": {"tag": "VIP"}, "values": {"body": [{"from": "contact.name", "default": "there"}, "20%"], "buttons": [{"type": "copy_code", "value": "DIWALI20"}]}, "header_media": {"type": "image", "url": "https://example.com/offer.jpg"}}'
```

```javascript Node.js theme={null}
const res = await fetch("https://api.getreply.in/v1/campaigns", {
  method: "POST",
  headers: {
    "Authorization": "Bearer gr_live_…",
    "Idempotency-Key": "campaign-diwali-2026",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Diwali offer",
    "template": {
      "name": "diwali_offer",
      "language": "en"
    },
    "audience": {
      "tag": "VIP"
    },
    "values": {
      "body": [
        {
          "from": "contact.name",
          "default": "there"
        },
        "20%"
      ],
      "buttons": [
        {
          "type": "copy_code",
          "value": "DIWALI20"
        }
      ]
    },
    "header_media": {
      "type": "image",
      "url": "https://example.com/offer.jpg"
    }
  }),
});
console.log(await res.json());
```

```php PHP theme={null}
<?php
$ch = curl_init("https://api.getreply.in/v1/campaigns");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer gr_live_…",
    "Idempotency-Key: campaign-diwali-2026",
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => '{"name": "Diwali offer", "template": {"name": "diwali_offer", "language": "en"}, "audience": {"tag": "VIP"}, "values": {"body": [{"from": "contact.name", "default": "there"}, "20%"], "buttons": [{"type": "copy_code", "value": "DIWALI20"}]}, "header_media": {"type": "image", "url": "https://example.com/offer.jpg"}}',
]);
echo curl_exec($ch);
```

```python Python theme={null}
import requests

res = requests.post(
    "https://api.getreply.in/v1/campaigns",
    headers={
        "Authorization": "Bearer gr_live_…",
        "Idempotency-Key": "campaign-diwali-2026",
    },
    json={
        "name": "Diwali offer",
        "template": {
            "name": "diwali_offer",
            "language": "en"
        },
        "audience": {
            "tag": "VIP"
        },
        "values": {
            "body": [
                {
                    "from": "contact.name",
                    "default": "there"
                },
                "20%"
            ],
            "buttons": [
                {
                    "type": "copy_code",
                    "value": "DIWALI20"
                }
            ]
        },
        "header_media": {
            "type": "image",
            "url": "https://example.com/offer.jpg"
        }
    },
)
print(res.json())
```

Every check runs first: money in the wallet, today's limit, prices by country, people who stopped marketing. If anything fails, nothing is made. The answer shows who goes, who was skipped and why, and the cost by country.

* Add `send_at` (ISO 8601) to send later.
* Pause, resume or stop with `POST /v1/campaigns/{id}/pause`, `/resume` or `/stop`.
* Follow it with `GET /v1/campaigns/{id}`, its `/messages`, or the `campaign.*` webhooks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.