Skip to main content
Campaigns

How to use API 2.0 to manage campaigns in your Woodpecker account

Weronika Wróblewska avatar
Written by Weronika Wróblewska
Updated over 2 months ago

Create campaign

To create a campaign in your Woodpecker account, use the following request:

POST https://api.woodpecker.co/rest/v2/campaigns
{
"name": "Example campaign created via APIv2",
"email_account_ids": [
123000,
123001
],
"settings": {
"timezone": "Europe/Berlin",
"prospect_timezone": false,
"daily_enroll": 50,
"gdpr_unsubscribe": true,
"list_unsubscribe": true
},
"steps": {
"type": "START",
"followup": {
"type": "EMAIL",
"delivery_time": {
"MONDAY": [{ "from": "08:00", "to": "18:00" }],
"TUESDAY": [{ "from": "08:00", "to": "18:00" }],
"WEDNESDAY": [{ "from": "08:00", "to": "18:00" }],
"THURSDAY": [{ "from": "08:00", "to": "18:00" }],
"FRIDAY": [{ "from": "08:00", "to": "18:00" }],
"SATURDAY": [
{ "from": "08:00", "to": "10:00" },
{ "from": "16:00", "to": "18:00" }
]
},
"body": {
"versions": [
{
"subject": "Example subject for A version",
"message": "<div><p>Hi {{FIRST_NAME | \"there\"}},</p><p>This is an example cold email message.</p><p>Best wishes,<br><a href=\"https://woodpecker.co\">Woodpecker</a> team</p></div>",
"signature": "NO_SIGNATURE",
"track_opens": true
},
{
"subject": "Example subject for B version",
"message": "<div><p>Hi {{FIRST_NAME}},</p><p>This is an example cold email message.</p><p>Sincerely,<br><a href=\"https://woodpecker.co\">Woodpecker team</a></p></div>",
"signature": "NO_SIGNATURE",
"track_opens": true
}
]
},
"followup_after": {
"range": "DAY",
"value": 3
},
"followup": {
"type": "EMAIL",
"delivery_time": {
"FRIDAY": [{ "from": "08:00", "to": "18:00" }]
},
"body": {
"versions": [
{
"subject": null,
"message": "<div><p>Hello {{FIRST_NAME}},</p><p>It's almost weekend - a great time to learn how the the Woodpecker campaign API works. Feel free to respond this email asking about details.</p>",
"signature": "SENDER",
"track_opens": true
}
]
}
}
}
}
}

Sample response:

{
"id": 777777,
"name": "Example campaign created via APIv2",
"status":"DRAFT",
"email_account_ids": [
123000,
123001
],
"settings": {
"timezone": "Europe/Berlin",
"prospect_timezone": false,
"daily_enroll": 50,
"gdpr_unsubscribe": true,
"list_unsubscribe": true
},
"steps": {
"id": "286f0242-00d6-4572-a4be-e4414ac589ed",
"type": "START",
"followup": {
"id": "4dbd7af6-682b-4348-9950-77098baa9522",
"type": "EMAIL",
"delivery_time": {
"MONDAY": [{ "from": "08:00", "to": "18:00" }],
"TUESDAY": [{ "from": "08:00", "to": "18:00" }],
"WEDNESDAY": [{ "from": "08:00", "to": "18:00" }],
"THURSDAY": [{ "from": "08:00", "to": "18:00" }],
"FRIDAY": [{ "from": "08:00", "to": "18:00" }],
"SATURDAY": [
{ "from": "08:00", "to": "10:00" },
{ "from": "16:00", "to": "18:00" }
]
},
"body": {
"versions": [
{
"id": "5a9a2de59267e55213480a7ffffe181905dedbe68b6895739ef2bf6b1e5129a1",
"version": "A",
"subject": "Example subject for A version",
"message": "<div><p>Hi {{FIRST_NAME}},</p><p>This is an example cold email message.</p><p>Best wishes,<br><a href=\"https://woodpecker.co\">Woodpecker</a> team</p></div>",
"signature": "NO_SIGNATURE",
"track_opens": true
},
{
"id": "289e9f659addc6a83901de175ca1e819f1261427c35759ea966c05457bb1a7db",
"version": "B",
"subject": "Example subject for B version",
"message": "<div><p>Hi {{FIRST_NAME}},</p><p>This is an example cold email message.</p><p>Sincerely,<br><a href=\"https://woodpecker.co\">Woodpecker team</a></p></div>",
"signature": "NO_SIGNATURE",
"track_opens": true
}
]
},
"followup_after": {
"range": "DAY",
"value": 3
},
"followup": {
"id": "d38f2fc0-7bed-461e-a2bb-a3d4aa786bcc",
"type": "EMAIL",
"delivery_time": {
"FRIDAY": [{ "from": "08:00", "to": "18:00" }],
},
"body": {
"versions": [
{
"id": "289e9f659addc6a83901de175ca1e819d394ded2c4e4df2835bc0e9d251e4eab",
"version": "A",
"subject": "",
"message": "<div><p>Hello {{FIRST_NAME}},</p><p>It's almost weekend - a great time to learn how the the Woodpecker campaign API works. Feel free to respond this email asking about details.</p>",
"signature": "SENDER",
"track_opens": true
}
]
}
}
}
}
}

Response type data:

name

data type

default

description

name

string

“My campaign #0”

The name of the campaign.

email_account_ids

array <number>

-

