APIs & Integrations

cbarnes199
Member

Get List of Contacts that have opted out

What is the best api if I want to get the list of contacts who have opted out? I could not get this by using the opt out property on the contacts api.

0 Upvotes
3 Replies 3
3PETE
HubSpot Employee
HubSpot Employee

Get List of Contacts that have opted out

@cbarnes199 There are a couple of different ways you can do this.

  1. Is Using the get all contacts end point. Here is an example for that
    https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=xxxxx&property=hs_email_optout

This would give you all the contact with that property. Then you could sort out the results of the API call.

  1. The other way would be to build the list with in hubspot and then hit the lists end point and pull that exact list back.

Here is an example of the get all contacts in a list

https://api.hubapi.com/contacts/v1/lists/115/contacts/all?hapikey=xxxxx

ArcherMehr
Member

Get List of Contacts that have opted out

Hi There , Wondering if there is any way we could fetch the recent Opeted Out Contact and not all the list by Passing some parameter such as time stamp ? 

 

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Get List of Contacts that have opted out

Hi, @ArcherMehr.

 

Your use case isn't quite possible with the methods above, but you could try using this Email Subscription API endpoint, which gives you a feed of all subscription changes in an account, including UNSUBSCRIBED events.

Isaac Takushi

Associate Certification Manager
0 Upvotes