Need to Export Sales Email Content via API – Blocked by OAuth & API Key Limitations

Hi HubSpot Developer Support,

I’m trying to export 1:1 sales email messages (from, to, subject, body) from my CRM using the crm.objects.emails.read scope or the Legacy Engagements API. Here’s what I’ve attempted:

  • Created an app in the HubSpot Developer Portal.

  • Created a Developer Test Account to install the app.

  • Tried to authorize using the OAuth install URL:

    bash

    CopyEdit

    https://app.hubspot.com/oauth/authorize?client_id=XXXX&redirect_uri=http://localhost:8000&scope=crm.objects.emails.read

  • Received: :cross_mark: “Couldn’t complete the connection – An error occurred while validating the app authorization.”

  • Tried installing the app via test portal and by attaching portalId manually — same result.

  • I cannot use API Keys because:

    • Developer test accounts don’t allow key creation
    • My production XXXXX portal has API keys disabled (HubSpot setting)

:red_exclamation_mark:I urgently need to export email data (not events or metrics — I need message content from sales emails), and I’m blocked by all three paths:

  1. :cross_mark:OAuth not installable into test portal
  2. :cross_mark:API key disabled in my live portal
  3. :cross_mark:Email Events API doesn’t return message content

Can someone at HubSpot manually install the app into my developer test portal, or assist with enabling OAuth testing in this setup?

I am happy to provide:

  • App ID
  • Client ID
  • Redirect URI
  • Test Portal ID

Thank you so much — this is time-sensitive and blocking a data migration/export project.

Hi @mikep! happy Friday!

To ensure you’re working with the latest information, please note that API keys were deprecated in November 2022.

If you are creating a Private App, you can use this guide.

I also want to invite some subject matter experts to see if they have any suggestions for you.

Hey @GRajput , @dsmarion, @Jigar_Thakker do you have any advice for @mikep?

Thanks and happy Friday everyone!

Diana

if you only need to do this on a single portal, a private app is the way to go. It is much simpler to set up and provides you with a private key.