List of email account IDs used to send campaign emails. All provided email accounts have to be active and without issues. It is required to provide at least 1 email account ID.

settings.timezone

string

-

The default timezone of a campaign. It will be used when setting.prospect_timezone is disabled or when it is enabled but the prospect's timezone is not specified.

The time zone must be specified as the regional ID and be one of the following:

Accepted timezones

Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/El_Aaiun
Africa/Freetown
Africa/Gaborone
Africa/Harare
Africa/Johannesburg
Africa/Kampala
Africa/Khartoum
Africa/Kigali
Africa/Kinshasa
Africa/Lagos
Africa/Libreville
Africa/Lome
Africa/Luanda
Africa/Lusaka
Africa/Malabo
Africa/Maputo
Africa/Maseru
Africa/Mbabane
Africa/Mogadishu
Africa/Monrovia
Africa/Nairobi
Africa/Ndjamena
Africa/Niamey
Africa/Nouakchott
Africa/Ouagadougou
Africa/Porto-Novo
Africa/Sao_Tome
Africa/Tripoli
Africa/Tunis
Africa/Windhoek
America/Anchorage
America/Anguilla
America/Antigua
America/Argentina/Buenos_Aires
America/Aruba
America/Asuncion
America/Barbados
America/Belize
America/Bogota
America/Buenos_Aires
America/Caracas
America/Cayenne
America/Cayman
America/Chicago
America/Chihuahua
America/Costa_Rica
America/Denver
America/Dominica
America/Edmonton
America/El_Salvador
America/Godthab
America/Grand_Turk
America/Grenada
America/Guadeloupe
America/Guatemala
America/Guayaquil
America/Guyana
America/Halifax
America/Havana
America/Indianapolis
America/Jamaica
America/La_Paz
America/Lima
America/Los_Angeles
America/Managua
America/Manaus
America/Martinique
America/Mazatlan
America/Mexico_City
America/Miquelon
America/Monterrey
America/Montevideo
America/Montserrat
America/Nassau
America/New_York
America/Panama
America/Paramaribo
America/Phoenix
America/Port-au-Prince
America/Port_of_Spain
America/Puerto_Rico
America/Regina
America/Rio_Branco
America/Santiago
America/Santo_Domingo
America/Sao_Paulo
America/St_Johns
America/St_Kitts
America/St_Lucia
America/St_Thomas
America/St_Vincent
America/Tegucigalpa
America/Tijuana
America/Toronto
America/Tortola
America/Vancouver
America/Whitehorse
America/Winnipeg
Arctic/Longyearbyen
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Ashgabat
Asia/Baghdad
Asia/Bahrain
Asia/Baku
Asia/Bangkok
Asia/Beirut
Asia/Bishkek
Asia/Brunei
Asia/Calcutta
Asia/Chongqing
Asia/Colombo
Asia/Damascus
Asia/Dhaka
Asia/Dubai
Asia/Dushanbe
Asia/Gaza
Asia/Hong_Kong
Asia/Irkutsk
Asia/Istanbul
Asia/Jakarta
Asia/Jerusalem
Asia/Kamchatka
Asia/Karachi
Asia/Kathmandu
Asia/Kolkata
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuwait
Asia/Macau
Asia/Magadan
Asia/Manila
Asia/Muscat
Asia/Nicosia
Asia/Novosibirsk
Asia/Omsk
Asia/Phnom_Penh
Asia/Pyongyang
Asia/Qatar
Asia/Rangoon
Asia/Riyadh
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Thimphu
Asia/Tokyo
Asia/Ulaanbaatar
Asia/Ulan_Bator
Asia/Urumqi
Asia/Vientiane
Asia/Vladivostok
Asia/Yakutsk
Asia/Yerevan
Atlantic/Azores
Atlantic/Bermuda
Atlantic/Cape_Verde
Atlantic/Faroe
Atlantic/Reykjavik
Atlantic/South_Georgia
Atlantic/St_Helena
Atlantic/Stanley
Australia/Adelaide
Australia/Brisbane
Australia/Canberra
Australia/Darwin
Australia/Hobart
Australia/Melbourne
Australia/Perth
Australia/Sydney
Canada/Atlantic
Canada/Eastern
Canada/Mountain
Canada/Newfoundland
Canada/Saskatchewan
Europe/Amsterdam
Europe/Athens
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Bucharest
Europe/Budapest
Europe/Chisinau
Europe/Copenhagen
Europe/Dublin
Europe/Gibraltar
Europe/Guernsey
Europe/Helsinki
Europe/Isle_of_Man
Europe/Istanbul
Europe/Jersey
Europe/Kiev
Europe/Lisbon
Europe/Ljubljana
Europe/London
Europe/Luxembourg
Europe/Madrid
Europe/Malta
Europe/Minsk
Europe/Monaco
Europe/Moscow
Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Riga
Europe/Rome
Europe/San_Marino
Europe/Sarajevo
Europe/Skopje
Europe/Sofia
Europe/Stockholm
Europe/Tallinn
Europe/Vaduz
Europe/Vatican
Europe/Vienna
Europe/Vilnius
Europe/Volgograd
Europe/Warsaw
Europe/Zagreb
Europe/Zurich
Hongkong
Indian/Antananarivo
Indian/Chagos
Indian/Christmas
Indian/Cocos
Indian/Comoro
Indian/Kerguelen
Indian/Mahe
Indian/Maldives
Indian/Mauritius
Indian/Mayotte
Indian/Reunion
Pacific/Auckland
Pacific/Efate
Pacific/Fakaofo
Pacific/Fiji
Pacific/Funafuti
Pacific/Guadalcanal
Pacific/Guam
Pacific/Honolulu
Pacific/Kiritimati
Pacific/Midway
Pacific/Nauru
Pacific/Niue
Pacific/Norfolk
Pacific/Noumea
Pacific/Palau
Pacific/Pitcairn
Pacific/Pohnpei
Pacific/Port_Moresby
Pacific/Rarotonga
Pacific/Saipan
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Wallis
Singapore
US/Alaska
US/Arizona
US/Central
US/East-Indiana
US/Eastern
US/Hawaii
US/Mountain
US/Samoa
UTC

