I have a usecase where users need to create Lead via Salesforce API. The use case is when user tries to create lead, the system checks if the lead or contact already exists with the same information. If it does not exist already, only then it should create a lead in salesforce.
I can think of writing an apex code if it was web to lead form, but I am trying to understand how to achieve it using an API.