Re: Update email and landing page content sections via REST API

Level 1

Update email and landing page content sections via REST API


I'm trying to update via REST API the content of emails and landing pages but I'm getting strange errors when I'm trying to do it.

For Email content I have this section:

"htmlId": "Banner2",
"value": {
"value": "",
"width": "640",
"al Text": "banner"
"contentType": "Image",
"parentHtmlId": "Banner",
"isLocked": false

I'm trying to update the link in this section but of course I get the response that the "type" is needed. In Marketo documentation it says that the "type" can only have 3 options: "Text", "DynamicContent" and "Snippet". 

I've tried to use the "Text" type like this:{"value":"","width":"640","altText":"banner"}

But I'm getting this error:

"code": "611",
"message": "Content Type specified is not valid for the component"‍‍

I'm using "application/x-www-form-urlencoded" as Content type on the request.

On a Landing page I'm trying to update the link as well in this section:

"id": "13676",
"type": "Image",
"index": 1,
"content": {
"content": "12577",
"contentType": "File",
"contentUrl": ""
"formattingOptions": {
"height": "200px",
"width": "200px",
"zIndex": 15,
"left": "541px",
"top": "172px",
"imageOpenNewWindow": true

I'm doing this request:{"id":"13676","type":"Image","index":1,"content":{"content":"12577","contentType":"File","contentUrl":""},"formattingOptions":{"height":"200px","width":"200px","zIndex":15,"left":"541px","top":"172px","imageOpenNewWindow":true}}‍‍

And I'm getting this response when the LP is on draft mode:

"code": "709",
"message": "Operation is only allowed on draft landing page content"

Am I doing the request wrong? meaning the parameters are not set properly in the request?

So yes, I'm trying to update links on assets content but the lack of examples on Marketo documentation is not helping.

Could anyone with experience on updating assets via REST API could please help?

Thank you,


Level 8 - Community Advisor

Re: Update email and landing page content sections via REST API

You are doing it wrong. To update the image link on the LP, you do not really have to pass a jSON object like this. Just try following:<id of the image in Marketo>

A few point:

  • The Id highlighted in green, should be the landing page id
  • The ID in the red, should be content ID. It is the HTML ID of the section. Ideally it's more descriptive like "header image" or "Logo" or something. So make sure you are using the right ID here.
  • The value parameter, in Blue above,should be the Marketo ID of the image i.e. if the image doesn't exists in Marketo, first upload that and find out the ID of the asset from the Marketo from design studio link. See example below:pastedImage_18.png

You have to do similar thing for Email as well. Try and let me know if you still face any issue.

Level 1

Re: Update email and landing page content sections via REST API

Hi Amit,


It works for images that are hosted on Marketo, so thank you.


I was trying to use an externalURL for the image so I was trying to send in the request body:



I get a success message but the previous image is deleted and the new one is not added. So it acts like an image removal.


When i add this image from Marketo interface, it's visible in the asset. 


Do you have an idea how to solve this issue?


Thank you,