Finding Deals by array of IDs

I was wondering if anybody knew a way to run a search on deals that matched an array of Ids. Something similar to a SQL query (where the id field is an array of pipedrive deal IDs):

SELECT * FROM deals WHERE id IN [1,2,3,4]

I’m also using the Node pipedrive package if that helps.

I don’t think there’s a way to do this other than trying to do a get request for each of those ids. But if you tell a bit more about why you need to do this in the first place, we could find a better answer :thinking:

@dani Thanks for the brainstorm. I’m looking to match up deal data for an internal report. I would like to see lost reason, closing agent, etc for a list of deals based on the Pipe deal ID that we have stored on our system. It’s really inefficient to have to get allDeals and then manually filter them down based on IDs.

I understand…

Just to clarify, you don’t need to get all deals, you can get just the ones you need one by one using the /deals/{id} endpoint.

Hi @dani,

I need to get about 30+ in one call. I don’t think the individual deal id endpoint is going to be any more efficient than recursively fetching all my deals and then filtering them responses. Is there any type of request that can be constructed with the search endpoint?

I don’t think so :thinking:

…but I was also thinking that one more way to do that (if it works with your flow) could be setting a webhook on Something like:

  1. The webhook contacts your page everytime a deal is updated
  2. You check if the id of the updated deal is one of the relevant ones you have stored
  3. You update the info that you need for that deal

Doing this you’d always have the data in real time ready to generate the report when you need, without having to get all the deals every time…