# HubSpot Goals API - How to retrieve data?

**URL:** <https://community.hubspot.com/t/hubspot-goals-api-how-to-retrieve-data/128860>\
**Category:** APIs & Integrations\
**Tags:** python\
**Created:** [March 28, 2025, 11:40am UTC](https://community.hubspot.com/t/hubspot-goals-api-how-to-retrieve-data/128860 "2025-03-28T11:40:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FedericoG](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@FedericoG](https://community.hubspot.com/u/FedericoG)\
**Post date:** [March 28, 2025, 11:40am UTC](https://community.hubspot.com/t/hubspot-goals-api-how-to-retrieve-data/128860/1 "2025-03-28T11:40:00Z")

</div>

I am trying to retrieve different objects via the HubSpot API in Python. So far, I have retrieved all objects except Goals.

I am unsure why, but I keep getting an Authentication error despite having the right key and CRM.Objects.Goals.Read as a scope in the Private App. I am using exactly the same code as detailed here:  
[Goals - API - Basic - List](https://developers.hubspot.com/docs/reference/api/crm/objects/goals#get-%2Fcrm%2Fv3%2Fobjects%2Fgoal_targets)

From what I can see in the documentation, Goals differs in the sense that OAuth/Private App Auth is somehow not supported?

Do I have to change something so I can retrieve all goals and some properties related to them?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [March 28, 2025, 3:58pm UTC](https://community.hubspot.com/t/hubspot-goals-api-how-to-retrieve-data/128860/2 "2025-03-28T15:58:06Z")

</div>

Hey, @FedericoG I tested with a Private App and Postman, and received a successful response. I think the issue is with the dev docs. They all seem to be (temporarily) missing the auth parameters. I’ll report it to the dev docs team and update here as soon as I get notified that it’s back to its expected state.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![FedericoG](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@FedericoG](https://community.hubspot.com/u/FedericoG)\
**Post date:** [March 31, 2025, 9:38am UTC](https://community.hubspot.com/t/hubspot-goals-api-how-to-retrieve-data/128860/3 "2025-03-31T09:38:28Z")

</div>

Hey Jaycee!  
I tried retrieving the endpoint and also got a positive response. But every time I try to do the same with the HubSpot API library, I get a 401 non-authorized error. If the problem was only the dev docs, then my request should work, right? Or would sorting the dev docs help with the Python library as well?  
I’m not super familiar with API’s and Endpoints, so I’m just asking from a point of total ingenuity here 🙂

---

<div class="post-metadata">

**Author:** ![FedericoG](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@FedericoG](https://community.hubspot.com/u/FedericoG)\
**Post date:** [March 31, 2025, 1:19pm UTC](https://community.hubspot.com/t/hubspot-goals-api-how-to-retrieve-data/128860/4 "2025-03-31T13:19:27Z")

</div>

I forgot to include the code snippet. What I meant to say is that I’m not using an URL and “headers” parameter, but instead using this:

api\_response = client.crm.objects.goals.basic\_api.get\_page(limit, properties, etc)

Where client is

client = hubspot.Client.create(api\_key=“MY-API-KEY”)

I did not get any errors doing that with any other object, except Goals.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [April 2, 2025, 6:24pm UTC](https://community.hubspot.com/t/hubspot-goals-api-how-to-retrieve-data/128860/5 "2025-04-02T18:24:56Z")

</div>

Thanks for that. I’ll update that in my internal request. No matter what, it shouldn’t be asking for `api_key="MY-API-KEY`. — Jaycee

---

<div class="post-metadata">

**Author:** ![FedericoG](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@FedericoG](https://community.hubspot.com/u/FedericoG)\
**Post date:** [April 3, 2025, 6:52am UTC](https://community.hubspot.com/t/hubspot-goals-api-how-to-retrieve-data/128860/6 "2025-04-03T06:52:55Z")

</div>

Hi again, Jaycee!

I’ve been able to sort it out by not using the HubSpot Python library and just calling an URL endpoint with the API. Thank you for the help anyway.
