Get a deal by property


#1

Hi everyone, the question is simple: is there a way to get a specific deal by property? so far I haven't found a way and I'm afraid I'd need to get ALL the deals and search one by one to find those which match with a property.

Cheers,
David


#3

Hey @david.garcia, you're correct that there's not currently a way to get only one deal by property. Fundamentally in HubSpot in the UI, this is also not possible. When you create a filter or query your CRM for a specific property on a deal, you're looking for all contacts that match your search parameters. More often than not there will be more than one contact that matches your search parameters and if your search does only return one contact, then that's more happenstance than anything. It would be strange if you searched for a Deal in the UI and there were more than one that had the word "October" in it, yet we only returned one deal. We subsequently haven't built that into our APIs.

You can get Deals by property by using the get all deals endpoint, and including whichever properties you're looking for in your request URL. For example:

https://api.hubapi.com/deals/v1/deal/paged?hapikey=demo&limit=50&properties=dealname

You can string multiple together by using the syntax &properties=property_x&properties=property_y