For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Introduction
    • Getting started
  • Email API
  • Transactional SMS
  • Transactional WhatsApp
  • Marketing Campaigns
      • GETReturn all your created email campaigns
      • POSTCreate an email campaign
      • PUTUpdate an email campaign
      • DELDelete an email campaign
      • POSTSend an email campaign immediately, based on campaignId
      • POSTSend an email campaign to your test list
      • PUTUpdate an email campaign status
      • GETGet a shared template url
      • POSTExport the recipients of an email campaign
  • Contact Management
  • Events
    • GETGet events
    • POSTCreate an event
    • POSTCreate events in batch
  • Object Management
  • Accounts and Settings
  • Sales CRM
  • Conversations
  • Ecommerce
  • Loyalty
LogoLogo
Help CenterAPI KeysStatusSign In
Marketing CampaignsEmail Campaigns

Return all your created email campaigns

GET
https://api.brevo.com/v3/emailCampaigns
GET
/v3/emailCampaigns
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.emailCampaigns.getEmailCampaigns({});
8}
9main();
1{
2 "campaigns": [
3 {
4 "id": 12,
5 "name": "EN - Sales Summer 2017",
6 "status": "sent",
7 "type": "classic",
8 "createdAt": "2017-05-01T12:30:00Z",
9 "footer": "[DEFAULT_FOOTER]",
10 "header": "[DEFAULT_HEADER]",
11 "htmlContent": "This is my HTML Content",
12 "modifiedAt": "2017-05-01T12:30:00Z",
13 "replyTo": "replyto@domain.com",
14 "sender": {
15 "email": "marketing@mycompany.com",
16 "id": 26,
17 "name": "Marketing"
18 },
19 "testSent": true,
20 "recipients": {
21 "exclusionLists": [
22 13
23 ],
24 "lists": [
25 5
26 ]
27 },
28 "statistics": {
29 "campaignStats": [
30 {
31 "appleMppOpens": 10,
32 "clickers": 2665,
33 "complaints": 1,
34 "delivered": 19765,
35 "hardBounces": 87,
36 "opensRate": 29.54,
37 "sent": 19887,
38 "softBounces": 100,
39 "trackableViews": 5661,
40 "uniqueClicks": 2300,
41 "uniqueViews": 7779,
42 "unsubscriptions": 2,
43 "viewed": 8999,
44 "deferred": 30,
45 "listId": 5
46 }
47 ],
48 "globalStats": {
49 "appleMppOpens": 10,
50 "clickers": 2665,
51 "complaints": 1,
52 "delivered": 19765,
53 "hardBounces": 87,
54 "opensRate": 29.54,
55 "sent": 19887,
56 "softBounces": 100,
57 "trackableViews": 5661,
58 "uniqueClicks": 2300,
59 "uniqueViews": 7779,
60 "unsubscriptions": 2,
61 "viewed": 8999,
62 "estimatedViews": 560,
63 "trackableViewsRate": 23.45
64 },
65 "linksStats": {
66 "http://myUrl1.domain.com": 80
67 },
68 "mirrorClick": 120,
69 "remaining": 1000,
70 "statsByDomain": {
71 "hotmail.co.uk": {
72 "clickers": 2720,
73 "complaints": 5,
74 "delivered": 117056,
75 "hardBounces": 0,
76 "sent": 117055,
77 "softBounces": 111,
78 "uniqueClicks": 1970,
79 "uniqueViews": 21111,
80 "unsubscriptions": 105,
81 "viewed": 35251
82 },
83 "yahoo.com": {
84 "clickers": 533,
85 "complaints": 0,
86 "delivered": 25596,
87 "hardBounces": 0,
88 "sent": 25601,
89 "softBounces": 5,
90 "uniqueClicks": 298,
91 "uniqueViews": 3527,
92 "unsubscriptions": 17,
93 "viewed": 5255
94 }
95 }
96 },
97 "previewText": "Don't miss the sale!",
98 "scheduledAt": "2017-06-01T12:30:00Z",
99 "subject": "20% OFF for 2017 Summer Sales",
100 "inlineImageActivation": true,
101 "mirrorActive": true,
102 "recurring": false,
103 "shareLink": "http://example.com/fhsgccc.html?t=9865448900",
104 "tag": "Newsletter",
105 "toField": "{FNAME} {LNAME}"
106 },
107 {
108 "id": 22,
109 "name": "Weekly - 1",
110 "status": "draft",
111 "type": "classic",
112 "createdAt": "2017-05-01T12:30:00Z",
113 "footer": "[DEFAULT_FOOTER]",
114 "header": "[DEFAULT_HEADER]",
115 "htmlContent": "This is my HTML Content",
116 "modifiedAt": "2017-05-01T12:30:00Z",
117 "replyTo": "replyto@domain.com",
118 "sender": {
119 "email": "newsletter@mycompany.com",
120 "id": 26,
121 "name": "Newsletter"
122 },
123 "testSent": false,
124 "recipients": {
125 "exclusionLists": [
126 45
127 ],
128 "lists": [
129 10
130 ]
131 },
132 "statistics": {
133 "campaignStats": [
134 {
135 "appleMppOpens": 10,
136 "clickers": 2665,
137 "complaints": 1,
138 "delivered": 19765,
139 "hardBounces": 87,
140 "opensRate": 29.54,
141 "sent": 19887,
142 "softBounces": 100,
143 "trackableViews": 5661,
144 "uniqueClicks": 2300,
145 "uniqueViews": 7779,
146 "unsubscriptions": 2,
147 "viewed": 8999,
148 "deferred": 30,
149 "listId": 10
150 }
151 ],
152 "globalStats": {
153 "appleMppOpens": 10,
154 "clickers": 2665,
155 "complaints": 1,
156 "delivered": 19765,
157 "hardBounces": 87,
158 "opensRate": 29.42,
159 "sent": 19887,
160 "softBounces": 100,
161 "trackableViews": 5661,
162 "uniqueClicks": 2300,
163 "uniqueViews": 7779,
164 "unsubscriptions": 2,
165 "viewed": 8999,
166 "estimatedViews": 560,
167 "trackableViewsRate": 23.45
168 },
169 "linksStats": {
170 "http://myUrl1.domain.com": {
171 "nbClick": 80
172 },
173 "http://myUrl2.domain.com": {
174 "nbClick": 80
175 },
176 "http://myUrl3.domain.com": {
177 "nbClick": 80
178 }
179 },
180 "mirrorClick": 120,
181 "remaining": 1000,
182 "statsByDomain": {
183 "aol": {
184 "clickers": 2665,
185 "complaints": 1,
186 "delivered": 19765,
187 "hardBounces": 87,
188 "sent": 19887,
189 "softBounces": 100,
190 "uniqueClicks": 2300,
191 "uniqueViews": 7779,
192 "unsubscriptions": 2,
193 "viewed": 8999,
194 "deferred": 30
195 },
196 "gmail": {
197 "clickers": 2665,
198 "complaints": 1,
199 "delivered": 19765,
200 "hardBounces": 87,
201 "sent": 19887,
202 "softBounces": 100,
203 "uniqueClicks": 2300,
204 "uniqueViews": 7779,
205 "unsubscriptions": 2,
206 "viewed": 8999,
207 "deferred": 30
208 }
209 }
210 },
211 "attachmentFile": "http://img.mailinblue.com/{clientID-campaignID}/attachments/{fileName}",
212 "previewText": "your weekly newsletter!",
213 "scheduledAt": "",
214 "subject": "Week 1 - Newsletter",
215 "inlineImageActivation": true,
216 "mirrorActive": true,
217 "recurring": false,
218 "shareLink": "http://example.com/fhsgccc.html?t=9865448900",
219 "tag": "Newsletter",
220 "tags": [
221 "Newsletter",
222 "Weekly"
223 ],
224 "toField": "{FNAME} {LNAME}"
225 }
226 ],
227 "count": 2
228}
<Note>The response payload for this endpoint has changed You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/2023/2/7).</Note>
Was this page helpful?
Previous