settings.prospect_timezone

boolean

false

A flag indicating whether the prospect timezone should be used instead of the timezone configured in the settings.timezone field.

settings.daily_enroll

number

-

Indicates how many email messages per day can be sent from the campaign.

The value must be greater than 0 and not greater than your general sending limit.

settings.gdpr_unsubscribe

boolean

false

GDPR-compliant unsubscribe.

It allows your prospects to easily unsubscribe from your emails and delete their data from Woodpecker.

This option will only function when the {{UNSUBSCRIBE}} snippet is added to your email or account signature.

settings.list_unsubscribe

boolean

false

List-unsubscribe header.

List-unsubscribe lets your prospects unsubscribe from your emails in 1 click.

This option will only function when the {{UNSUBSCRIBE}} snippet is added to your email or account signature.

steps

object

-

Defines the campaign flow in the tree-like structure. The first step here has to be always START step.


Available steps

This step always has to be the first (root) step of the campaign. It can’t occur anywhere else in the campaign tree.

  • type – string; only the value START is acceptable here to indicate that this is a START step.

  • followup – object; the follow-up step definition. As this is a START step, the next step must be non-null and will be the first one to include any action with the prospect.


Email step

The email step is used to send an email message to the prospect.

  • type – string; only the value EMAIL is accepted here to indicate that it is an EMAIL step.

  • delivery_time – object; specifies the time intervals when the email messages can be sent.

    The only acceptable object keys are days of week, specifically: SUNDAY, MONDAY, TUESDAY, WEDNESDAY,THURSDAY,FRIDAY,SATURDAY.

    The only acceptable object values are lists of time interval objects. The time interval object is an object with from and to keys, where the time is specified as a string in format HH:mm, e.g. {"from": "08:00", "to": "18:00"}. The from value always has to be lower than to value.

    Multiple time intervals assigned to a single day are allowed, but even if there is only a one-time interval, the array brackets are mandatory. If there is a list of time intervals, specific intervals cannot overlap each other. The absence of a day in the object means that no email will be sent that day.

    To mark the whole day interval, both from="00:00" to="00:00" and from="00:00" to="24:00" formats are supported. However, the first one is used by default (e.g. when asking API for campaign details).

    Example:

    {
    "MONDAY": [
    {"from": "08:00", "to": "12:30"},
    {"from": "13:00", "to": "15:00"},
    {"from": "16:45", "to": "21:00"}
    ],
    "TUESDAY": [
    {"from": "11:00", "to": "19:00"}
    ],
    "SATURDAY": [
    {"from": "00:00", "to": "00:00"}
    ]
    }

    Using the above example, emails will only be sent on Mondays and Tuesdays. On Mondays from 8:00 a.m. to 12:30 p.m., then from 1:00 p.m. to 3:00 p.m., and then from 2:45 p.m. to 9:00 p.m. On Tuesdays, emails will be sent from 11:00 a.m. to 7:00 p.m. On Saturdays, emails will be sent the whole day. In a valid campaign, at least one interval has to be defined.

  • body.versions – array <object>; concrete email definitions. At least one version object is required. Providing more versions will result in using A/B testing for this step. Even if only one version is used, the array brackets are mandatory. The order of versions provided in the array matters. The first provided version will be marked as an A version in the Woodpecker application, the second provided version will be marked as a B version, etc.

    There is a limit of a maximum of 5 versions. All configured versions will be enabled. The version object details can be found below this table.

  • followup_after.range – string; default: DAY; Range used to indicate how long to wait before firing the followup step. The only acceptable values are DAY and HOUR.

    The whole followup_after object is optional. If not provided, the default 1 DAY will be used.

  • followup_after.value – number; default: 1; The concrete value of the time unit from followup_after.range field is used to indicate how long to wait before firing the followup step. If provided, value must be greater than 0 and less than 10000.

    The whole followup_after object is optional. If not provided, the default 1 DAY will be used.

  • followup – object; default: null (meaning no followup); The followup step definition.


Version object

name

data type

default

description

subject

string

(use previous message thread)

Subject of the email message.

This field is always required if the version is part of the first EMAIL step in the path; it must be assigned to all step versions if there is more than one version.

If the step is not the first EMAIL step in the path and the subject field is null, then the message will be sent as a follow-up in the same thread.

message

string

-

The email message that will be sent to the prospect. Can use HTML tags.

signature

string

-

Specifies if the sender's email account signature should be used. The only available values are: SENDER, NO_SIGNATURE.

track_opens

boolean

-

A flag indicating whether Woodpecker should track the email opens.


Snippets

