Input & Output

Upsert using Plauti Deduplicate Search

The dc3DataApi endpoint enables the creation or updating of Salesforce records with built-in duplicate detection. If a duplicate is found, the existing record is updated; if no duplicate is found, a new record is created. The API also supports creating related records within the same request, ensuring data integrity and efficiency.

Authentication

The dc3DataApi endpoint requires authentication via Salesforce OAuth 2.0. Requests must include a valid OAuth access token in the Authorization header.

For detailed authentication steps, refer to: Salesforce Authentication Guide

Method Signature

HTTP
POST /services/apexrest/dupcheck/dc3DataApi

Parameters

Type Variable Description
JSON UpsertDataInput The structured input object containing record data.

UpsertDataInput Fields

Field Type Required Description
scenarioIds List<String> No Optionally, you can filter which duplicate scenarios to use by providing scenarioIds.

Example Request

JSON
{
  "input": {
    "allOrNone": true,
    "duplicateCheck": true,
    "duplicateScore": 100,
    "scenarioIds": ["a015I000000ABCDQAA", "a015I000000EFGHQAA"],
    "objectType": "Lead",
    "objectData": {
      "LastName": "Doe",
      "FirstName": "John",
      "Company": "Doe Enterprise",
      "Email": "[email protected]"
    },
    "relatedList": [
      {
        "duplicateCheck": true,
        "duplicateScore": 100,
        "objectType": "CampaignMember",
        "referenceField": "LeadId",
        "objectData": {
          "CampaignId": "7015I0000004rAwQAI"
        }
      }
    ]
  }
}

Response

The dc3DataApi endpoint returns an UpsertDataOutput , which provides details about the success or failure of the operation. The response includes information about the primary record as well as any related records processed in the request.

How the response objectData is populated

The objectData returned in the response reflects the record as it was submitted and saved by the endpoint. It is not read back from the database after saving, so it contains only the fields that were given a value while processing your request. In practice this means three groups of fields are returned:

  • The fields you sent in the request. Every field included in the request objectData is returned with its saved value.
  • The record Id. Always returned. On a create it is the Id of the new record; on an update or duplicate match it is the Id of the existing record.
  • Formula fields. Formula fields are recalculated during processing, so they are returned even though you did not send them.

The deciding factor is always whether the field was given a value while processing your request, not whether the field is standard or custom. A standard field is returned only if you sent it; a custom field is returned only if you sent it or it is a formula field.

Fields that Salesforce populates only after the record is saved are not included in the response, because the record is never re-queried. This includes, for example, auto-number fields, fields set by a default value or by a workflow, flow, or another trigger during save, and roll-up summary fields. To retrieve any of these values, query the record separately using the returned Id.

The same rule applies to each related record in relatedList: its objectData contains the related record's request fields, its Id, and the reference field that links it to the parent.

There is currently no request option to make the endpoint return additional fields. To retrieve any field beyond those described above, query the record with the returned Id after the call.

Note: In rare cases a formula field may be missing from the response. Salesforce has a known limitation where formula recalculation can fail for records that contain reference (lookup) fields; when that happens the record is still saved correctly, but its formula fields are left out of the response. Query the record by Id if you need a guaranteed formula value.

Example Response

JSON
{
  "isSuccess": true,
  "isCreated": true,
  "errorMessage": null,
  "objectId": "00Q5g00000B12345",
  "objectData": {
    "FirstName": "John",
    "LastName": "Doe",
    "Id": "00Q5g00000B12345"
  },
  "relatedList": [
    {
      "isSuccess": true,
      "isCreated": true,
      "errorMessage": null,
      "objectId": "7015I0000004rAwQAI",
      "objectData": {
        "CampaignId": "7015I0000004rAwQAI",
        "LeadId": "00Q5g00000B12345"
      },
      "relatedList": []
    }
  ]
}