How to create & update email using REST API – Salesforce Marketing Cloud?

I want to create as well as update an email using REST API.

I am using following documentation links:

  1. POST /asset/v1/content/assets
  2. PUT /asset/v1/content/assets/{id}


I am able to retrieve content using GET API call (GET /asset/v1/content/assets).

However, I am not sure where to put the updated HTML code in my PUT or POST API request. Do I have to put it in URL or I have to put it in BODY of the API request? If BODY, then what would be the structure of the BODY? How my JSON would look like?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

An example provided in the docs for adding content is below:

  "name": "NTO Welcome Series Email",
  "channels": {
    "email": true,
    "web": false
  "views": {
    "html": {
      "content": "<!DOCTYPE html><body>This is a simple message.</body></html>"
    "text": {},
    "subjectline": {},
    "preheader": {}
  "assetType": {
    "name": "templatebasedemail",
    "id": 207

You would set your new/updated html into the ‘content’ (views > html > content) section of the above JSON.

You can also view more samples here – including HTML Paste, Simple Template based and Complex template based emails.

Method 2

I used Apex to update the content of a Html Email Template (AssetId = 208): on the code i have to use this header ‘request.setHeader(‘X-HTTP-Method-Override’,’PATCH’)’ and made a POST action on the request to get success, and the json example is the following:

         "content":"Here goes the html code of the template"

the url to call is the one that you mention:

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x