In the subject line or email message step, you can use any of the following snippets:

  • {{FIRST_NAME}}

  • {{LAST_NAME}}

  • {{FULL_NAME}}

  • {{COMPANY}}

  • {{EMAIL}}

  • {{WWW}}

  • {{TAG}}

  • {{LINKEDIN_URL}}

  • {{TITLE}}

  • {{PHONE}}

  • {{ADDRESS}}

  • {{CITY}}

  • {{STATE}}

  • {{COUNTRY}}

  • {{INDUSTRY}}

  • {{UNSUBSCRIBE}}

  • {{SNIPPET_1}}

  • {{SNIPPET_2}}

  • {{SNIPPET_3}}

  • {{SNIPPET_4}}

  • {{SNIPPET_5}}

  • {{SNIPPET_6}}

  • {{SNIPPET_7}}

  • {{SNIPPET_8}}

  • {{SNIPPET_9}}

  • {{SNIPPET_10}}

  • {{SNIPPET_11}}

  • {{SNIPPET_12}}

  • {{SNIPPET_13}}

  • {{SNIPPET_14}}

  • {{SNIPPET_15}}

Currently, Snippet Labels are not supported.

You can set a fallback for each snippet: a default value that will be substituted if the prospect does not have data for that snippet. Snippet fallbacks follow this format: {{SNIPPET_NAME | "Filler Value"}}, where:

  • SNIPPET_NAME: The name of one of the supported snippets among the available positions.

  • Filler Value: The default value to substitute. This can be left blank.

Examples of correctly defined snippet fallbacks:

  • {{FIRST_NAME | "there"}}

  • {{FIRST_NAME | ""}}

  • {{SNIPPET_1 | "contain "quoted" text without escape character"}}

Remember to escape the quotation marks \"there\" when defining Snippet fallbacks in the request.

For further details about snippet fallbacks, please refer to Snippet Fallbacks Documentation.


Campaign statuses

  • RUNNING

  • DRAFT

  • STOPPED

  • PAUSED

  • EDITED

Response payload details

After creating the campaign successfully, the HTTP status 201 CREATED will be returned along with a payload containing the campaign details in the same format as in "Request payload" with some additional fields:

  • id for the campaign - numeric

  • status campaign status; for the newly created campaign, it’s always DRAFT

  • id for every step - string representation of UUID

  • id for every email version - string unique hash of 64 characters

  • version for every email version - the letter mark of the version, only the values A, B, C, D, E are possible

Errors

In case of an error during the campaign creation, the HTTP status 4xx or 5xx will be returned along with the payload containing type, message, and details fields. The type defines the general problem and message can contain some additional information about the problem or instructions on how to fix it. The details field is currently always the null value, but in the future, it may provide some additional data that can help identify the problem in the payload.

Sample error payload

{ 
"type": "MISSING_FEATURES",
"message": "Upgrade your plan",
"details": null
}

Error list

HTTP status

type

description

400

INPUT_DATA_VALIDATION_FAILURE

The request payload is not valid, e.g., required fields are not provided, and there is no subject for the first EMAIL step in the flow.

403

MISSING_FEATURES

The campaign uses features that aren’t available for the account.

409

VALIDATION_FAILURE

There is an issue related to the campaign, such as an assigned email having some problems. The current version of the endpoint does not indicate the problematic fields.

500

UNKNOWN

An unknown error occurred.


Get campaign

To get the name of a campaign, use the following request:

GET /rest/v2/campaigns/{campaign_id:[0-9]+}

Successful response:

If the campaign was found and can be fetch via APIv2. 
HTTP 200 Ok

The payload returned by this endpoint is the same
as the one returned by the campaign's successful creation.

Error response:

If the campaign with given id was not found. 
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
If the campaign with given id contains currently unsupported features. HTTP 409 Conflict 
{
"type": "API_UNSUPPORTED_CAMPAIGN_FEATURES",
"message": "Campaign contains currently unsupported features",
"details": null
}
In case of unexpected error during get the given campaign.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during get campaign call",
"details": null
}

Delete campaign

To delete the campaign from Woodpecker, use the following request:

DELETE /rest/v2/campaigns/{campaign_id:[0-9]+}

Successful response:

If the campaign was successfully stopped.
HTTP 200 Ok

Error response:

If the campaign with given id was not found.
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
If the campaign with given id was related to active workflow.
HTTP 409 Conflict
{
"type": "CAMPAIGN_RELATED_TO_ACTIVE_WORKFLOW",
"message": "Campaign related to active workflow",
"details": null
}
In case of unexpected error during deleting the given campaign.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during delete campaign call",
"details": null
}

Pause campaign

To pause campaigns in Woodpecker, use the following request:

POST /rest/v2/campaigns/{campaign_id:[0-9]+}/pause

Successful response:

If the campaign was successfully paused.
HTTP 200 Ok

Error response:

If the campaign with given id was not found.
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
In case of unexpected error during pausing the given campaign.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during pause campaign call",
"details": null
}

Run campaign

If any of the fields in the campaign do not meet the requirements specified in the campaign POST /campaigns model, a response with an HTTP 400 status code is returned.

The current version of the endpoint allows running a campaign with EMAIL steps and A/B tests (multiple email versions per step). Attempting to run a campaign created with the Woodpecker editor and containing at least one of the following features will result in a response with a 409 status code.

Unsupported campaign features:

  • step with a condition,

  • generic manual task step,

  • call manual task step,

  • LinkedIn manual task step,

  • LinkedIn automation step,

  • AI video snippet,

  • schedule start settings.


To run a campaign, use the following request:

POST /rest/v2/campaigns/{campaign_id:[0-9]+}/run

