Skip to main content

Create and run a simple campaign

Send an email to one prospect from a connected mailbox, similar to using Compose in the Woodpecker inbox.

Each successful request creates a new campaign with one prospect and one email step, then starts the campaign automatically with the status RUNNING. The email is then processed as part of the mailbox's normal sending flow and is subject to the mailbox's sending limits, so it may not be sent immediately.

Woodpecker reuses an existing prospect with the supplied email address or creates a new one if no match is found. After creation, you can manage the campaign normally using the other campaigns endpoints, including editing it or adding more steps. The mailbox footer is not added automatically; include it in the email content if needed. To respond within an existing conversation, use reply to a message.

Request​

Endpoint​

POST https://api.woodpecker.co/rest/v2/campaigns/create_and_run_simple_campaign

Headers​

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

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

Body​

{
"email_account_id": 123456,
"subject": "A quick introduction",
"message": "<div>Hi Richard,</div><div>we should talk about Pied Piper!</div>",
"prospect_email": "richard@piedpiper.com",
"track_opens": false,
"cc_recipient_email": "jared@piedpiper.com",
"bcc_recipient_email": null
}

Body schema​

FieldTypeRequiredDescription
email_account_idintegerYesID of the SMTP mailbox used to send the email. Get IDs of mailboxes
subjectstringYesSubject of the email
messagestringYesEmail content, with support for HTML and Woodpecker snippets, as in an email step
prospect_emailstringYesEmail address to send the email to. If the prospect does not exist yet, it will be created automatically
track_opensbooleanYesWhether to add a tracking pixel to the email and track the email opens
cc_recipient_emailstring/nullNoEmail address of the CC recipient. Omit it or set it to null when unused
bcc_recipient_emailstring/nullNoEmail address of the BCC recipient. Omit it or set it to null when unused

Request samples​

Create and start a campaign for one prospect​

curl --request POST \
--url "https://api.woodpecker.co/rest/v2/campaigns/create_and_run_simple_campaign" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"email_account_id": 123456,
"subject": "A quick introduction",
"message": "<div>Hi Richard,</div><div>we should talk about Pied Piper!</div>",
"prospect_email": "richard@piedpiper.com",
"track_opens": false,
"cc_recipient_email": "jared@piedpiper.com",
"bcc_recipient_email": null
}'

Response​

Response examples​

The campaign has been created and started; the email will be sent as part of the mailbox's normal sending process and may not be sent immediately.

{
"id": 200001,
"name": "My Campaign",
"status": "RUNNING",
"bounce_shield_autopaused_at": null,
"email_account_ids": [123456],
"settings": {
"timezone": "Europe/Warsaw",
"prospect_timezone": false,
"daily_enroll": 50,
"gdpr_unsubscribe": false,
"list_unsubscribe": false,
"open_disabled_list": null,
"auto_pause_prospect_from_domain_statuses": null,
"auto_pause_prospect_from_domain": null,
"catch_all_verification_mode": "BALANCED",
"count_followup_delay_in_working_days": false
},
"steps": {
"type": "START",
"id": "8c7554ce-a50c-49f7-9129-2ef5a15f9d9c",
"followup": {
"id": "5486ed61-206c-49dc-b394-fb2524cf163e",
"followup": null,
"type": "EMAIL",
"followup_after": {
"range": "DAY",
"value": 1
},
"delivery_time": {
"MONDAY": [{ "from": "00:00", "to": "00:00" }],
"TUESDAY": [{ "from": "00:00", "to": "00:00" }],
"WEDNESDAY": [{ "from": "00:00", "to": "00:00" }],
"THURSDAY": [{ "from": "00:00", "to": "00:00" }],
"FRIDAY": [{ "from": "00:00", "to": "00:00" }],
"SATURDAY": [{ "from": "00:00", "to": "00:00" }],
"SUNDAY": [{ "from": "00:00", "to": "00:00" }]
},
"body": {
"versions": [
{
"id": "a5436b139434744d605261506c5a996f14c4c0411503807579bbc0585d6b9907",
"version": "A",
"subject": "A quick introduction",
"message": "<div>Hi Richard,</div><div>we should talk about Pied Piper!</div>",
"signature": "NO_SIGNATURE",
"track_opens": false
}
]
}
}
}
}

Body schema​

The response uses the campaign body schema, with the status RUNNING and a START step followed by one EMAIL step.