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 Name | Type | Description | Example | Required? |
---|---|---|---|---|
api-key | String | API key for authentication | 41a1de35948f915f64907ced9eed4f00 | Yes |
Request Body
All necessary parameters should be passed in the request body in JSON format.
Body Parameter | Data Type | Description | Required? |
---|---|---|---|
campaign_details | Array[Object] | Represent each campaign to be created. The channel for which you are trying to create the campaign for. | Yes |
channel | String | The channel for which the campaign is being created. | Yes |
campaign_name | String | A unique name for the campaign | Yes |
callback_details | Object | Specify callback information. | No |
body | Array(Object) | Details to be included in the callback body. | Yes |
header | Array(Object) | Headers to be included in the callback request. | Yes |
frequency_capping | Object | Specify frequency capping details. This includes enable_frequency_capping. The boolean value indicates if frequency capping is enabled. | No |
sender_details | Object | Specify sender details. this included sender_name and sender_email . | Yes |
sender_name | Name of the sender. | Yes | |
sender_email | Email of the sender. | Yes | |
audience_details | Object | Specify details of the audience to be included or excluded. This includes include_list , exclude_list , seg_ids , list_ids , and udt_id . | Yes |
exclude_list | Object | Contains segments or list to be excluded from the campaign. | No |
include_list | Object | Contains segments or lists to be included. | Yes |
limit | Integer | Specify to limit the number of audiece. | No |
content_details | Object | Specify the email content details. This includes: subject_line , template_id , and content_source_url . | Yes |
template_id | Integer | Specify the template ID used for the campaign content. | Yes Note: You can either opt for template_id or content_source_url. |
content_source_url | String | Specify the url where the content of the campaign is hosted. | Yes Note: You can either opt for template_id or content_source_url |
subject_line | String | Specify the subject line for your campaign. | Yes |
schedule_time | String | Specify 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 |
tags | Array(String) | Additional tags for tracking . | No |
campaign_state | String | Status 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_id | Integer | The 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 Code | Description |
---|---|
200 | Successful response. The campaign has been created. |
400 | Invalid request parameters. |
500 | An error occurred on the server side. |
Updated 3 months ago