Owners API

There are a few things about the available “Owners” API endpoints that are making our job hard for the integration we’ve created… and I’m wondering if there’s something we are missing, or if there are any workarounds.

---

Problem number 1:

In our app, we allow users to connect to their HubSpot account, and pull in (an unknown number of) deals through the API. For every deal that we retrieve, we also then retrieve the Owner object for each deal (based on the

deal.hs_owner_id

property of each one).

In our case, some users are retrieving around 10 deals (and their owners)… and some are retrieving multiple thousands.

So let’s say a user of our app retrieves 300 deals… and our app sees that there are 20 unique owner IDs attached to those deals. Our only options for getting those are:

  • make 20 individual requests to the

    /crm/v3/owners/{ownerId}

    endpoint

  • or make an unknown number of requests to the

    /crm/v3/owners

    (list) endpoint… and keep retrieving pages… until we’ve found all 20 owners that we need.

    • But in this case… we have no way of knowing just how many owners exist in their account. The response does not include a

      total

      property, like the other CRM object endpoints do! For all we know, we might end up requesting more than 20 pages of owners before we find the ones we need!

---

Problem number 2:

Another problem we are running into is that we need to retrieve the deal Owners’ information whether the Owner has been archived or not. But there’s no way to ask the API for owners (either individually or in bulk) without first knowing if the owner is archived. If we pass

?archived=true

it only gives us archived Owners. If we pass

?archived=false

it only gives us un-archived Owners. But there’s no option for passing

?archived=any

(or similar) when we don’t know whether the owner(s) we’re looking for are archived or not—all we have is the ID(s).

So then our only option is to make calls with

?archived=false

… and then if we don’t find the one(s) we need, make MORE calls with

?archived=true

---

Problem number 3:

Sometimes a single owner ID shows up BOTH as

“archived”: true

AND as

“archived”: false

.

Sometimes when using the “list owners” API endpoint, and passing

?archived=true

it will return some of the owners in the list… but they will have the

“archived”

property set to

false

. Seeing that this is odd… we then ask for a list of owners with

?archived=false

. … and we’ll see the SAME owner ID showing up in the response there, too (still with

“archived”: false

).

Or, sometimes we’ll ask for a single owner by its ID (

/crm/v3/owners/37199907?archived=false

) and it will respond with the owner’s information, saying

“archived”: false

and

“userId”:

3643951

, but then if we make ask for the SAME owner ID, but archived (

/crm/v3/owners/37199907?archived=true

) it will still return the owner’s information… but now it will say

“archived”: true

and

“userId”: null

(and perhaps no longer include anything for

“teams”

.)

It seems we have a classic case of Schrödinger’s Cat Owner! Except it’s both alive AND dead even after we open the box :slightly_smiling_face:

---

The Combined Effect…

The combination of those issues makes it very difficult for our app to be efficient about how many requests we’re making.

If a user pulls 9000 deals into our app, which include 2000 unique Owner IDs… we either have to:

  • make 2000-4000 individual requests (1 request for each owner id… plus possibly another request with

    ?archived=true

    , if the first returns a

    404

    )

  • or we have to use the “list owners” endpoint, and keep retrieving page after page until we’ve either seen every owner in the user’s account, or found all 2000 owners that we need

    • and then we still might need to repeat that process a second time, with

      ?archived=true

      , and page through all of those results too.

---

Possible solutions?

Ideally, there would be a “batch read” owners API endpoint, where we could ask for the specific set of owner IDs that we need to retrieve.

And ideally there’d be some way to specify that we want to retrieve the owners regardless of whether they have been archived.

Or perhaps some of this is already currently possible, and we’re just missing it?

Thanks!

Hello @daveh_dev, thank you for posting in our Community and providing all the details.

I want to share this doc with more details about** Owners API** and invite some top experts to share their thoughts. @coldrickjack @Brownstephen101 any recommendations to @daveh_dev ?

Thank you,

Pam

Same issue as above, Problem 2 - how is there not an option for passing

?archived=any

(or similar).