Successful response:

If the campaign was successfully run.
HTTP 200 Ok

Error response:

If the campaign with given id was not found.
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
If the campaign uses features that are not covered by your product and Add-ons.
HTTP 403 Forbidden
{
"type": "MISSING_FEATURES",
"message": "Upgrade your plan",
"details": null
}
If the campaign cannot be run due to validation problems. 
HTTP 409 Conflict
{
"type": "VALIDATION_FAILURE",
"message": "Validation failure",
"details": null
}
In case of unexpected error during running the given campaign.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during run campaign call",
"details": null
}

Stop campaign

To stop a campaign, use the following request:

POST /rest/v2/campaigns/{campaign_id:[0-9]+}/stop

Successful response:

If the campaign was successfully stopped.
HTTP 200 Ok

Error response:

If the campaign with given id was not found.
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
In case of unexpected error during stopping the given campaign.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during stop campaign call",
"details": null
}

Make campaign editable

Sample request

POST /rest/v2/campaigns/{campaign_id:[0-9]+}/make_editable

Successful response

If the campaign status was set to EDITED successfully.
HTTP 200 Ok

Error response

If the campaign with given id was not found.
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
In case of unexpected error during pausing the given campaign.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during pause campaign call",
"details": null
}

Update campaign settings

The endpoint allows for partial updates to campaign properties, excluding steps.

Only campaigns in DRAFT or EDITED status can be updated. To set the campaign status to EDITED use the POST /campaigns/{campaign_id}/make_editable endpoint.

name

data type

description

name

string

The name of the campaign. If set to an empty string, it will default to 'My campaign <campaign_id>.'

email_account_ids

array <number>

Overrides the list of email account IDs used to send campaign emails. All provided email accounts must be active and without issues. The list can be empty; however, at least one enabled email account is necessary to run the campaign.

settings.timezone

string

The default timezone of a campaign. It will be used when setting.prospect_timezone is disabled or enabled, but the prospect's timezone is not specified.

The time zone must be specified as the regional ID and be one of the following:

Accepted time zones IDs

Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/El_Aaiun
Africa/Freetown
Africa/Gaborone
Africa/Harare
Africa/Johannesburg
Africa/Kampala
Africa/Khartoum
Africa/Kigali
Africa/Kinshasa
Africa/Lagos
Africa/Libreville
Africa/Lome
Africa/Luanda
Africa/Lusaka
Africa/Malabo
Africa/Maputo
Africa/Maseru
Africa/Mbabane
Africa/Mogadishu
Africa/Monrovia
Africa/Nairobi
Africa/Ndjamena
Africa/Niamey
Africa/Nouakchott
Africa/Ouagadougou
Africa/Porto-Novo
Africa/Sao_Tome
Africa/Tripoli
Africa/Tunis
Africa/Windhoek
America/Anchorage
America/Anguilla
America/Antigua
America/Argentina/Buenos_Aires
America/Aruba
America/Asuncion
America/Barbados
America/Belize
America/Bogota
America/Buenos_Aires
America/Caracas
America/Cayenne
America/Cayman
America/Chicago
America/Chihuahua
America/Costa_Rica
America/Denver
America/Dominica
America/Edmonton
America/El_Salvador
America/Godthab
America/Grand_Turk
America/Grenada
America/Guadeloupe
America/Guatemala
America/Guayaquil
America/Guyana
America/Halifax
America/Havana
America/Indianapolis
America/Jamaica
America/La_Paz
America/Lima
America/Los_Angeles
America/Managua
America/Manaus
America/Martinique
America/Mazatlan
America/Mexico_City
America/Miquelon
America/Monterrey
America/Montevideo
America/Montserrat
America/Nassau
America/New_York
America/Panama
America/Paramaribo
America/Phoenix
America/Port-au-Prince
America/Port_of_Spain
America/Puerto_Rico
America/Regina
America/Rio_Branco
America/Santiago
America/Santo_Domingo
America/Sao_Paulo
America/St_Johns
America/St_Kitts
America/St_Lucia
America/St_Thomas
America/St_Vincent
America/Tegucigalpa
America/Tijuana
America/Toronto
America/Tortola
America/Vancouver
America/Whitehorse
America/Winnipeg
Arctic/Longyearbyen
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Ashgabat
Asia/Baghdad
Asia/Bahrain
Asia/Baku
Asia/Bangkok
Asia/Beirut
Asia/Bishkek
Asia/Brunei
Asia/Calcutta
Asia/Chongqing
Asia/Colombo
Asia/Damascus
Asia/Dhaka
Asia/Dubai
Asia/Dushanbe
Asia/Gaza
Asia/Hong_Kong
Asia/Irkutsk
Asia/Istanbul
Asia/Jakarta
Asia/Jerusalem
Asia/Kamchatka
Asia/Karachi
Asia/Kathmandu
Asia/Kolkata
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuwait
Asia/Macau
Asia/Magadan
Asia/Manila
Asia/Muscat
Asia/Nicosia
Asia/Novosibirsk
Asia/Omsk
Asia/Phnom_Penh
Asia/Pyongyang
Asia/Qatar
Asia/Rangoon
Asia/Riyadh
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Thimphu
Asia/Tokyo
Asia/Ulaanbaatar
Asia/Ulan_Bator
Asia/Urumqi
Asia/Vientiane
Asia/Vladivostok
Asia/Yakutsk
Asia/Yerevan
Atlantic/Azores
Atlantic/Bermuda
Atlantic/Cape_Verde
Atlantic/Faroe
Atlantic/Reykjavik
Atlantic/South_Georgia
Atlantic/St_Helena
Atlantic/Stanley
Australia/Adelaide
Australia/Brisbane
Australia/Canberra
Australia/Darwin
Australia/Hobart
Australia/Melbourne
Australia/Perth
Australia/Sydney
Canada/Atlantic
Canada/Eastern
Canada/Mountain
Canada/Newfoundland
Canada/Saskatchewan
Europe/Amsterdam
Europe/Athens
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Bucharest
Europe/Budapest
Europe/Chisinau
Europe/Copenhagen
Europe/Dublin
Europe/Gibraltar
Europe/Guernsey
Europe/Helsinki
Europe/Isle_of_Man
Europe/Istanbul
Europe/Jersey
Europe/Kiev
Europe/Lisbon
Europe/Ljubljana
Europe/London
Europe/Luxembourg
Europe/Madrid
Europe/Malta
Europe/Minsk
Europe/Monaco
Europe/Moscow
Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Riga
Europe/Rome
Europe/San_Marino
Europe/Sarajevo
Europe/Skopje
Europe/Sofia
Europe/Stockholm
Europe/Tallinn
Europe/Vaduz
Europe/Vatican
Europe/Vienna
Europe/Vilnius
Europe/Volgograd
Europe/Warsaw
Europe/Zagreb
Europe/Zurich
Hongkong
Indian/Antananarivo
Indian/Chagos
Indian/Christmas
Indian/Cocos
Indian/Comoro
Indian/Kerguelen
Indian/Mahe
Indian/Maldives
Indian/Mauritius
Indian/Mayotte
Indian/Reunion
Pacific/Auckland
Pacific/Efate
Pacific/Fakaofo
Pacific/Fiji
Pacific/Funafuti
Pacific/Guadalcanal
Pacific/Guam
Pacific/Honolulu
Pacific/Kiritimati
Pacific/Midway
Pacific/Nauru
Pacific/Niue
Pacific/Norfolk
Pacific/Noumea
Pacific/Palau
Pacific/Pitcairn
Pacific/Pohnpei
Pacific/Port_Moresby
Pacific/Rarotonga
Pacific/Saipan
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Wallis
Singapore
US/Alaska
US/Arizona
US/Central
US/East-Indiana
US/Eastern
US/Hawaii
US/Mountain
US/Samoa
UTC

