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 |
settings.prospect_timezone | boolean | false | A flag indicating whether the prospect timezone should be used instead of the timezone configured in the |
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 |
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 |
steps | object | - | Defines the campaign flow in the tree-like structure. The first step here has to be always |
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
andto
keys, where the time is specified as a string in formatHH:mm
, e.g.{"from": "08:00", "to": "18:00"}
. Thefrom
value always has to be lower thanto
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"
andfrom="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 fromfollowup_after.range
field is used to indicate how long to wait before firing thefollowup
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: |
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 - numericstatus
campaign status; for the newly created campaign, it’s alwaysDRAFT
id
for every step - string representation of UUIDid
for every email version - string unique hash of 64 charactersversion
for every email version - the letter mark of the version, only the valuesA
,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 |
settings.prospect_timezone | boolean | A flag indicating whether the prospect timezone should be used instead of the timezone configured in |
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 |
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 |
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: |
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 |
delivery_time | object | - | Specifies the time intervals when the email messages can be sent. The only acceptable object keys are days of week, specifically: The only acceptable object values are lists of time interval objects. The time interval object is an object with 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
Example: { 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
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 |
| Range used to indicate how long to wait before firing the The whole |
followup_after.value | number |
| The concrete value of time unit from If provided, The whole |
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. |