---
agentTools:
  projectIndex: https://sendinblue.readme.io/llms.txt
---

# Get an A/B test email campaign results

Obtain winning version of an A/B test email campaign

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "contact": {
      "email": "contact@brevo.com",
      "name": "Brevo Support",
      "url": "https://account.brevo.com/support"
    },
    "description": "Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to :\n  - Manage your campaigns and get the statistics\n  - Manage your contacts\n  - Send transactional Emails and SMS\n  - and much more...\n\nYou can download our wrappers at https://github.com/orgs/brevo\n**Possible responses**\n  | Code | Message |\n  | :-------------: | ------------- |\n  | 200  | OK. Successful Request  |\n  | 201  | OK. Successful Creation |\n  | 202  | OK. Request accepted |\n  | 204  | OK. Successful Update/Deletion  |\n  | 400  | Error. Bad Request  |\n  | 401  | Error. Authentication Needed  |\n  | 402  | Error. Not enough credit, plan upgrade needed  |\n  | 403  | Error. Permission denied  |\n  | 404  | Error. Object does not exist |\n  | 405  | Error. Method not allowed  |\n  | 406  | Error. Not Acceptable  |\n  | 422  | Error. Unprocessable Entity |\n",
    "license": {
      "name": "MIT",
      "url": "http://opensource.org/licenses/MIT"
    },
    "title": "Brevo API",
    "version": "3.0.0"
  },
  "servers": [
    {
      "url": "https://api.brevo.com/v3"
    }
  ],
  "security": [
    {
      "api-key": []
    },
    {
      "partner-key": []
    }
  ],
  "paths": {
    "/emailCampaigns/{campaignId}/abTestCampaignResult": {
      "get": {
        "description": "Obtain winning version of an A/B test email campaign",
        "operationId": "getAbTestCampaignResult",
        "parameters": [
          {
            "description": "Id of the A/B test campaign",
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "examples": {
                  "response": {
                    "value": {
                      "clickRate": "50%",
                      "clickedLinks": {
                        "Version A": [
                          {
                            "clickRate": "0%",
                            "clicksCount": 0,
                            "link": "https://google.com"
                          },
                          {
                            "clickRate": "0%",
                            "clicksCount": 0,
                            "link": "https://youtube.com"
                          }
                        ],
                        "Version B": [
                          {
                            "clickRate": "40%",
                            "clicksCount": 2,
                            "link": "http://www.github.com"
                          },
                          {
                            "clickRate": "60%",
                            "clicksCount": 3,
                            "link": "http://www.stackoverflow.com"
                          }
                        ]
                      },
                      "openRate": "100%",
                      "statistics": {
                        "clicks": {
                          "Version A": "0%",
                          "Version B": "50%"
                        },
                        "complaints": {
                          "Version A": "0%",
                          "Version B": "0%"
                        },
                        "hardBounces": {
                          "Version A": "0%",
                          "Version B": "0%"
                        },
                        "openers": {
                          "Version A": "20%",
                          "Version B": "100%"
                        },
                        "softBounces": {
                          "Version A": "0%",
                          "Version B": "0%"
                        },
                        "unsubscribed": {
                          "Version A": "20%",
                          "Version B": "0%"
                        }
                      },
                      "winningCriteria": "Click",
                      "winningVersion": "B",
                      "winningVersionRate": "0%"
                    }
                  }
                },
                "schema": {
                  "properties": {
                    "clickRate": {
                      "description": "Click rate for current winning version",
                      "example": "70%",
                      "type": "string"
                    },
                    "clickedLinks": {
                      "properties": {
                        "Version A": {
                          "$ref": "#/components/schemas/abTestVersionClicks"
                        },
                        "Version B": {
                          "$ref": "#/components/schemas/abTestVersionClicks"
                        }
                      },
                      "required": [
                        "Version A",
                        "Version B"
                      ],
                      "type": "object"
                    },
                    "openRate": {
                      "description": "Open rate for current winning version",
                      "example": "70%",
                      "type": "string"
                    },
                    "statistics": {
                      "properties": {
                        "clicks": {
                          "$ref": "#/components/schemas/abTestVersionStats"
                        },
                        "complaints": {
                          "$ref": "#/components/schemas/abTestVersionStats"
                        },
                        "hardBounces": {
                          "$ref": "#/components/schemas/abTestVersionStats"
                        },
                        "openers": {
                          "$ref": "#/components/schemas/abTestVersionStats"
                        },
                        "softBounces": {
                          "$ref": "#/components/schemas/abTestVersionStats"
                        },
                        "unsubscribed": {
                          "$ref": "#/components/schemas/abTestVersionStats"
                        }
                      },
                      "required": [
                        "clicks",
                        "complaints",
                        "hardBounces",
                        "openers",
                        "softBounces",
                        "unsubscribed"
                      ],
                      "type": "object"
                    },
                    "winningCriteria": {
                      "description": "Criteria chosen for winning version (Open/Click)",
                      "enum": [
                        "Open",
                        "Click"
                      ],
                      "example": "Open",
                      "type": "string"
                    },
                    "winningSubjectLine": {
                      "description": "Subject Line of current winning version",
                      "example": "Subject Line A",
                      "type": "string"
                    },
                    "winningVersion": {
                      "description": "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.",
                      "enum": [
                        "notAvailable",
                        "pending",
                        "tie",
                        "A",
                        "B"
                      ],
                      "example": "A",
                      "type": "string"
                    },
                    "winningVersionRate": {
                      "description": "Open/Click rate for the winner version",
                      "example": "70%",
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "A/B test email campaign Result"
          },
          "400": {
            "$ref": "#/components/responses/errorModel"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorModel"
                }
              }
            },
            "description": "A/B test Email Campaign not found"
          }
        },
        "summary": "Get an A/B test email campaign results",
        "tags": [
          "Email Campaigns"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api-key": {
        "description": "The API key should be passed in the request headers as `api-key` for authentication.",
        "in": "header",
        "name": "api-key",
        "type": "apiKey"
      },
      "partner-key": {
        "description": "The partner key should be passed in the request headers as `partner-key` along with `api-key` pair for successful authentication of partner (Optional).",
        "in": "header",
        "name": "partner-key",
        "type": "apiKey"
      }
    },
    "schemas": {
      "errorModel": {
        "properties": {
          "code": {
            "description": "Error code displayed in case of a failure",
            "example": "method_not_allowed",
            "type": "string"
          },
          "message": {
            "description": "Readable message associated to the failure",
            "example": "POST Method is not allowed on this path",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "abTestVersionClicks": {
        "description": "Information on clicked links for a particular version",
        "items": {
          "properties": {
            "clickRate": {
              "description": "Percentage of clicks of link with respect to total clicks",
              "example": "40%",
              "type": "string"
            },
            "clicksCount": {
              "description": "Number of times a link is clicked",
              "example": 3,
              "format": "int64",
              "type": "integer"
            },
            "link": {
              "description": "URL of the link",
              "example": "https://facbook.com/versionA",
              "type": "string"
            }
          },
          "required": [
            "clickRate",
            "clicksCount",
            "link"
          ],
          "type": "object"
        },
        "type": "array"
      },
      "abTestVersionStats": {
        "description": "Percentage of a particular event for both versions",
        "properties": {
          "Version A": {
            "description": "percentage of an event for version A",
            "example": "50%",
            "type": "string"
          },
          "Version B": {
            "description": "percentage of an event for version B",
            "example": "50%",
            "type": "string"
          }
        },
        "required": [
          "Version A",
          "Version B"
        ],
        "type": "object"
      }
    },
    "responses": {
      "errorModel": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "code": {
                  "description": "Error code displayed in case of a failure",
                  "enum": [
                    "invalid_parameter",
                    "missing_parameter",
                    "out_of_range",
                    "campaign_processing",
                    "campaign_sent",
                    "document_not_found",
                    "not_enough_credits",
                    "permission_denied",
                    "duplicate_parameter",
                    "duplicate_request",
                    "method_not_allowed",
                    "unauthorized",
                    "account_under_validation",
                    "not_acceptable",
                    "bad_request",
                    "unprocessable_entity",
                    "Domain does not exist",
                    "Contact email not found",
                    "Attribute not found",
                    "Category id not found",
                    "Invalid parameters passed",
                    "Record(s) for identifier not found",
                    "Returned when query params are invalid",
                    "Returned when invalid data posted",
                    "Feed not found",
                    "Campaign ID not found",
                    "api-key not found",
                    "DMARC policy requires domain authentication",
                    "DNS records not properly configured",
                    "Invalid OTP code provided",
                    "OTP code has expired",
                    "Domain already exists in your account",
                    "The sum of all IP weights must equal 100",
                    "Authentication failed",
                    "Insufficient credits",
                    "Request already processed"
                  ],
                  "example": "method_not_allowed",
                  "type": "string"
                },
                "message": {
                  "description": "Readable message associated to the failure",
                  "example": "POST Method is not allowed on this path",
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ],
              "type": "object"
            }
          }
        },
        "description": "bad request"
      }
    }
  },
  "x-samples-languages": [
    "curl"
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 91,
      "1": 104,
      "2": 180,
      "3": 205,
      "4": 240,
      "5": 82,
      "6": 207,
      "7": 0,
      "8": 3,
      "9": 36,
      "10": 63,
      "11": 142
    }
  }
}
```