Exporting Emails & Files linked to a deal for all deals

Hi guys,
our company needs to export all the emails & files that are associated to a contact and deal, so they can be uploaded in a different CRM.
I’ve understood this can’t be done by Pipedrive directly, but needs to happen through the API.
Could someone help me with this?
Best,
Willem

Hey @Willem_Peutz,
Welcome to the community :wave:
You can access that information via the following endpoints
https://developers.pipedrive.com/docs/api/v1/Persons#getPersonFiles
https://developers.pipedrive.com/docs/api/v1/Persons#getPersonMailMessages
https://developers.pipedrive.com/docs/api/v1/Deals#getDealFiles
https://developers.pipedrive.com/docs/api/v1/Deals#getDealMailMessages