Update Email Template

Learn to update email template with API

This API allows you to update existing email templates across various channels. This is currently supported exclusively for email channels.

HTTP Method

This API uses the POST method to update a existing email template.

API Endpoint

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

Request Header

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?Part of Body Parameter
channelstringSpecifies the platform for the template. For example: emailYes
template_idintegerTemplate ID of the template to be updated.Yes
statusstringStatus of the template, either "active" or "archive".No
template_content_meta_dataobjectContains metadata about the template content.Yes
typestringIntake type, either "URL" or "inline". Only one can be used; choosing one excludes the other.Yestemplate_content_meta_data
encodingstringSpecifies encoding as "base64" or left blank.
Note: If "base64" encoding is specified, the content within the content block (inline_html or amp_inline_html), must adhere to base64 encoding standards.
Notemplate_content_meta_data
categorystringOptional category for the template. If unspecified, the template remains uncategorized.Notemplate_content_meta_data
template_content_blockobjectContains the actual content for the template.Yes
html_urlstringURL for HTML content, applicable when type is "url".Notemplate_content_block
inline_htmlstringInline HTML content, applicable when type is "inline".Notemplate_content_block
amp_urlstringAMP HTML URL, applicable when type is "url".Notemplate_content_block
amp_inline_htmlnullAMP HTML inline content, applicable when type is "inline" for AMP templates.Notemplate_content_block
template_namestringRequired name of templateYes

Example Request Body

{
  "status": "active",
  "channel": "email",
  "template_id": 20,
  "template_content_block": {
    "amp_url": "",
    "html_url": "",
    "inline_html": "<<html content>>",
    "template_name": "Updated Template"
  },
  "template_content_meta_daa": {
    "type": "inline",
    "category": "Marketing",
    "encoding": "base64"
  }
}

Response & Error Codes

Error CodeDescriptionExample Sample
200The request was successful, and the template was created.{ "data": { "status": "string", "description": "string", "template_id": "1223" }, "message": "string", "statusCode": 0 }
400The request was invalid. Check the request parameters and body for errors.{ "statusCode": 0, "message": "string" }
500An error occurred on the server while processing the request.{ "statusCode": 0, "message": "string" }