settings.prospect_timezone

boolean

A flag indicating whether the prospect timezone should be used instead of the timezone configured in settings.timezone field.

settings.daily_enroll

number

Indicates how many email messages per day can be sent from the campaign.

The value must be greater than 0 and not greater than your general sending limit.

settings.gdpr_unsubscribe

boolean

GDPR-compliant unsubscribe.

It allows prospects to easily unsubscribe from your emails and delete their data from Woodpecker.

This option will only function when the {{UNSUBSCRIBE}} snippet is added to your email or account signature.

settings.list_unsubscribe

boolean

List-unsubscribe header.

List-unsubscribe lets your prospects unsubscribe from your emails in 1 click.

This option will only function when the {{UNSUBSCRIBE}} snippet is added to your email or account signature.

Sample request

PATCH /rest/v2/campaigns/{campaign_id:[0-9]+}
{
"name":"Updated name",
"email_account_ids": [1,2,3],
"settings": {
"timezone":"Pacific/Pago_Pago",
"prospect_timezone": true,
"daily_enroll": 150,
"settings.gdpr_unsubscribe": true,
"list_unsubscribe": true
}
}

Successful response

The campaign is a full object, including steps.

If the campaign was successfully updated.
HTTP 200 Ok

The payload returned by this endpoint is the same as the one
returned by the campaign's successful creation.

Error response

Invalid request with details object specyfing encoutered problems.
HTTP 400 Bad Request
{
"type": "INPUT_DATA_VALIDATION_FAILURE",
"message": "Input data validation failure",
"details": null
}
If the campaign with the given id was not found.
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
If the campaign is not in DRAFT or EDITED status.
HTTP 409 Conflict
{
"type": "NOT_EDITABLE_STATUS",
"message": "The campaign must be in DRAFT or EDITED status to be updated",
"details": null
}
In case of unexpected error.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during pause campaign call",
"details": null
}

Update step version

The endpoint allows partial updates to the step version for types that support A/B testing. Currently, the API supports only EMAIL steps.

Only campaigns in DRAFT or EDITED status can be updated. To set the campaign status to EDITED use the POST /campaigns/{campaign_id}/make_editable endpoint.

The endpoint does not perform empty subject and message validation.

name

data type

description

subject

string

Subject of the email message. The endpoint does not perform empty subject validation.

message

string

The email message that will be sent to the prospect. You can use HTML tags. The endpoint does not perform empty message validation.

signature

string

Specifies if the sender's email account signature should be used. The only available values are: SENDER, NO_SIGNATURE.

track_opens

boolean

A flag indicating whether Woodpecker should track the email opens.

Sample request

PATCH /rest/v2/campaigns/{campaign_id:[0-9]+}/steps/{step_id}/versions/{version_id}
{
"subject": "Hello",
"message": "World",
"signature": "SENDER",
"track_opens": true
}

Successful response

If the version was successfully updated.
HTTP 200 Ok
{
"id": "d5b2413d325e9e840f21e12eb009a24d74d4bac7c04229011917f61399252fe4",
"version": "A",
"subject": "Hello",
"message": "World",
"signature": "SENDER",
"track_opens": true
}

