# Custom Code Workflow Action to read email subject line

**URL:** <https://community.hubspot.com/t/custom-code-workflow-action-to-read-email-subject-line/122193>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [December 10, 2024, 3:18am UTC](https://community.hubspot.com/t/custom-code-workflow-action-to-read-email-subject-line/122193 "2024-12-10T03:18:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NProctor7](https://avatars.discourse-cdn.com/v4/letter/n/5f9b8f/32.png) [@NProctor7](https://community.hubspot.com/u/NProctor7)\
**Post date:** [December 10, 2024, 3:18am UTC](https://community.hubspot.com/t/custom-code-workflow-action-to-read-email-subject-line/122193/1 "2024-12-10T03:18:15Z")

</div>

Hello,

I’m looking for advice on how to trigger a Custom Code Workflow when an email is received so I can parse the subject line. I have 2 questions, what is the best trigger to use, and which API endpoint should I be able to call to get the email subject?  
So far I see only 1 possible trigger and that is when a conversation object is created, but that event only give a conversation id and not an email id.

---

<div class="post-metadata">

**Author:** ![RichardEdward](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/richardedward/32/204645_2.png) [@RichardEdward](https://community.hubspot.com/u/RichardEdward)\
**Post date:** [December 10, 2024, 8:22am UTC](https://community.hubspot.com/t/custom-code-workflow-action-to-read-email-subject-line/122193/2 "2024-12-10T08:22:25Z")

</div>

You can use the “conversation created” trigger to start the Custom Code Workflow. While it gives a conversation ID instead of an email ID. This allows you to parse the subject as needed in your workflow.

---

<div class="post-metadata">

**Author:** ![NProctor7](https://avatars.discourse-cdn.com/v4/letter/n/5f9b8f/32.png) [@NProctor7](https://community.hubspot.com/u/NProctor7)\
**Post date:** [December 10, 2024, 12:09pm UTC](https://community.hubspot.com/t/custom-code-workflow-action-to-read-email-subject-line/122193/3 "2024-12-10T12:09:19Z")

</div>

Which API endpoint can I use to get the subject of the conversation by it Id?
