APIs & Integrations

nickgi
Contributor | Diamond Partner
Contributor | Diamond Partner

Clone endpoint for templates

SOLVE

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?

0 Upvotes
1 Accepted solution
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Clone endpoint for templates

SOLVE

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!


✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

0 Upvotes
6 Replies 6
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Clone endpoint for templates

SOLVE

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!


✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes
Teun
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Clone endpoint for templates

SOLVE

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



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes
evaldas
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Clone endpoint for templates

SOLVE

@Teun  looks like you posted a reply as I was typing mine 😁 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. 


✔️ Did this post help answer your query? Help the community by marking it as a solution.

Teun
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Clone endpoint for templates

SOLVE

Oh wow that is amazing! Great to know.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


Teun
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Clone endpoint for templates

SOLVE

Hi @nickgi ,

 

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

Schermafbeelding 2024-10-04 om 21.45.59.png

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). 



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


nickgi
Contributor | Diamond Partner
Contributor | Diamond Partner

Clone endpoint for templates

SOLVE

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.

0 Upvotes