Error response

Invalid request with details object specyfing encoutered problems.
HTTP 400 Bad Request
{
"type": "INPUT_DATA_VALIDATION_FAILURE",
"message": "Input data validation failure",
"details": null
}
If the step version with the given id was not found.
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
If the campaign is not in DRAFT or EDITED status.
HTTP 409 Conflict
{
"type": "NOT_EDITABLE_STATUS",
"message": "The campaign must be in DRAFT or EDITED status to be updated",
"details": null
}
In case of unexpected error.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during pause campaign call",
"details": null
}

Add step

This endpoint allows adding a new step to the campaign, granted the parent step is a leaf and is not locked (meaning no prospects were processed through it). Currently, the API supports only EMAIL steps.

Only campaigns in DRAFT or EDITED status can be updated. To set the campaign status to EDITED, use the POST /campaigns/{campaign_id}/make_editable endpoint.

Sample request

POST https://api.woodpecker.co/rest/v2/campaigns/{campaign_id}/steps
{
"parent_id": "9e8e8ebb-c9e1-4b8f-be37-a5542513dbee",
"step": {
"type" : "EMAIL",
"delivery_time" : {
"MONDAY" : [
{
"from" : "06:16",
"to" : "18:18"
}
]
},
"body" : {
"versions" : [
{
"subject" : "Hello my friend",
"message" : "Hope this message finds you well",
"signature" : "SENDER",
"track_opens" : false
},
{
"subject" : "Hello my friend 2",
"message" : "Hope this message finds you well 2",
"signature" : "SENDER",
"track_opens" : false
}
]
},
"followup_after": {
"range": "HOUR",
"value": 13
}
}
}

Sample response

{
"id": 1201135,
"name": "Campaign with just one mail step",
"status": "DRAFT",
"email_account_ids": [
12345
],
"settings": {
"timezone": "Europe/Warsaw",
"prospect_timezone": false,
"daily_enroll": 30,
"gdpr_unsubscribe": true,
"list_unsubscribe": true
},
"steps": {
"id": "0308d6fa-9d0d-41dc-abfb-6f208969f634",
"followup": {
"id": "9e8e8ebb-c9e1-4b8f-be37-a5542513dbee",
"followup": {
"id": "a73b902f-b7bd-429f-8161-9ea16af1c872",
"followup": null,
"type": "EMAIL",
"followup_after": {
"range": "HOUR",
"value": 13
},
"delivery_time": {
"MONDAY": [
{
"from": "06:16",
"to": "18:18"
}
]
},
"body": {
"versions": [
{
"id": "dd4b42f788700af47fb5ecfd76585dcf940b9613cdcbccf0bc37f287a29a2f56",
"version": "A",
"subject": "Hello my friend",
"message": "Hope this message finds you well",
"signature": "SENDER",
"track_opens": false
},
{
"id": "dd4b42f788700af47fb5ecfd76585dcf53961837febbf1c8b918e8e53801de8d",
"version": "B",
"subject": "Hello my friend 2",
"message": "Hope this message finds you well 2",
"signature": "SENDER",
"track_opens": false
}
]
}
},
"type": "EMAIL",
"followup_after": {
"range": "DAY",
"value": 1
},
"delivery_time": {
"SUNDAY": [
{
"from": "05:15",
"to": "19:19"
}
]
},
"body": {
"versions": [
{
"id": "0a50ecc3a4676651cde1325bf3e7dde3accbf00020dda8c411bbce21d1e5653a",
"version": "A",
"subject": "Mail subject",
"message": "Mail message",
"signature": "SENDER",
"track_opens": false
}
]
}
},
"type": "START"
}
}

Request payload details

name

data type

default

description

type

string

-

Only the value EMAIL is accepted here to indicate that it is an EMAIL step.

delivery_time

object

-

Specifies the time intervals when the email messages can be sent.

The only acceptable object keys are days of week, specifically: SUNDAY, MONDAY, TUESDAY, WEDNESDAY,THURSDAY,FRIDAY,SATURDAY.

The only acceptable object values are lists of time interval objects. The time interval object is an object with from and to keys, where the time is specified as a string in format HH:mm, e.g. {"from": "08:00", "to": "18:00"}. The from value have to be always lower than to value.

Multiple time intervals assigned to a single day are allowed, but even if there is only one time interval, the array brackets are mandatory. If there is a list of time intervals, specific intervals cannot overlap each other. Absence of a day in the object means that there will be no email sending that day.

To mark the whole day interval, both from="00:00" to="00:00" and from="00:00" to="24:00" formats are supported. However, the first one is used by default (e.g. when asking API for campaign details).

Example:

{
"MONDAY": [
{"from": "08:00", "to": "12:30"},
{"from": "13:00", "to": "15:00"},
{"from": "16:45", "to": "21:00"}
],
"TUESDAY": [
{"from": "11:00", "to": "19:00"}
],
"SATURDAY": [
{"from": "00:00", "to": "00:00"}
]
}

Using the above example, emails will only be sent on Mondays and Tuesdays. On Mondays, emails will be sent from 8:00 a.m. to 12:30 p.m., then from 1:00 p.m. to 3:00 p.m. and then from 2:45 p.m. to 9:00 p.m. On Tuesdays, emails will be sent from 11:00 a.m. to 7:00 p.m. On Saturdays, emails will be sent the whole day.

