When sending continuous REST API PATCH calls to Salesforce using external ID fields (such as uuid__c) that accept only unique values, you may encounter the following error:
"duplicate value found: uuid__c duplicates value on record with id: 00XXXXXXXXXXXXX"
This error occurs even though a PATCH operation is designed to either update an existing record or insert a new one (upsert behavior). The duplicate error appears because of simultaneous or near-simultaneous requests.
Why does this happen?
When multiple requests are sent in rapid succession — for example from Node.js or JavaScript — there is a risk of overlapping requests. If the same record is submitted twice within milliseconds or seconds, the first request may still be in process when the second one arrives. The Salesforce server then identifies the second request as a duplicate and throws the error.
To resolve the duplicate error on PATCH operations, synchronize your REST API requests so that only one request for a given record is in flight at a time.
000383480

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.