Get campaign
Fetch a campaign. Use this endpoint to review your campaign settings, including sending limits, attached mailboxes, and the content and settings for each step and version, such as delivery times and tracking options. You can also obtain the step or version IDs for use in update requests.
If you are looking for:
- Campaign IDs - see
rest/v1/campaign_list
endpoint here - Campaign statistics - see
rest/v1/campaign_list?id={id}
endpoint here or consider predefined reports
Request
Endpoint
https://api.woodpecker.co/rest/v2/campaigns/{campaign_id}
Headers
x-api-key: {YOUR_API_KEY}
For details on how to authenticate your requests, please see the authentication guide.
Request sample
Sample request
- cURL
- Java
- Node.js
curl --request GET \
--url "https://api.woodpecker.co/rest/v2/campaigns/{campaign_id}" \
--header "x-api-key: {YOUR_API_KEY}"
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.io.IOException;
import java.net.URISyntaxException;
HttpClient client = HttpClient.newHttpClient();
long campaignId = 12345;
String apiKey = "YOUR_API_KEY";
String url = String.format("https://api.woodpecker.co/rest/v2/campaigns/%d", campaignId);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("x-api-key", apiKey)
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
const getCampaign = async (campaignId, apiKey) => {
const url = `https://api.woodpecker.co/rest/v2/campaigns/${campaignId}`;
const response = await fetch(url, {
method: "GET",
headers: {
"x-api-key": apiKey,
},
});
return await response.json();
};
try {
const result = await getCampaign(12345, "YOUR_API_KEY");
console.log(result);
} catch (error) {
console.error("Error:", error);
}
Response
Response examples
- 200
- 401
- 404
- 409
- 500
Successful response
- Simple campaign
- Complex campaign
The below payload represents a simple one-step campaign sent from one email address. The campaign and step settings are the default values where applicable.
{
"id": 12345678,
"name": "One step campaign",
"status": "DRAFT",
"email_account_ids": [112233],
"settings": {
"timezone": "Europe/Warsaw",
"prospect_timezone": false,
"daily_enroll": 50,
"gdpr_unsubscribe": false,
"list_unsubscribe": false,
"open_disabled_list": [],
"auto_pause_prospect_from_domain": false,
"catch_all_verification_mode": "BALANCED"
},
"steps": {
"id": "b90637e7-8ccd-4df1-86a6-d07581abbf3e",
"type": "START",
"followup": {
"id": "169486a5-e375-48cd-81a1-01a7f2a1895f",
"followup": null,
"type": "EMAIL",
"followup_after": { "range": "DAY", "value": 1 },
"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" }]
},
"body": {
"versions": [
{
"id": "2af5c091205511bb54acb86b43c59d378a795f67g9a8a73df34601q293e1664f",
"version": "A",
"subject": "Example subject line",
"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": "SENDER",
"track_opens": true
}
]
}
}
}
}
The below payload represents a three-step campaign sent from multiple email addresses. The campaign and step configurations include custom options such as multiple versions of a step, tracking settings, and several delivery windows throughout the day.
{
"id": 12345679,
"name": "Three step campaign with custom configuration",
"status": "RUNNING",
"email_account_ids": [100001, 100002, 100003],
"settings": {
"timezone": "Europe/Warsaw",
"prospect_timezone": true,
"daily_enroll": 80,
"gdpr_unsubscribe": true,
"list_unsubscribe": true,
"open_disabled_list": ["google.com", "OTHER_PROVIDER"],
"auto_pause_prospect_from_domain": true,
"catch_all_verification_mode": "MAXIMUM"
},
"steps": {
"id": "e688d52a-b867-4690-acf2-3809286915b1",
"type": "START",
"followup": {
"id": "36c4fb2c-6f4f-45bf-aeae-4903501193hd",
"type": "EMAIL",
"delivery_time": {
"MONDAY": [{ "from": "09:00", "to": "18:00" }],
"TUESDAY": [{ "from": "09:00", "to": "18:00" }],
"WEDNESDAY": [{ "from": "09:00", "to": "18:00" }],
"THURSDAY": [{ "from": "09:00", "to": "18:00" }]
},
"body": {
"versions": [
{
"id": "2af5c021295511bb54acb87b47c59c378a795f67f9a1b73dd34609c193e1664f",
"version": "A",
"subject": "Example subject line - version A",
"message": "<div>Hi {{FIRST_NAME | \"there\"}},</div><div><br /></div><div>This is an example cold email message. </div><div><br /></div><div>Best wishes, </div><div><a href=\"https://woodpecker.co\">Woodpecker</a> team</div><div><a href=\"{{UNSUBSCRIBE}}\">unsubscribe</a></div>",
"signature": "SENDER",
"track_opens": true
},
{
"id": "c61b5583c7d19fd04d23b2181a17af640c4cf011490acd6f9e4537f62db0e7ba",
"version": "B",
"subject": "Example subject line - version B",
"message": "<div>{{SPINTAX | \"Hi\" | \"Hello\" | \"Good morning\"}} {{FIRST_NAME}},</div><div><br /></div><div>Yet another example of a cold email message. </div><div><br /></div><div>All the best, </div><div><a href=\"https://woodpecker.co\">Woodpecker</a> team</div>",
"signature": "SENDER",
"track_opens": false
}
]
},
"followup_after": { "range": "DAY", "value": 2 },
"followup": {
"id": "a99e297f-8423-4600-8c24-5bc21b936302",
"type": "EMAIL",
"delivery_time": { "FRIDAY": [{ "from": "09:00", "to": "17:00" }] },
"body": {
"versions": [
{
"id": "06cb0a70aba1dedae5a9eb949286fb2326f1e9105851a6be6f187e47c131c7be",
"version": "A",
"subject": null,
"message": "<div>First followup, version A, sender's signature, no open tracking, same subject line</div>",
"signature": "SENDER",
"track_opens": false
},
{
"id": "4d7d78eebd5abe71eee873b5da40d525e16f0f3611a8a543cae274a5a772a54f",
"version": "B",
"subject": null,
"message": "<div>First followup, version B, no signature, no open tracking, same subject line</div>",
"signature": "NO_SIGNATURE",
"track_opens": false
},
{
"id": "4ac2bec5a9082b090aad90eeaa230fe08e7a5ab3a6b968d9328ec437316c9037",
"version": "C",
"subject": null,
"message": "<div>First followup, version C, sender's signature, open tracking, same subject line</div>",
"signature": "SENDER",
"track_opens": true
}
]
},
"followup_after": { "range": "DAY", "value": 6 },
"followup": {
"id": "7371e283-6de9-440a-9eaf-273232b580f7",
"type": "EMAIL",
"delivery_time": {
"WEDNESDAY": [
{
"from": "09:00",
"to": "11:00"
},
{
"from": "14:00",
"to": "16:00"
}
],
"THURSDAY": [
{
"from": "09:00",
"to": "11:00"
},
{
"from": "14:00",
"to": "16:00"
}
]
},
"body": {
"versions": [
{
"id": "f88459226decae0e46c83d8c85b235f90b53097be8bdf7b4ecc7a6d7f4084324",
"version": "A",
"subject": "Subject linie 3A",
"message": "<div>Third followup, sender's signature, no open tracking, different subject line</div>",
"signature": "SENDER",
"track_opens": false
},
{
"id": "740b243fe43ceca7f89f38d940b318e06e3acea404ce551191abe512bf4f4a50",
"version": "B",
"subject": "Subject linie 3B",
"message": "<div>Third followup, sender's signature, no open tracking, different subject line</div>",
"signature": "SENDER",
"track_opens": false
}
]
},
"followup_after": { "range": "DAY", "value": 1 },
"followup": null
}
}
}
}
}
This section provides the body schema for each object in the campaign payloads. For a more detailed overview, please refer to the campaign schema.Campaign configuration object
Field Type Description id
integer Unique identifier of the campaign name
string Name of the campaign status
string Current campaign status. Possible values: RUNNING
, DRAFT
, STOPPED
, PAUSED
, EDITED
, COMPLETED
email_account_ids
array[integer] List of email account SMTP IDs used in this campaign. Use /mailboxes endpoint to review them settings
object Campaign-level settings like timezone, sending limit, unsubscribe settings, etc └─ 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└─ prospect_timezone
boolean Whether to adjust sending times to prospect's timezone instead of the campaign timezone
└─ daily_enroll
integer Maximum number of opening emails that can be sent per day. The limit is shared between all mailboxes └─ gdpr_unsubscribe
boolean Whether the unsubscribe link should provide prospects with an option for GDPR-compliant data removal. This option will work only if the {{UNSUBSCRIBE}} snippet is included in your email or account signature └─ list_unsubscribe
boolean Whether to include List-Unsubscribe header. This option will work only if the {{UNSUBSCRIBE}} snippet is included in your email or account signature └─ open_disabled_list
array[string]/null List of email service providers (recipient's ESP) for which open tracking is disabled. Available options: google.com
, outlook.com
, OTHER_PROVIDER
└─ auto_pause_prospect_from_domain
boolean/null Whether to automatically pause sending to prospects after a response from the same domain (free providers excluded) └─ catch_all_verification_mode
string Catch-all email verification mode - how to approach contacting prospects using catch-all emails.
NONE
- contact all catch-all emails, including undeliverableBALANCED
- contact deliverable and risky catch-all emails MAXIMUM
- contact only deliverable catch-all emails ONLY_VERIFY
- do not contact catch-all emails steps
object Campaign steps, including all emails and their delivery times, content, etc Steps objects
Field Type Description id
string Unique identifier of the step (UUID) type
string START
is always the first step of a campaign; the remaining steps are EMAIL
delivery_time
object Time intervals during which emails can be sent body
object Email content configuration including A/B test versions followup_after
object Object that specifies the time delay before processing a prospect in the next step; if delivery_time
allows it└─ range
string Time unit - DAY
, HOUR
, MINUTE
└─ value
integer Value of the time unit followup
object/null Next step in the sequence. Consists of an EMAIL step object. Null indicates end of sequence Delivery time object
Field Type Description MONDAY
...SUNDAY
array[object] Array of time windows for each day. Maximum 2 windows per day. The valid keys are the days of the week: MONDAY
, TUESDAY
, WEDNESDAY
, THURSDAY
, FRIDAY
, SATURDAY
, SUNDAY
└─ [].from
string Campaign start time in "HH:mm" format (24-hour) └─ [].to
string Campaign end time in "HH:mm" format (24-hour) Body object
Field Type Description body.versions
array[object] Array of email version objects and their definitions └─ [].id
string Unique identifier of the email version (hash-based ID, 64 characters) └─ [].version
string Version Identifier: The default version is A
. Available versions are A
through E
└─ [].subject
string/null Email subject line. If null, the message will use the same subject line as the previous step and will be sent as a follow-up in the same thread └─ [].message
string Email body content in HTML format └─ [].signature
string Whether to use the sender's email account signature. The available options are: SENDER
or NO_SIGNATURE
└─ [].track_opens
boolean Whether to track email opens for this email version
An issue with authorization. Please review the authorization guide.
{
"title": "Unauthorized",
"status": 401,
"detail": "Invalid api key",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
The requested campaign doesn't exist.
{
"code": "CAMPAIGN_NOT_EXIST",
"message": "Campaign not found",
"details": null
}
Body schema
Field | Type | Description |
---|---|---|
code | string | Error code |
message | string | Descriptive error message |
details | string/null | Additional information. Currently always null |
The requested campaign uses features that are currently supported only via the UI. Please refer to the campaign configuration.
{
"code": "API_UNSUPPORTED_CAMPAIGN_FEATURES",
"message": "Campaign contains currently unsupported features",
"details": null
}
Body schema
Field | Type | Description |
---|---|---|
code | string | Error code |
message | string | Descriptive error message |
details | string/null | Additional information. Currently always null |
Unknown error, please try again later.
{
"code": "UNKNOWN",
"message": "Unknown error during get campaign call",
"details": null
}
Body schema
Field | Type | Description |
---|---|---|
code | string | Error code |
message | string | Descriptive error message |
detail | string/null | Additional information. Currently always null |