# EmailCampaigns: Sendinblue Email Campaigns
Return all your created email campaigns
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/get-all-marketing-campaigns).
- Catalog: `Brevo`
- Schema: `EmailCampaigns`
- Primary Keys: `id`
- Label: Email Campaigns
Can retrieve data and change data using insert, update and delete.
## Parameters of Table Function
The following parameters can be used to control the behaviour of the table function `EmailCampaigns`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values.
Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three.
Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third.
| Name | Data Type | Required | Default Value | Documentation |
|---|:---:|:---:|:---:|---|
| `endDate` | `` | ☐ | | **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. |
| `excludeHtmlContent` | `` | ☐ | | 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. (Values: true, false) |
| `excludePdfAttachment` | `` | ☐ | | 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. (Values: true, false) |
| `startDate` | `` | ☐ | | **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. |
| `statistics` | `` | ☐ | | 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. (Values: globalStats, linksStats, statsByDomain) |
| `status` | `` | ☐ | | Filter on the status of the campaign (Values: suspended, archive, sent, queued, draft, inProcess, inReview, cancelling, cancelled) |
| `type` | `` | ☐ | | Filter on the type of the campaigns (Values: classic, trigger) |
## Columns of Table Function
The columns of the table function `EmailCampaigns` are shown below. Each column has an SQL data type. A new non-null value must be provided for every required column at all times during insert and update.
| Name | Data Type | Label | Required | Documentation |
|---|:---:|---|:---:|---|
| `abTesting` | `char` | A/B-Testing | ☐ | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. |
| `attachmentFile` | `varchar2` | | ☐ | Url of the attachment file. Only available if the campaign has an attachment. |
| `attachmentUrl` | `varchar2` | | ☐ | URL of the attachment file associated with the campaign. Empty string if no attachment is present. |
| `createdAt` | `varchar2` | Creation Date | ☐ | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
| `emailExpirationDate_duration` | `int64` | | ☐ | Duration of the email expiry |
| `emailExpirationDate_unit` | `varchar2` | | ☐ | Unit of the duration |
| `footer` | `varchar2` | Footer | ☐ | Footer of the campaign |
| `header` | `varchar2` | Header | ☐ | Header of the campaign |
| `htmlContent` | `varchar2` | HTML Content | ☐ | HTML content of the campaign |
| `id` | `int64` | ID | ☐ | ID of the campaign |
| `inlineImageActivation` | `char` | Inline Image Activation | ☐ | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. |
| `mirrorActive` | `char` | Mirror Active | ☐ | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign |
| `modifiedAt` | `varchar2` | Modified Date | ☐ | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
| `name` | `varchar2` | Name | ☐ | Name of the campaign |
| `previewText` | `varchar2` | | ☐ | Preview text or preheader of the email campaign |
| `recipients` | `varchar2` | Recipients | ☐ | |
| `recurring` | `char` | Recurring | ☐ | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times |
| `replyTo` | `varchar2` | Reply-to | ☐ | Email defined as the "Reply to" of the campaign |
| `returnBounce` | `int64` | Return Bounce | ☐ | Total number of non-delivered campaigns for a particular campaign id. |
| `scheduledAt` | `varchar2` | Schedule Date | ☐ | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) |
| `sendAtBestTime` | `char` | Send at Best Time | ☐ | It is true if you have chosen to send your campaign at best time, otherwise it is false |
| `sender_email` | `varchar2` | Sender Email Address | ☐ | Sender email of the campaign |
| `sender_id` | `int64` | Sender ID | ☐ | Sender id of the campaign |
| `sender_name` | `varchar2` | Sender Name | ☐ | Sender name of the campaign |
| `sentDate` | `varchar2` | Sent Date | ☐ | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' |
| `shareLink` | `varchar2` | Share Link | ☐ | Link to share the campaign on social media. For trigger campaigns, this returns a descriptive message instead of a URL. For classic campaigns that have not been sent, this also returns a descriptive message. |
| `splitRule` | `int64` | Split Rule | ☐ | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` |
| `statistics` | `varchar2` | Statistics | ☐ | |
| `status` | `varchar2` | Status | ☐ | Status of the campaign |
| `subject` | `varchar2` | Subject | ☐ | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` |
| `subjectA` | `varchar2` | Subject A | ☐ | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` |
| `subjectB` | `varchar2` | Subject B | ☐ | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` |
| `tag` | `varchar2` | Tag | ☐ | Tag of the campaign |
| `testSent` | `char` | Test Sent | ☐ | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) |
| `toField` | `varchar2` | To Field | ☐ | Customisation of the "to" field of the campaign |
| `type` | `varchar2` | Type | ☐ | Type of campaign |
| `utmCampaignValue` | `varchar2` | | ☐ | The utm_campaign value associated with the campaign. Only present if a UTM campaign value was set. |
| `utmID` | `int64` | | ☐ | The campaign ID used as utm_id parameter. Only present if UTM campaign tracking with ID is enabled. |
| `utmMedium` | `varchar2` | | ☐ | The utm_medium value. Set to "EMAIL" when UTM campaign tracking is enabled. |
| `utmSource` | `varchar2` | | ☐ | The utm_source value. Set to "Brevo" when UTM campaign tracking is enabled. |
| `winnerCriteria` | `varchar2` | Winner Criteria | ☐ | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` |
| `winnerDelay` | `int64` | Winner Delay | ☐ | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` |