List email messages attached to deal/person returns data:null althrough email_messages_count > 0


I’m trying to get the mail messages attached to a deal or person but always getting

	"success": true,
	"data": null,
	"additional_data": {
		"filesCountByDay": [],
		"pagination": {
			"start": 0,
			"limit": 100,
			"more_items_in_collection": false

when I try to call /v1/persons/1007/mailMessages or /v1/deals/8808/mailMessages.

I see the E-Mail Messages attached in the UI and through the API with /v1/persons/1007
"email_messages_count": 13,
so the messages should definitively be there, but the /mailMessages endpoint gives me nothing.

The e-mail sync is setup for gmail and the mail communication in general is working through the pipedrive UI. Any Idea /mailMessages endpoint does not give me back any data?

Hi Pats and welcome to the DevCommunity,

this behavior is not expected and we’d need to investigate it as we could not reproduce it. We suspect that the person and deal might not be correctly linked.
Could you please contact Pipedrive support to help troubleshoot further? Alternatively you can share your Company ID (or domain you are using) and User ID under with you are sending the request with me in direct message.

Best regard

@david.brnovjak thx for the quick response and suggestion. I’ve contacted the support in the meantime. The problem was that e-mail sharing was not activated in the settings so our service-account, which we use for API calls, had no permission to see the mails from the broker accounts.

1 Like