Open onDuplicate parameter not working on POST /contacts API

Grant Account Access for Support
  1. I authorize the Pabbly Support Team to access my account for troubleshooting purposes.
WhatsApp Number
+971586143448
Email Address
[email protected]
Hi team,


I'm using the POST /contacts API to create contacts and I'm facing an issue with the onDuplicate parameter.


Problem:
When sending a request with an existing mobile number, the API returns:




"Number already exists!" → failedCount: 1

even when onDuplicate: overwrite is passed.


What I tried:


  1. Passing onDuplicate: overwrite as a query parameter
  2. Passing onDuplicate: overwrite in the request body
  3. Passing it in both places simultaneously

All three approaches failed with the same duplicate error.


Documentation Issue:
Your documentation is also ambiguous — the onDuplicate parameter is listed under a section that says both "Query Params:" and "Body parameters", making it unclear where exactly it should be passed.


Workaround I'm using:
I set Return error if HTTP request fails to false in my HTTP module to silently ignore the duplicate error and continue the workflow.


Request:
  1. "Your documentation for POST /contacts lists onDuplicate under a section that says both 'Query Params' and 'Body parameters' — could you clarify exactly where this parameter should be passed, and provide a working cURL example that demonstrates onDuplicate: overwrite in action?"

Thank you.
 

Attachments

  • pabbly.png
    pabbly.png
    291.6 KB · Views: 5

ArshilAhmad

Well-known member
Staff member
Hi @arkar hein,

You need to add the onDuplicate parameter as a query parameter in this manner. Pass either overwriteandupsert or overwriteandupdate as its value.

Code:
curl --request POST \
  'https://chatflow.pabbly.com/api/v1/contacts?onDuplicate=overwriteandupsert' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "mobile": "",
  }'

Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
 
Top