Create an email campaign

Next
Built with
The response payload for this endpoint has changed You now need to specify which type of statistics you would like to retrieve. For more information visit this page.

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Query parameters

typeenumOptional
Filter on the type of the campaigns
Allowed values:
statusenumOptional
Filter on the status of the campaign
statisticsenumOptional
Filter on the type of statistics required. Example: **globalStats** value will only fetch globalStats info of the campaign in the returned response. This option only returns data for events that occurred in the last 6 months. For older campaigns, it is advisable to use the **Get Campaign Report** endpoint.
Allowed values:
startDatestringOptional
**Mandatory if endDate is used.** Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result.** Only available if `status` is not passed or is set to `sent`. The date range between `startDate` and `endDate` must not exceed 2 years. `startDate` must not be in the future.
endDatestringOptional
**Mandatory if startDate is used.** Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result.** Only available if `status` is not passed or is set to `sent`. The date range between `startDate` and `endDate` must not exceed 2 years. `endDate` must not be in the future.
limitlongOptional1-100Defaults to 50
Number of documents per page
offsetlongOptionalDefaults to 0
Index of the first document in the page
sortenumOptionalDefaults to desc

Sort the results in the ascending/descending order of record creation. Default order is descending if sort is not passed

Allowed values:
excludeHtmlContentbooleanOptional

Use this flag to exclude htmlContent from the response body. If set to true, the htmlContent field will be returned as an empty string in the response body.

excludePdfAttachmentbooleanOptional

Use this flag to filter out campaigns that have a PDF attachment. If set to true, only campaigns without a PDF attachment (or with no attachment at all) will be returned.

Response

Email campaigns information
campaignslist of objects
countlong
Number of Email campaigns retrieved

Errors

400
Bad Request Error

Filter on the type of statistics required. Example: globalStats value will only fetch globalStats info of the campaign in the returned response. This option only returns data for events that occurred in the last 6 months. For older campaigns, it is advisable to use the Get Campaign Report endpoint.

Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result. Only available if status is not passed or is set to sent. The date range between startDate and endDate must not exceed 2 years. startDate must not be in the future.

Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result. Only available if status is not passed or is set to sent. The date range between startDate and endDate must not exceed 2 years. endDate must not be in the future.