# How to retrieve all imported e-mail addresses?

**URL:** <https://community.hubspot.com/t/how-to-retrieve-all-imported-e-mail-addresses/17501>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [December 2, 2019, 1:13pm UTC](https://community.hubspot.com/t/how-to-retrieve-all-imported-e-mail-addresses/17501 "2019-12-02T13:13:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![franknesse](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/franknesse/32/97834_2.png) [@franknesse](https://community.hubspot.com/u/franknesse)\
**Post date:** [December 2, 2019, 1:13pm UTC](https://community.hubspot.com/t/how-to-retrieve-all-imported-e-mail-addresses/17501/1 "2019-12-02T13:13:27Z")

</div>

I understand that there is no api equivalent for the ‘Export unsubscribes and bounces’ (yet) and that the alternative way is to get all contacts and then use the get\_status method for each contact. But I noticed that email addresses that were imported via the ‘Import opt-out list’ feature are not considered a contatc and therefore not included in Get all contacts.

Is there API-way to retrieve such non-contact e-mail addresses?

---

<div class="post-metadata">

**Author:** ![jackcoldrick](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jackcoldrick/32/5119_2.png) [@jackcoldrick](https://community.hubspot.com/u/jackcoldrick)\
**Post date:** [December 2, 2019, 5:18pm UTC](https://community.hubspot.com/t/how-to-retrieve-all-imported-e-mail-addresses/17501/2 "2019-12-02T17:18:50Z")

</div>

Hi @franknesse,

One way to do this would be to use the"[View subscriptions timeline for a portal](https://developers.hubspot.com/docs/methods/email/get_subscriptions_timeline)" endpoint. This will return a time-ordered list of subscription changes. Emails included as an opt out list will show here aswell. The payload will typically contain an array of objects signifying the subscription event.

```auto
 {
 "portalId": 2990812,
 "recipient": "coldrickjackhubspot2020@gmail.com",
 "changes": [
 {
 "change": "UNSUBSCRIBED",
 "source": "SOURCE_IMPORT",
 "portalId": 2990812,
 "causedByEvent": {
 "id": "db38e08e-b9de-496d-a15a-2b1aeeb06895",
 "created": 1575306951484
 },
 "changeType": "PORTAL_STATUS",
 "timestamp": 1575306951484
 }
 ],
 "normalizedEmailId": "b8bb79c4-838c-44ec-a4af-6b8c635e1c83",
 "timestamp": 1575306951484
 }

```

In the above example the email [coldrickjackhubspot2020@gmail.com](mailto:coldrickjackhubspot2020@gmail.com) was imported via opt out list. This is further denoted by the source parameter:

`"source": "SOURCE_IMPORT"`

You can also use the option parameter “changeType=X” to return specified types of changes. For example a request like the below will return all subscription events whereby an individual was either SUBSCRIBED or UBSUBSCRIBED.

`https://api.hubapi.com/email/public/v1/subscriptions/timeline?hapikey={{apikey}}&changeType=PORTAL_STATUS`

So if you put all of that together you can use the “[View Subscription Timeline for a portal](https://developers.hubspot.com/docs/methods/email/get_subscriptions_timeline)” to get a time ordered list of subscription changes. You can specifically get the SUBSCRIBE and UNSUBSCRIBE events using the optional parameter “changeType=PORTAL\_STATUS” and then use the “source” to understand if it was the result of an opt out list being imported.

I hope this is of some help!

Regards,

Jack

---

<div class="post-metadata">

**Author:** ![franknesse](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/franknesse/32/97834_2.png) [@franknesse](https://community.hubspot.com/u/franknesse)\
**Post date:** [December 4, 2019, 8:19am UTC](https://community.hubspot.com/t/how-to-retrieve-all-imported-e-mail-addresses/17501/3 "2019-12-04T08:19:21Z")

</div>

Thanks @jackcoldrick , this looks like what I need.
