Q:

What is relationship between Contact and Lead?

I was inserting contact in Salesforce, before inserting contact I usually check if that contact exists in Salesforce or not by the email, If I found the 0 records with this email in Salesforce then I insert it else get the ID of that contact and update it.
But now the issue is that I don't have records with this email in the Contact, so I was getting the response:
[0] => stdClass Object
    (
        [message] => Use one of these records?
        [errorCode] => UNKNOWN_EXCEPTION
        [fields] => Array
            (
            )

    )

So I don't get it, what is going this.
So I try to create with same email manually via Salesforce dashboard, I get to know that I have Record with the same email address in Lead Object and that's why it is going to show issue like the duplicate record.
You can see the screen below screenshot:
https://www.screencast.com/t/3wvQxnElq
So I don't get what is going?
What is the relationship between in Lead and Contacts? Why I was getting this error? How can I fix this?
Can anyone please help me with this.
Thanks.

A:

The Lead and Contact in this scenario do not have a direct relationship. You have a Duplicate Rule and Matching Rules configured in your Salesforce org that match Contacts against Leads, and vice versa, to ensure duplicates aren't added in one object against the other.
While in the user interface duplicate warnings can be just that - warnings, that the user can override - via the API duplicate warnings block the operation.
You can add criteria to your Duplicate Rule so that it does not run on your integration user or whichever user your API client is connecting under.

If you want your duplicate rule to run only when specific conditions are met, enter the conditions.
For example, the rule runs only if a record is being created by a user with a certain profile or role. Or set a condition for the rule to run only if the record includes a specific country, state, or province.

Alternately, if your PHP Salesforce client is connecting over the SOAP API, you may be able to set a DuplicateRuleHeader to suppress the duplicate rule.

