All campaign endpoints require a secret key (
sk_*). The from address must belong to a verified domain on your project.List campaigns
GET /campaigns
Returns a paginated list of campaigns for the authenticated project.
Query parameters
Page number (1-indexed).
Number of campaigns per page.
Filter by status. One of
DRAFT, SCHEDULED, SENDING, SENT, or CANCELLED.Response
Array of campaign objects.
Current page.
Items per page.
Total matching campaigns.
Total pages.
Example
Create campaign
POST /campaigns
Creates a new campaign in DRAFT status.
Body parameters
Internal campaign name.
Email subject line.
HTML email body.
Sender email address. Must be from a verified domain on your project.
Who to send this campaign to. One of:
ALL— all subscribed contacts in the projectSEGMENT— contacts in a specific saved segment (requiressegmentId)FILTERED— contacts matching inline filter conditions (requiresaudienceCondition)
Optional internal description.
Sender display name.
Reply-to email address.
Required when
audienceType is SEGMENT. The ID of the segment to target.Required when
audienceType is FILTERED. A FilterCondition object defining the dynamic audience rules. See the Segments documentation for the condition schema.Response
true on success.Example
Get campaign
GET /campaigns/:id
Retrieves a single campaign by ID.
Path parameters
The campaign ID.
Example
Update campaign
PUT /campaigns/:id
Updates a campaign. Only campaigns in DRAFT or SCHEDULED status can be updated.
Path parameters
The campaign ID.
Body parameters
Campaign name.
Campaign description.
Email subject line.
HTML email body.
Sender email (must be a verified domain).
Sender display name.
Reply-to email address.
Audience type:
ALL, SEGMENT, or FILTERED.Segment ID (required when changing
audienceType to SEGMENT).Audience filter conditions (required when changing
audienceType to FILTERED).Example
Send or schedule campaign
POST /campaigns/:id/send
Sends the campaign immediately or schedules it for future delivery.
Path parameters
The campaign ID.
Body parameters
ISO 8601 timestamp for when to send the campaign. Omit this field (or set it to
null) to send immediately.Response
true on success.Updated campaign object.
Human-readable status message.
Cancel campaign
POST /campaigns/:id/cancel
Cancels a campaign that is in SCHEDULED status.
Path parameters
The campaign ID.
Example
Send test email
POST /campaigns/:id/test
Sends a test email for the campaign to a specified address so you can preview it before sending to the full audience.
Path parameters
The campaign ID.
Body parameters
Email address to send the test to.
Example
Get campaign stats
GET /campaigns/:id/stats
Returns delivery and engagement analytics for a sent campaign.
Path parameters
The campaign ID.
Response
true on success.Example
200
Delete campaign
DELETE /campaigns/:id
Permanently deletes a campaign.
Path parameters
The campaign ID.
Response
Returns{ "success": true, "message": "Campaign deleted successfully" } on success.
Example
Duplicate campaign
POST /campaigns/:id/duplicate
Creates a copy of the campaign in DRAFT status with the same content and settings.
Path parameters
The campaign ID to duplicate.
Response
Returns the new campaign object with HTTP201.
Example