PlunkPlunk
API ReferenceCampaigns

Create campaign

Create a new email campaign

POST
/campaigns

Authorization

ApiKeyAuth

AuthorizationBearer <token>

API Key authentication. Secret keys (sk_*) are required for all endpoints except /v1/track. Public keys (pk_*) only work with the /v1/track endpoint for client-side event tracking. The project is automatically derived from the key.

In: header

Request Body

application/json

name*string

Campaign name

description?string

Campaign description

subject*string

Email subject line

body*string

HTML email body

from*string

Sender email address (must be from verified domain)

Formatemail
fromName?string

Sender name

replyTo?string

Reply-to email address

Formatemail
audienceType*string

Target audience type

Value in"ALL" | "SEGMENT" | "FILTERED"
segmentId?string

Segment ID (required if audienceType is SEGMENT)

audienceFilter?object

Filter conditions (required if audienceType is FILTERED)

Response Body

application/json

curl -X POST "https://next-api.useplunk.com/campaigns" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "subject": "string",    "body": "string",    "from": "user@example.com",    "audienceType": "ALL"  }'
{
  "success": true,
  "data": {
    "id": "string",
    "name": "string",
    "subject": "string",
    "type": "ALL",
    "status": "DRAFT",
    "scheduledAt": "2019-08-24T14:15:22Z"
  }
}