In a valid campaign, at least one interval has to be defined.

body.versions

array <object>

-

Concrete email definitions.

At least one version object is required. Providing more versions will result in using A/B testing for this step. Even if only one version is used, the array brackets are mandatory.

The order of versions provided in the array matters. The first provided version will be marked as A version in the Woodpecker application, the second provided version will be marked as B version, etc.

There is a limit of max 5 versions. All configured versions will be enabled.

The version object details can be found below this table.

followup_after.range

string

DAY

Range used to indicate how long to wait before firing the followup step. The only acceptable values are: DAY, HOUR.

The whole followup_after object is optional. If not provided, the default 1 DAY will be used.

followup_after.value

number

1

The concrete value of time unit from followup_after.range field used to indicate how long to wait before firing the followup step.

If provided, value must be greater than 0 and less than 10000.

The whole followup_after object is optional. If not provided, the default 1 DAY will be used.

Errors

In case of an error during adding a step, the HTTP status 4xx or 5xx will be returned along with the payload containing type, message and details fields.

The type defines the general problem and message can contain some additional information about the problem or instructions on how to fix it. The details field is currently always null value, but in the future, it may provide some additional data that can help identify the problem in the payload.

Sample error payload

{
"type": "MISSING_FEATURES",
"message": "Upgrade your plan",
"details": null
}

Error list

HTTP status

type

description

400

INPUT_DATA_VALIDATION_FAILURE

The request payload is not valid, e.g., the required fields are not provided, and there is no subject for the first EMAIL step in the flow.

403

MISSING_FEATURES

Campaign uses features that aren’t available for the account.

409

VALIDATION_FAILURE

There is an issue related to the campaign, such as problems with an assigned email. The current version of the endpoint does not indicate the problematic fields.

500

UNKNOWN

Unknown error occurred.

Delete step

The endpoint removing a step from campaign, granted the step is not the start step or the first step after the start step and is not locked (meaning no prospects were processes through it) .

Only campaigns in DRAFT or EDITED status can be updated. To set the campaign status to EDITED use the POST /campaigns/{campaign_id}/make_editable endpoint.

Sample request

DELETE https://api.woodpecker.co/rest/v2/campaigns/{campaign_id}/steps/{step_id}

Successful response

HTTP 200 Ok

Error response

If the campaign with given id was not found.
HTTP 404 Not Found
{
"type": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
In case of unexpected error during pausing the given campaign.
HTTP 500 Internal Server Error
{
"type": "UNKNOWN",
"message": "Unknown error during pause campaign call",
"details": null
}

Sample response

{
"id": 1201135,
"name": "Campaign with just one mail step",
"status": "DRAFT",
"email_account_ids": [
12345
],
"settings": {
"timezone": "Europe/Warsaw",
"prospect_timezone": false,
"daily_enroll": 30,
"gdpr_unsubscribe": true,
"list_unsubscribe": true
},
"steps": {
"id": "0308d6fa-9d0d-41dc-abfb-6f208969f634",
"followup": {
"id": "9e8e8ebb-c9e1-4b8f-be37-a5542513dbee",
"followup": {
"id": "a73b902f-b7bd-429f-8161-9ea16af1c872",
"followup": null,
"type": "EMAIL",
"followup_after": {
"range": "HOUR",
"value": 13
},
"delivery_time": {
"MONDAY": [
{
"from": "06:16",
"to": "18:18"
}
]
},
"body": {
"versions": [
{
"id": "dd4b42f788700af47fb5ecfd76585dcf940b9613cdcbccf0bc37f287a29a2f56",
"version": "A",
"subject": "Hello my friend",
"message": "Hope this message finds you well",
"signature": "SENDER",
"track_opens": false
},
{
"id": "dd4b42f788700af47fb5ecfd76585dcf53961837febbf1c8b918e8e53801de8d",
"version": "B",
"subject": "Hello my friend 2",
"message": "Hope this message finds you well 2",
"signature": "SENDER",
"track_opens": false
}
]
}
},
"type": "EMAIL",
"followup_after": {
"range": "DAY",
"value": 1
},
"delivery_time": {
"SUNDAY": [
{
"from": "05:15",
"to": "19:19"
}
]
},
"body": {
"versions": [
{
"id": "0a50ecc3a4676651cde1325bf3e7dde3accbf00020dda8c411bbce21d1e5653a",
"version": "A",
"subject": "Mail subject",
"message": "Mail message",
"signature": "SENDER",
"track_opens": false
}
]
}
},
"type": "START"
}
}

Errors

In case of an error during deleting a step, the HTTP status 4xx or 5xx will be returned along with the payload containing type, message and details fields.

The type defines the general problem and message can contain some additional information about the problem or instructions on how to fix it. The details field is currently always null value, but in the future, it may provide some additional data that can help identify the problem in the payload.

Sample error payload

{
"type": "MISSING_FEATURES",
"message": "Upgrade your plan",
"details": null
}

Error list

HTTP status

type

description

400

INPUT_DATA_VALIDATION_FAILURE

The request payload is not valid, e.g., the required fields are not provided, and there is no subject for the first EMAIL step in the flow.

403

MISSING_FEATURES

Campaign uses features that aren’t available for the account.

409

VALIDATION_FAILURE

There is an issue related to the campaign, such as problems with an assigned email. The current version of the endpoint does not indicate the problematic fields.

500

UNKNOWN

Unknown error occurred.

Did this answer your question?