Update Campaign API

Learn to update existing campaign using this API

This API allows you to modify the details of an existing email campaign. This API provides campaign configuration, allowing you to define sender information, content, and audience targeting. With flexible scheduling, you can set campaigns for optimal delivery times and implement frequency capping to avoid over-communicating with your audience.

HTTP Method

This API uses the POST method to update existing email campaigns.

API Endpoint

The Update Campaign API is available across multiple regions; below are the base URLs for different regions:

Request Headers

Authentication details are required to access the API. Ensure you include the necessary tokens or credentials in your request headers.

Header NameTypeDescriptionExampleRequired?
api-keyStringAPI key for authentication41a1de35948f915f64907ced9eed4f00Yes

Request Body

All necessary parameters should be passed in the request body in JSON format.

Body ParameterData TypeDescriptionRequired?
campaign_detailsArray[Object]Represent each campaign to be created. The channel for which you are trying to create the campaign for.Yes
channelStringThe channel for which the campaign is being created.Yes
campaign_nameStringA unique name for the campaignYes
callback_detailsObjectSpecify callback information.No
bodyArray(Object)Details to be included in the callback body.Yes
headerArray(Object)Headers to be included in the callback request.Yes
frequency_cappingObjectSpecify frequency capping details. This includes enable_frequency_capping. The boolean value indicates if frequency capping is enabled.No
sender_detailsObjectSpecify sender details. this included sender_name and sender_email.Yes
sender_nameName of the sender.Yes
sender_emailEmail of the sender.Yes
audience_detailsObjectSpecify details of the audience to be included or excluded. This includes include_list, exclude_list, seg_ids, list_ids, and udt_id.Yes
exclude_listObjectContains segments or list to be excluded from the campaign.No
include_listObjectContains segments or lists to be included.Yes
limitIntegerSpecify to limit the number of audiece.No
content_detailsObjectSpecify the email content details. This includes: subject_line, template_id, and content_source_url.Yes
template_idIntegerSpecify the template ID used for the campaign content. Yes
Note: You can either opt for template_id or content_source_url.
content_source_urlStringSpecify the url where the content of the campaign is hosted.Yes
Note: You can either opt for template_id or content_source_url
subject_lineStringSpecify the subject line for your campaign.Yes
schedule_timeStringSpecify the time when the campaign should be sent. If scheduling is not required, this can be set to "now". The format should be YYYY-MM-DDTHH:MM:SSZ.Yes
tagsArray(String)Additional tags for tracking .No
campaign_stateStringStatus of the campaign. The available options are draft (campaign is still being configured and not ready to be sent.)and active(campaign is ready to be sent.).Yes
campaign_idIntegerThe ID of the campaign to be updated.Yes

Example Request Body

{
  "campaign_details": [
    {
      "channel": "email",
      "campaign_id": 381,
      "campaign_name": "Update-Email Campaign with API",
      "campaign_state": "schedule"
    }
  ]
}

Response

Example Response

{
  "data": {
    "id": 881,
    "status": "success",
    "request_id": "a805e14f-77d0-0d7f-1166-ae5f012b2d2d",
    "description": "Campaign updated successfully with campaign id 881"
  },
  "message": "Campaign updated successfully with campaign id 881",
  "statusCode": 200
}
{
  "data": {
    "id": 881,
    "status": "error",
    "request_id": "2b3dfe19-c14e-b5b3-c933-dd12654e5b77",
    "description": "Campaign update failed. 'campaign_state' field is either missing or invalid. Allowed values are 'draft' or 'schedule'."
  },
  "message": "Campaign update failed. 'campaign_state' field is either missing or invalid. Allowed values are 'draft' or 'schedule'.",
  "statusCode": 600
}

Error Codes

Error CodeDescription
200Successful response. The campaign has been created.
400Invalid request parameters.
500An error occurred on the server side.