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
        • POSTSend the report of a campaign
        • GETGet an email campaign report
        • GETGet an A/B test email campaign results
  • 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 CampaignsEmail Campaign Statistics

Get an A/B test email campaign results

GET
https://api.brevo.com/v3/emailCampaigns/:campaignId/abTestCampaignResult
GET
/v3/emailCampaigns/:campaignId/abTestCampaignResult
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.getAbTestCampaignResult(1);
8}
9main();
1{
2 "clickRate": "50%",
3 "clickedLinks": {
4 "Version A": [
5 {
6 "clickRate": "0%",
7 "clicksCount": 0,
8 "link": "https://google.com"
9 },
10 {
11 "clickRate": "0%",
12 "clicksCount": 0,
13 "link": "https://youtube.com"
14 }
15 ],
16 "Version B": [
17 {
18 "clickRate": "40%",
19 "clicksCount": 2,
20 "link": "http://www.github.com"
21 },
22 {
23 "clickRate": "60%",
24 "clicksCount": 3,
25 "link": "http://www.stackoverflow.com"
26 }
27 ]
28 },
29 "openRate": "100%",
30 "statistics": {
31 "clicks": {
32 "Version A": "0%",
33 "Version B": "50%"
34 },
35 "complaints": {
36 "Version A": "0%",
37 "Version B": "0%"
38 },
39 "hardBounces": {
40 "Version A": "0%",
41 "Version B": "0%"
42 },
43 "openers": {
44 "Version A": "20%",
45 "Version B": "100%"
46 },
47 "softBounces": {
48 "Version A": "0%",
49 "Version B": "0%"
50 },
51 "unsubscribed": {
52 "Version A": "20%",
53 "Version B": "0%"
54 }
55 },
56 "winningCriteria": "Click",
57 "winningVersion": "B",
58 "winningVersionRate": "0%"
59}

Obtain winning version of an A/B test email campaign

Was this page helpful?
Previous

Upload an image to your account's image gallery

Next
Built with

Authentication

api-keystring

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

Path parameters

campaignIdlongRequired

Id of the A/B test campaign

Response

A/B test email campaign Result

clickRatestring
Click rate for current winning version
clickedLinksobject
openRatestring
Open rate for current winning version
statisticsobject
winningCriteriaenum

Criteria chosen for winning version (Open/Click)

Allowed values:
winningSubjectLinestring
Subject Line of current winning version
winningVersionenum

Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending.

Allowed values:
winningVersionRatestring

Open/Click rate for the winner version

Errors

400
Bad Request Error
404
Not Found Error