# POST /email-campaigns

**Resource:** [Email Campaigns](./email-campaigns.md)  
**Scopes:** `email-campaigns:write`  
**Write operation:** yes

Create a new draft email campaign. Provide a name at minimum. Set subject, body_html, and segment_filter before sending.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `name` | body | string | yes | Campaign display name |
| `subject` | body | string | no | Email subject line |
| `intro_text` | body | string | no | Optional intro text shown above the body |
| `body_html` | body | string | no | Email body as HTML |
| `cta_text` | body | string | no | Call-to-action button label |
| `cta_url` | body | string | no | Call-to-action button URL |
| `show_reply_button` | body | boolean | no | Show reply button in footer (default true) |
| `email_config_id` | body | uuid | no | Sender identity UUID. If omitted, auto-resolves to the company default Postmark config. |
| `segment_filter` | body | object | no | Audience filter. See segment_filter schema below. |
| `scheduled_for` | body | string | no | ISO 8601 timestamp to schedule send. Null = manual send. |

## Request example

```bash
curl -X POST \
  "https://api.trustpager.com/functions/v1/api/v1/email-campaigns" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "April Newsletter",
    "subject": "What is new this April",
    "body_html": "<p>Hi {{first_name}},</p><p>Here is what we have been up to...</p>",
    "cta_text": "Read More",
    "cta_url": "https://example.com/blog",
    "segment_filter": {
      "tags": [{ "name": "newsletter" }],
      "exclude_unsubscribed": true
    }
  }'
```

## Response example

```json
{
  "data": {
    "id": "campaign-uuid-...",
    "name": "April Newsletter",
    "status": "draft",
    "subject": "What is new this April",
    "body_html": "<p>Hi {{first_name}},</p>...",
    "segment_filter": { "tags": [{ "name": "newsletter" }], "exclude_unsubscribed": true },
    "created_at": "2026-04-01T10:00:00Z"
  }
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`