Clone endpoint for templates

We are needing to duplicate a whole bunch of Email Templates into various languages (11 langs x 15 templates = 165 new templates). I noticed there’s no clone endpoint (like the one on email marketing) for templates in the api. Does anyone have a suggestion so I don’t need to create 165 templates via the UI?

Hi @nickgi ,

I might have misunderstood your question, but there is an option to clone a marketing e-mail:

Or are you talking about the Saved marketing email templates?

I don’t think there is an API for that, but you could rebuild your saved template as a coded email template with drag-and-drop functionality and clone that programmatically through the templates API by making a GET request to the original and simply creating new ones through a POST request using the response of the GET request (might need some small changes).

Thanks for the reply. I specifically looking to clone templates under Library → Templates. I was aware of the email marketing clone endpoint and it worked great. But now I need to clone the templates and couldn’t find an endpoint.

Hi @nickgi,

Assuming you want to clone the drag-and-drop email templates, you can utilize the Content API for templates. There is no end point for cloning but you can retrieve template using the GET /content/api/v2/templates/{template-id} endpoint and then create your modified versions by using the POST /content/api/v2/templates.

You can get the id of your drag-and-drop template in the URL when editing that template.

Hope this helps!

Are we saying the same thing or did I miss something and can this be used to clone the templates under ‘Library > Templates’?

@Teun looks like you posted a reply as I was typing mine :grin: We are saying almost the same thing - I think the only difference from your reply is that you actually may not need to rebuild it as a coded email template. The drag and drop templates technically get saved as coded email templates in the “@hubsopt” folder but they aren’t accessible in the design manager. However, you can get them via the API if you know the ID of that template.

Oh wow that is amazing! Great to know.