API - Get leads that got modified OR converted after datetime X

API - Get leads that got modified OR converted after datetime X

Hi,

We are using the REST api to keep our local DB in sync with the status/stage of a lead/deal. We create leads in Zoho, most of them eventually get converted to a deal. We like to simply track the status/stage of that lead/deal.

  1. We programmatically create a lead in Zoho via the Zoho API. Zoho returns a lead ID.
  2. In Zoho, some leads get converted to a deal.
  3. For all leads that we created we like to track the stage, if the lead got converted to a deal, we like to use that stage, since the lead stage is not updated anymore after that.
  4. We don't like to fetch ALL leads and ALL deals every day, but only the changed ones (other stage, or converted to a deal).

We have tried a couple of things, but none of them seem to work:

- Fetch a list of leads via the Rest Get Records API and pass the MODIFIED header to get the leads that are modified. Using the converted=both parameter we are able to get both converted and not converted leads. We even get a deal ID for the converted leads. Problem: converting a lead to a deal does not update the MODIFIED flag of the lead. So fetching all leads that are modified in the last 24 hours we miss all leads that got converted during that day. Not sure why is that?

- Use the COQL endpoint. Problem: you can't fetch converted details. We need that link between a lead and a deal.

- Fetching all new/updated deals via the Get Records API. Problem: deals don't show the lead information it got converted from.

How can we nicely track the leads that we created in Zoho and follow them across stages, even when it converts to a deal?