We are extracting leads via a API bulk extraction. However when comparing the number of the extraction with the numbers in the Marketo Database, in the extraction are found more leads.
Now I was checking also the deleted leads (via API call) to test whether the discrepancy could be caused by deletion. But those were only causing less than 1% of the discrepancy.
When looking for the lead Id in Marketo they are claimed as "not found". Could there be any other reason for the lead not to be found besides deletion? I was thinking about some anonymization or something similiar.
Do you use Workspaces and Person Partitions? If so, it could be the case that the Workspace from which you're checking the number of people in the Database (either by creating a smart list or using the All People system smart list) may not have access to all the Person Partitions you have in your instance (unlike the API user you're using to export people), and hence the discrepancy. You can view the Partitions a Workspace has access to in the Marketo Admin > Workspaces & Partitions.
Thanks for the answer, we are already taking the the workspaces and partitions in considereration.
Luckily we found the cause by know. Maybe it will help someone else: Apparently the leads were deleted about 14 days ago and then changed through a field update that was applied to all exsiting leads, including the ones that were deleted already. Therefor we could query them as recently updated but not existing in the system frontend anymore.