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

# campaign.paused

> Triggered when a campaign is paused

This event is triggered when a campaign is paused, either manually through the dashboard/API or automatically due to system conditions.

## When This Event Fires

* Campaign is paused via the [Update Campaign API](/api-reference/endpoint/patch-campaign)
* Campaign is manually paused through the dashboard
* Campaign transitions to `PAUSED` status

## Payload

```json theme={null}
{
  "eventId": "evt_1708456789123_abc123def",
  "eventType": "campaign.paused",
  "timestamp": "2024-02-24T10:30:00.000Z",
  "workspaceId": "ws_abc123xyz",
  "data": {
    "campaignId": "camp_xyz789",
    "campaignName": "Q1 Tech Founders Outreach",
    "pausedAt": "2024-02-24T10:30:00.000Z",
    "pausedBy": "api"
  }
}
```

## Payload Fields

| Field               | Type   | Description                                             |
| ------------------- | ------ | ------------------------------------------------------- |
| `eventId`           | string | Unique event identifier for idempotency                 |
| `eventType`         | string | Always `campaign.paused`                                |
| `timestamp`         | string | ISO 8601 timestamp when the event occurred              |
| `workspaceId`       | string | Your workspace ID                                       |
| `data.campaignId`   | string | Unique campaign identifier                              |
| `data.campaignName` | string | Human-readable campaign name                            |
| `data.pausedAt`     | string | ISO 8601 timestamp when the campaign was paused         |
| `data.pausedBy`     | string | How the campaign was paused: `api`, `user`, or `system` |

## Use Cases

<CardGroup cols={2}>
  <Card title="Monitoring" icon="monitor-waveform">
    Track when campaigns stop running
  </Card>

  <Card title="Alerting" icon="bell">
    Alert team when campaigns are paused unexpectedly
  </Card>

  <Card title="Reporting" icon="chart-line">
    Track campaign uptime and pauses
  </Card>

  <Card title="Automation" icon="gears">
    Trigger follow-up actions when campaigns pause
  </Card>
</CardGroup>

## Example Handler

```javascript theme={null}
app.post('/webhooks/sendpilot', async (req, res) => {
  const event = req.body;
  
  if (event.eventType === 'campaign.paused') {
    const { campaignId, campaignName, pausedAt, pausedBy } = event.data;
    
    // Log the pause event
    await analytics.track('campaign_paused', {
      campaignId,
      campaignName,
      pausedBy
    });
    
    // Alert if paused by system (might indicate an issue)
    if (pausedBy === 'system') {
      await slack.postMessage({
        channel: '#alerts',
        text: `⚠️ Campaign auto-paused by system!\n` +
              `Name: ${campaignName}\n` +
              `Time: ${pausedAt}\n` +
              `Please check the campaign for issues.`
      });
    } else {
      await slack.postMessage({
        channel: '#campaigns',
        text: `⏸️ Campaign paused\n` +
              `Name: ${campaignName}\n` +
              `Paused by: ${pausedBy}`
      });
    }
    
    console.log(`Campaign ${campaignName} paused by ${pausedBy}`);
  }
  
  res.status(200).send('OK');
});
```

<Note>
  When a campaign is paused, no new actions will be taken for leads. In-progress actions may still complete. The campaign can be resumed via the API or dashboard.
</Note>
