Skip to content

Get all campaigns

Returns a list of all campaigns.

HTTP method: GET

https://api.sender.net/v2/campaigns?limit=10&status=DRAFT


ParameterTypeDescription
limitintegerHow many records should be returned on each page of the response.
statusarrayChoose the status to filter your campaigns by, from one of these options: [SCHEDULED, SENDING, SENT or DRAFT]

const url = new URL("https://api.sender.net/v2/campaigns?limit=10&status=DRAFT");
let headers = {
"Authorization": "Bearer [your-token]",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Example Response
{
"data": {
"id": "ej06yl",
"subject": "Scheduled campaign example subject",
"reply_to": "[email protected]",
"language": "en",
"recipient_count": 1,
"from": "Sender Support",
"schedule_time": null,
"last_action": "editor",
"sent_time": null,
"status": "DRAFT",
"created": "2021-05-11 10:43:01",
"modified": "2021-05-11 10:48:33",
"title": "Scheduled campaign example subject",
"domain_id": "bDPoxb",
"preheader": "Scheduled campaign example preview text",
"auto_followup_active": 0,
"auto_followup_subject": "Follow up of Scheduled campaign example subject",
"auto_followup_delay": null,
"editor": "text",
"opens": 0,
"clicks": 0,
"bounces_count": 0,
"send_to_all": 0,
"html": {
"id": "bojGOK",
"thumbnail_url": "https://cdn.sender.net/email_images/9918/540045/html_PbMuBzY0fv9T.png?timestamp=1620744202",
"has_preview": true,
"html_content": "<p style=\"font-size: 14px; font-family: Arial, Helvetica, sans-serif;\">Hello</p>",
"html_body": null
},
"sent_count": 0,
"campaign_groups": [
"b2vAR1"
],
"segments": []
},
"links": {
"first": "https://api.sender.net/v2/campaigns?page=1",
"last": "https://api.sender.net/v2/campaigns?page=2",
"prev": null,
"next": "https://api.sender.net/v2/campaigns?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"links": [
{
"url": null,
"label": "pagination.previous",
"active": false
},
{
"url": "https://api.sender.net/v2/campaigns?page=1",
"label": 1,
"active": true
},
{
"url": "https://api.sender.net/v2/campaigns?page=2",
"label": 2,
"active": false
},
{
"url": "https://api.sender.net/v2/campaigns?page=2",
"label": "pagination.next",
"active": false
}
],
"path": "https://api.sender.net/v2/campaigns",
"per_page": 10,
"to": 10,
"total": 12
},
"has_more_resources": true
}