How do I find all deals for my organization which are in pipeline or in Lead

I’m able to fetch all the open deals based on updated_time and expected_close_date. But how do I get the deals which aren’t in open state and has entered by Sales as potential Lead.

Thanks,

Are you referring to Deals that are in a different status (closed, won, lost)? Easiest way is to create a filter for this (or use an existing one) and then the ID of the filter to do API searches

Sounds like a great idea. Is there any way to create a filter to get deals those are updated within a week starting from today? For example I would like to create a filter to return values where updated_at is between today and 7 days in past from today?

Thanks,

Sure thing, you could add conditions similar to what is below, paying attention to the ‘operator’ and ‘value’

"conditions": {
   "glue": "and",
   "conditions": [
       {
         "glue": "and",
         "conditions": [
             {
               "object": "deal",
               "field_id": "12451",
               "operator": ">=",
               "value": "last_week",
               "extra_value": null
             }
         ]
      },
      {
         "glue": "or",
         "conditions": [ ]
      }
   ]
}

Thanks. It worked fine.

Hi David,

Thanks for your response below. The last_week value referred below, returns data From Sunday through Saturday, e.g June 10th - June 16th. In our case, our work week concludes on Friday. If I filter out the result until Friday, there is a loss of data. I tried to create Custom Date Range field. Is there any way if I can get the data from Saturday through Friday by any chance?

Thanks,

Swati

Unfortunately there isn’t with this. You can make some changes according to the ‘locale’ setting, but unfortunately no locale has a Saturday-Friday week.
Just curious of your situation, but why would the inclusion of Saturday be in an issue if this isn’t a work day? Or is this added to the next week?

Thanks. For us work week ends on Friday. Saturday would added to next week.

Hi David,

We have been planning to make more use of pipedrive data going forward. I have a couple of questions for you for which I didn’t find any material in API doc.

  1. Is there a list a pre-defined filters like last_week which I can refer.

  2. How do I get all the deals, if they are more than 500. As per documentation, API returns only 500 deals. Does response contain any information which can be used to get remaining of data?

Thanks,

Swati

Hey again Swati,

I don’t have a list of filters pre-defined in documentation (although it would be a good idea), but you can find them in-app, by creating a filter:

  1. For this you’ll need to use pagination to determine the start, and then continue making calls until you get all of your Deals.