# Fetching contact's email conversations via API

**URL:** <https://community.hubspot.com/t/fetching-contacts-email-conversations-via-api/94905>\
**Category:** APIs & Integrations\
**Tags:** email, contacts\
**Created:** [November 28, 2023, 8:10am UTC](https://community.hubspot.com/t/fetching-contacts-email-conversations-via-api/94905 "2023-11-28T08:10:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CSamarakoon](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@CSamarakoon](https://community.hubspot.com/u/CSamarakoon)\
**Post date:** [November 28, 2023, 8:10am UTC](https://community.hubspot.com/t/fetching-contacts-email-conversations-via-api/94905/1 "2023-11-28T08:10:24Z")

</div>

Requirement is, when contact’s ID is given fetch all the emails sent and received by the perticular client.

Fetching sent emails is an easy task with the engagement API + hs\_email\_to\_email == “contact’s email” filter.

Issue is getting the received emails. In the received emails both hs\_email\_sender\_email and hs\_email\_to\_email is same. Therefore cannot identify the sender of the email. Workaround is to fetch all the emails and do an another query for email to get the assosicated contact ID. This method is not very efficient so I’m wondering if there is any another way to list out the emails for a selected contact

---

<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:** [November 29, 2023, 10:41pm UTC](https://community.hubspot.com/t/fetching-contacts-email-conversations-via-api/94905/2 "2023-11-29T22:41:15Z")

</div>

Hi, @CSamarakoon 👋 Thanks for your question.

I believe you are correct in your analysis. You’ve touched on a limitation of the HubSpot APIs. Namely, that there might not be a straightforward way to efficiently fetch only the received emails for a contact without additional processing.

One random thought – Does your system have knowledge of the email addresses used by your organization? You may be able to programmatically detect if an email is received by checking if the `hs_email_sender_email` is not one of your organization’s email addresses.

While you’ll likely need to utilize multiple calls, hopefully someone from our community has a more efficient or different approach to what you are needing to do.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![CSage](https://avatars.discourse-cdn.com/v4/letter/c/e9c0ed/32.png) [@CSage](https://community.hubspot.com/u/CSage)\
**Post date:** [December 19, 2023, 4:35pm UTC](https://community.hubspot.com/t/fetching-contacts-email-conversations-via-api/94905/3 "2023-12-19T16:35:31Z")

</div>

Hello,

I am observing the same issue for received emails: the hs\_email\_sender\_email is not the email address of the person out of my organization that sends us the email but instead the email address of the receiver.

Could you please fix it ?

For information, this is the endpoint that I am requesting:

`"/crm/v3/objects/emails/batch/read"`

Best,

Clément
