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

# Create WhatsApp campaign

> Create a WhatsApp campaign with template mappings tied to call outcomes

Creates a WhatsApp campaign that automatically sends templated WhatsApp messages when an agent handles calls.

<Note>
  Only one WhatsApp campaign is allowed per agent. To modify templates or settings, use [`PUT /whatsapp/campaigns/{id}`](/docs/api-reference/campaigns/update-whatsapp-campaign).
</Note>

### Body parameters

<ParamField body="agentId" type="string" required>
  UUID of the AI agent to attach this campaign to.
</ParamField>

<ParamField body="name" type="string">
  Campaign display name.
</ParamField>

<ParamField body="phoneNumberId" type="string">
  Meta phone number ID to use as sender (overrides default).
</ParamField>

<ParamField body="isActive" type="boolean" default="true">
  Whether the WhatsApp campaign is active.
</ParamField>

<ParamField body="templates" type="object[]" required>
  Array of template mappings (maximum 20).

  <Expandable title="Template Mapping">
    <ParamField body="templateName" type="string" required>
      Name of the approved Meta WhatsApp template.
    </ParamField>

    <ParamField body="languageCode" type="string" default="en_US">
      Language code of the template (e.g. `en_US`, `hi_IN`, `es_ES`).
    </ParamField>

    <ParamField body="process" type="string" required>
      Call direction — `INCOMING` or `OUTGOING`.
    </ParamField>

    <ParamField body="callStatus" type="string" required>
      Call outcome trigger — one of `ANSWERED`, `UNANSWERED`, `FAILED`, `BUSY`.
    </ParamField>
  </Expandable>
</ParamField>

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.agentic-os.com/api/v1/whatsapp/campaigns \
    -H "Authorization: Bearer $AGENTIC_OS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Post-Call Customer Follow-up",
      "agentId": "11111111-1111-1111-1111-111111111111",
      "phoneNumberId": "105938472910293",
      "templates": [
        {
          "templateName": "call_summary_feedback",
          "languageCode": "en_US",
          "process": "OUTGOING",
          "callStatus": "ANSWERED"
        },
        {
          "templateName": "call_missed_callback_link",
          "languageCode": "en_US",
          "process": "OUTGOING",
          "callStatus": "UNANSWERED"
        }
      ]
    }'
  ```

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

  response = requests.post(
      "https://api.agentic-os.com/api/v1/whatsapp/campaigns",
      headers={
          "Authorization": f"Bearer {API_KEY}",
          "Content-Type": "application/json",
      },
      json={
          "name": "Post-Call Customer Follow-up",
          "agentId": "11111111-1111-1111-1111-111111111111",
          "phoneNumberId": "105938472910293",
          "templates": [
              {
                  "templateName": "call_summary_feedback",
                  "languageCode": "en_US",
                  "process": "OUTGOING",
                  "callStatus": "ANSWERED",
              },
              {
                  "templateName": "call_missed_callback_link",
                  "languageCode": "en_US",
                  "process": "OUTGOING",
                  "callStatus": "UNANSWERED",
              },
          ],
      },
  )
  print(response.json())
  ```

  ```javascript Node theme={null}
  const response = await fetch(
    "https://api.agentic-os.com/api/v1/whatsapp/campaigns",
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        name: "Post-Call Customer Follow-up",
        agentId: "11111111-1111-1111-1111-111111111111",
        phoneNumberId: "105938472910293",
        templates: [
          {
            templateName: "call_summary_feedback",
            languageCode: "en_US",
            process: "OUTGOING",
            callStatus: "ANSWERED",
          },
          {
            templateName: "call_missed_callback_link",
            languageCode: "en_US",
            process: "OUTGOING",
            callStatus: "UNANSWERED",
          },
        ],
      }),
    },
  );
  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

### Response

```json theme={null}
{
  "id": "55555555-5555-5555-5555-555555555555",
  "tenantId": "990e8400-e29b-41d4-a716-446655440000",
  "agentId": "11111111-1111-1111-1111-111111111111",
  "name": "Post-Call Customer Follow-up",
  "phoneNumberId": "105938472910293",
  "isActive": true,
  "templates": [
    {
      "id": "template_1",
      "templateName": "call_summary_feedback",
      "languageCode": "en_US",
      "process": "OUTGOING",
      "callStatus": "ANSWERED"
    },
    {
      "id": "template_2",
      "templateName": "call_missed_callback_link",
      "languageCode": "en_US",
      "process": "OUTGOING",
      "callStatus": "UNANSWERED"
    }
  ],
  "createdAt": "2026-06-01T11:00:00.000Z",
  "updatedAt": "2026-06-01T11:00:00.000Z"
}
```
