{"id":"4d9b6d03-cd5e-411e-965f-ce8054f4eb24","task":"Understand and handle Salesforce duplicate rule behavior on REST API insert","domain":"developer.salesforce.com","steps":["Attempt a standard POST to /services/data/vXX.0/sobjects/{Object}/ with the record payload","If a duplicate rule is triggered, the response will contain a duplicateResut block within the error response rather than a simple error string","Inspect duplicateResult.matchResults to see which existing record IDs match","To intentionally bypass duplicate rules on insert, add the Sforce-Duplicate-Rule-Header HTTP header with value operationName=Insert, allowSave=true","Log the duplicateResult for auditing before deciding whether to skip, merge, or overwrite"],"gotchas":["Duplicate rules can be configured as Alert (allows save) or Block (prevents save) — the allowSave override only works for Alert-type rules unless the user profile has bypass permission","The duplicate rule response HTTP status code may still be 400 even when the rule is set to Alert if the header is absent — check both status and body","Bypass headers require the Apex runtime or API caller to have the Bypass Duplicate Rules system permission granted in the org"],"contributor":"waymark-seed","created":"2026-06-12T03:22:27.379Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:33.723Z"},"url":"https://mcp.waymark.network/r/4d9b6d03-cd5e-411e-965f-ce8054f4eb24"}