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

# Update an 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}": {
      "put": {
        "operationId": "updateEmailCampaign",
        "parameters": [
          {
            "description": "Id of the campaign",
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "abTesting": {
                    "default": false,
                    "description": "Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. **subjectA, subjectB, splitRule, winnerCriteria & winnerDelay** will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. **Can be set to true only if sendAtBestTime is false**. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B\n",
                    "example": true,
                    "type": "boolean"
                  },
                  "attachmentUrl": {
                    "description": "Absolute url of the attachment (no local file). Extension allowed: #### xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps'\n",
                    "example": "https://attachment.domain.com",
                    "format": "url",
                    "type": "string"
                  },
                  "emailExpirationDate": {
                    "description": "To reduce your carbon footprint, set an expiration date for your email. If supported, it will be automatically deleted from the recipient’s inbox, saving storage space and energy.",
                    "properties": {
                      "duration": {
                        "description": "Duration of the email expiry. maximum duration can be 3600 days or 480 weeks or 120 months.",
                        "example": 30,
                        "format": "int64",
                        "maximum": 3600,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "unit": {
                        "description": "unit of the duration",
                        "enum": [
                          "days",
                          "weeks",
                          "months"
                        ],
                        "example": "weeks",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "footer": {
                    "description": "Footer of the email campaign",
                    "example": "[DEFAULT_FOOTER]",
                    "type": "string"
                  },
                  "header": {
                    "description": "Header of the email campaign",
                    "example": "[DEFAULT_HEADER]",
                    "type": "string"
                  },
                  "htmlContent": {
                    "description": "Body of the message (HTML version). If the campaign is designed using Drag & Drop editor via HTML content, then the design page will not have Drag & Drop editor access for that campaign. **REQUIRED if htmlUrl is empty**\n",
                    "example": "<!DOCTYPE html> <html> <body> <h1>Confirm you email</h1> <p>Please confirm your email address by clicking on the link below</p> </body> </html>",
                    "type": "string"
                  },
                  "htmlUrl": {
                    "description": "Url which contents the body of the email message. **REQUIRED if htmlContent is empty**\n",
                    "example": "https://html.domain.com",
                    "format": "url",
                    "type": "string"
                  },
                  "increaseRate": {
                    "description": "Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%.\n",
                    "example": 70,
                    "format": "int64",
                    "maximum": 100,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "initialQuota": {
                    "description": "Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.\n",
                    "example": 3000,
                    "format": "int64",
                    "type": "integer"
                  },
                  "inlineImageActivation": {
                    "default": false,
                    "description": "Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than **4MB** with images embedded in the email. Campaigns with the images embedded in the email _must be sent to less than 5000 contacts_.\n",
                    "example": true,
                    "type": "boolean"
                  },
                  "ipWarmupEnable": {
                    "default": false,
                    "description": "**Available for dedicated ip clients**. Set this to true if you wish to warm up your ip.\n",
                    "example": true,
                    "type": "boolean"
                  },
                  "mirrorActive": {
                    "description": "Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign",
                    "example": true,
                    "type": "boolean"
                  },
                  "name": {
                    "description": "Name of the campaign",
                    "example": "Newsletter - May 2017",
                    "type": "string"
                  },
                  "params": {
                    "additionalProperties": {},
                    "description": "Pass the set of attributes to customize the type classic campaign. For example: **{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}**. Only available if **type** is **classic**. It's considered only if campaign is in _New Template Language format_. The New Template Language is dependent on the values of **subject, htmlContent/htmlUrl, sender.name & toField**\n",
                    "example": {
                      "FNAME": "Joe",
                      "LNAME": "Doe"
                    },
                    "type": "object"
                  },
                  "previewText": {
                    "description": "Preview text or preheader of the email campaign",
                    "example": "Thanks for your order!",
                    "type": "string"
                  },
                  "recipients": {
                    "description": "Segment ids and List ids to include/exclude from campaign",
                    "properties": {
                      "exclusionListIds": {
                        "description": "List ids which have to be excluded from a campaign",
                        "items": {
                          "example": 8,
                          "format": "int64",
                          "type": "integer"
                        },
                        "type": "array"
                      },
                      "exclusionSegmentIds": {
                        "description": "Segment ids which have to be excluded from a campaign.\n",
                        "items": {
                          "example": 13,
                          "format": "int64",
                          "type": "integer"
                        },
                        "type": "array"
                      },
                      "listIds": {
                        "description": "Lists Ids to send the campaign to. **Campaign should only be updated with listIds if listIds were used to create it. REQUIRED if already not present in campaign and scheduledAt is not empty**\n",
                        "items": {
                          "example": 32,
                          "format": "int64",
                          "type": "integer"
                        },
                        "type": "array"
                      },
                      "segmentIds": {
                        "description": "**Mandatory if listIds are not used. Campaign should only be updated with segmentIds if segmentIds were used to create it.** Segment ids to send the campaign to.\n",
                        "items": {
                          "example": 23,
                          "format": "int64",
                          "type": "integer"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  "recurring": {
                    "default": false,
                    "description": "**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\n",
                    "example": false,
                    "type": "boolean"
                  },
                  "replyTo": {
                    "description": "Email on which campaign recipients will be able to reply to",
                    "example": "support@myshop.com",
                    "format": "email",
                    "type": "string"
                  },
                  "scheduledAt": {
                    "description": "UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.** If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part).\n",
                    "example": "2017-06-01T12:30:00+02:00",
                    "type": "string"
                  },
                  "sendAtBestTime": {
                    "description": "Set this to true if you want to send your campaign at best time. Note:- **if true, warmup ip will be disabled.**\n",
                    "example": true,
                    "type": "boolean"
                  },
                  "sender": {
                    "description": "Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example: **{\"name\":\"xyz\", \"email\":\"example@abc.com\"}** **{\"name\":\"xyz\", \"id\":123}**\n",
                    "properties": {
                      "email": {
                        "description": "Sender email from which the campaign emails are sent",
                        "example": "newsletter@myshop.com",
                        "format": "email",
                        "type": "string"
                      },
                      "id": {
                        "description": "Select the sender for the campaign on the basis of sender id. **In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email)**.\n",
                        "example": 3,
                        "format": "int64",
                        "type": "integer"
                      },
                      "name": {
                        "description": "Sender Name from which the campaign emails are sent",
                        "example": "Mary from MyShop",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "splitRule": {
                    "description": "Add the size of your test groups. **Mandatory if abTesting = true & 'recipients' is passed**. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else\n",
                    "example": 50,
                    "format": "int64",
                    "maximum": 50,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "subject": {
                    "description": "Subject of the campaign",
                    "example": "Discover the New Collection !",
                    "type": "string"
                  },
                  "subjectA": {
                    "description": "Subject A of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value\n",
                    "example": "Discover the New Collection!",
                    "type": "string"
                  },
                  "subjectB": {
                    "description": "Subject B of the campaign. **Mandatory if abTesting = true**. subjectA & subjectB should have unique value\n",
                    "example": "Want to discover the New Collection?",
                    "type": "string"
                  },
                  "tag": {
                    "description": "Tag of the campaign",
                    "example": "Newsletter",
                    "type": "string"
                  },
                  "toField": {
                    "description": "To personalize the **To** Field. If you want to include the first name and last name of your recipient, add **{FNAME} {LNAME}**. These contact attributes must already exist in your Brevo account. If input parameter **params** used please use **{{contact.FNAME}} {{contact.LNAME}}** for personalization\n",
                    "example": "{FNAME} {LNAME}",
                    "type": "string"
                  },
                  "unsubscriptionPageId": {
                    "description": "Enter an unsubscription page id. The page id is a 24 digit alphanumeric id that can be found in the URL when editing the page.\n",
                    "example": "62cbb7fabbe85021021aac52",
                    "type": "string"
                  },
                  "updateFormId": {
                    "description": "**Mandatory if templateId is used containing the {{ update_profile }} tag**. Enter an update profile form id. The form id is a 24 digit alphanumeric id that can be found in the URL when editing the form.\n",
                    "example": "6313436b9ad40e23b371d095",
                    "type": "string"
                  },
                  "utmCampaign": {
                    "description": "Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed",
                    "example": "NL_05_2017",
                    "type": "string"
                  },
                  "winnerCriteria": {
                    "description": "Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed\n",
                    "enum": [
                      "open",
                      "click"
                    ],
                    "example": "open",
                    "type": "string"
                  },
                  "winnerDelay": {
                    "description": "Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerDelay` is ignored if passed\n",
                    "example": 50,
                    "format": "int64",
                    "maximum": 168,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "description": "Values to update a campaign",
          "required": true
        },
        "responses": {
          "204": {
            "content": {},
            "description": "Email campaign updated"
          },
          "400": {
            "$ref": "#/components/responses/errorModel"
          },
          "404": {
            "$ref": "#/components/responses/errorModel"
          }
        },
        "summary": "Update an email campaign",
        "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"
      }
    },
    "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
    }
  }
}
```