Skip to main content

Create campaign draft

Create an email, LinkedIn, or multichannel campaign without providing all the details required to run it. The campaign is created in DRAFT status and can include a sequence of steps even if some configuration required to run them is still missing, such as mailboxes, LinkedIn accounts, or message content. Before you can run the campaign you must complete any missing configuration and content.

Request​

Endpoint​

POST https://api.woodpecker.co/rest/v2/campaigns/create-draft

Headers​

x-api-key: {YOUR_API_KEY}
Content-Type: application/json

For details on how to authenticate your requests, see the authentication guide.

Body​

The request body uses the same campaign structure as create campaign, but fewer fields are required. A draft must still include a START step followed by at least one EMAIL or LINKEDIN step. Email steps require only delivery_time, while LinkedIn steps require body.action_type.

Create an email campaign without a mailbox, campaign settings, subject, or message. Woodpecker fills in the omitted settings and creates an empty email version.

{
"name": "Campaign draft",
"steps": {
"type": "START",
"followup": {
"type": "EMAIL",
"delivery_time": {
"MONDAY": [{ "from": "08:00", "to": "18:00" }]
}
}
}
}

Body schema​

Notes:

  • If an email step does not include body or versions, Woodpecker creates one email version with an empty subject and message. Missing or null values in a supplied version are also treated as empty. Empty subjects are returned as null.
  • Fields that are provided are still validated. This includes mailbox IDs, campaign settings, delays, and delivery windows.
FieldTypeRequiredDescription
namestringNoCampaign name; uses the standard generated campaign name when omitted
email_account_idsarray[integer]NoSMTP mailbox IDs; omit or use [] when none are connected yet. Supplied IDs must refer to usable mailboxes; see get mailboxes
settingsobjectNoCampaign settings; omitted values use defaults described below
  └─ timezonestringNoCampaign timezone; defaults to the requesting user's timezone
  └─ daily_enrollintegerNoDaily enrollment limit; defaults to 50
stepsobjectYesRoot START step containing the campaign's first action step in followup
  └─ typestringYesMust be START
  └─ followupobjectYesFirst EMAIL or LINKEDIN step
    └─ typestringYesEMAIL or LINKEDIN
    └─ delivery_timeobjectFor EMAILSending windows, by weekday; see the delivery time schema
    └─ bodyobjectFor LINKEDINContains the required action_type; see the LinkedIn step schema
    └─ body.versionsarray[object]NoEmail or LinkedIn message versions; when omitted or empty, one empty version is created
    └─ body.linkedin_account_idinteger/nullNoLinkedIn account for the step; it can be set later. See get LinkedIn accounts
    └─ followup_afterobjectNoDelay before this step; defaults to one day
    └─ followupobject/nullNoNext email or LinkedIn step; omit for the final step

Request samples​

The samples below use the minimal email draft shown above.

Create an email campaign draft​

curl --request POST \
--url "https://api.woodpecker.co/rest/v2/campaigns/create-draft" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"name": "Campaign draft",
"steps": {
"type": "START",
"followup": {
"type": "EMAIL",
"delivery_time": {
"MONDAY": [{ "from": "08:00", "to": "18:00" }]
}
}
}
}'

Response​

Response examples​

Campaign created. The returned body will be a full campaign payload, which includes any optional fields that were not included in the request. The campaign is created in DRAFT status.

Use the returned id with get campaign, update campaign, and run campaign. Running the draft checks the missing content and accounts and returns a validation error until the campaign is ready.

{
"id": 200001,
"name": "Campaign draft",
"status": "DRAFT",
"bounce_shield_autopaused_at": null,
"email_account_ids": [],
"settings": {
"timezone": "Europe/Warsaw",
"prospect_timezone": false,
"daily_enroll": 50,
"gdpr_unsubscribe": false,
"list_unsubscribe": false,
"open_disabled_list": [],
"auto_pause_prospect_from_domain_statuses": null,
"auto_pause_prospect_from_domain": false,
"catch_all_verification_mode": "BALANCED",
"count_followup_delay_in_working_days": false
},
"steps": {
"id": "8c7554ce-a50c-49f7-9129-2ef5a15f9d9c",
"type": "START",
"followup": {
"id": "5486ed61-206c-49dc-b394-fb2524cf163e",
"type": "EMAIL",
"followup_after": { "range": "DAY", "value": 1 },
"followup": null,
"delivery_time": {
"MONDAY": [{ "from": "08:00", "to": "18:00" }]
},
"body": {
"versions": [
{
"id": "a5436b139434744d605261506c5a996f14c4c0411503807579bbc0585d6b9907",
"version": "A",
"subject": null,
"message": "",
"signature": "NO_SIGNATURE",
"track_opens": false
}
]
}
}
}
}