Retrieve Emails from Leads using V8 API

Hello SuiteCRMers. I’m trying the new JSON API but I’m struggling my head trying tof ind how to retrieve emails related to a Lead.

After retrieving V8/module/Leads, no emails are attached, those fields are empty.
After retrieving V8/module/EmailAddresses, there is no information about which entitity does the email correspond to.

Any help? Thank you!

Hi, welcome.

Sorry for the delay.

I don’t know about the API, but in the database you would get that from the middle table in the relationship between Leads and EmailAddresses. That table is called email_addr_bean_rel

Can you figure out how to get that through the API?