# Campaigns

The Campaigns service enables tenant administrators to compose, schedule, and execute outbound communication campaigns across multiple delivery channels.

Campaigns support comprehensive audience targeting, delivery tracking, rate-limiting, and cancellation capabilities.

## Delivery Channels

- **`email`**: Delivers email messages (supports rich `html` and fallback `text` content).
- **`sms`**: Delivers text messages (`content.message`).
- **`push`**: Push notifications.

## Audience Targeting Options

1. **`all_users`**: Broadcasts to all users in the tenant with valid channel contact info (email or phone).
2. **`user_attributes`**: Dynamically evaluates inline audience filters matching specific user types, attributes, or metadata.
3. **`audience_ids`**: Targets one or more pre-configured audience segments created via the Audiences API.
4. **`custom`**: Targets a custom list of email addresses or phone numbers provided directly in `audience_config`.

## Campaign Lifecycle & Status

- **`draft`**: Campaign is being created or edited.
- **`scheduled`**: Set to be automatically dispatched at a future `scheduled_at` timestamp.
- **`sending`**: Active recipient delivery in progress through backend worker queues.
- **`sent`**: All recipients processed.
- **`cancelled`**: Delivery was cancelled by administrator.
- **`failed`**: Delivery encountered an unrecoverable failure.

## Throttling (`capping_per_minute`)

Admins can optionally set `capping_per_minute` (1–100,000) to pace delivery batches and avoid triggering email service provider or SMS gateway rate limits.
