# Marketing Email API questions

**URL:** <https://community.hubspot.com/t/marketing-email-api-questions/95088>\
**Category:** APIs & Integrations\
**Tags:** marketing-email\
**Created:** [November 29, 2023, 9:48pm UTC](https://community.hubspot.com/t/marketing-email-api-questions/95088 "2023-11-29T21:48:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MH1279](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@MH1279](https://community.hubspot.com/u/MH1279)\
**Post date:** [November 29, 2023, 9:48pm UTC](https://community.hubspot.com/t/marketing-email-api-questions/95088/1 "2023-11-29T21:48:52Z")

</div>

So I have a script that I’m running to create dataframe table visualizations that I want to somehow place in a cloned marketing email draft, whether as images or some sort of table. Is this something that is possible through the marketing email api? I’m not sure what formatting is accepted when updating the body of a marketing email as there isn’t too much documentation

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 1, 2023, 5:26pm UTC](https://community.hubspot.com/t/marketing-email-api-questions/95088/2 "2023-12-01T17:26:55Z")

</div>

Hey, @MH1279 👋 Thanks for your question.

Regarding your code, please share what you’ve already tried, even if it didn’t work as expected. This can be helpful when asking the community for help.

@Anton @tjoyce [@Phil\_Vallender](https://community.hubspot.com/t5/user/viewprofilepage/user-id/74) have you tried anything similar? Or do you have any suggestions on other ways @MH1279 might approach this challenge?

Thank you for taking a look! — Jaycee

---

<div class="post-metadata">

**Author:** ![MH1279](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@MH1279](https://community.hubspot.com/u/MH1279)\
**Post date:** [December 1, 2023, 9:09pm UTC](https://community.hubspot.com/t/marketing-email-api-questions/95088/3 "2023-12-01T21:09:48Z")

</div>

I was checking to see if it’s possible to insert a python dataframe or visuals from python directly into a marketing email draft through the API

---

<div class="post-metadata">

**Author:** ![RubenBurdin](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rubenburdin/32/75212_2.png) [@RubenBurdin](https://community.hubspot.com/u/RubenBurdin)\
**Post date:** [September 5, 2025, 4:07am UTC](https://community.hubspot.com/t/marketing-email-api-questions/95088/4 "2025-09-05T04:07:15Z")

</div>

That’s a good question to revisit in 2025, because the Marketing Email API has expanded since 2023.

Right now, you still can’t insert a live dataframe or Python object directly into a HubSpot email draft. The API accepts HTML for the email body, so your safest path is to render your dataframe or visualization to an image (PNG/JPEG), upload it to HubSpot’s File Manager through the Files API, and then reference that hosted file in your email body HTML. Tables can also be hard-coded as HTML, but not passed in as Python objects.

If your goal is dynamic data insertion, in 2025 HubSpot’s custom modules and CMS Hub email templates give you more flexibility you can design a custom module with a placeholder for images or tables and then update that module content programmatically via API before sending. This way you don’t fight against formatting limits of the email editor.

A clarifying point: are you hoping these visualizations refresh automatically in recurring sends, or are you just trying to automate populating them once into a draft? That choice will change whether you lean on pre-generated static images versus building a reusable module fed by new files.
