onDuplicate parameter not working on POST /contacts API
Status: Open · Asked by arkar hein on · 0 views
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:
- Passing onDuplicate: overwrite as a query parameter
- Passing onDuplicate: overwrite in the request body
- 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:
- "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.
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.
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