SObject Collections Upsert

PATCH {{_endpoint}}/services/data/v{{version}}/composite/sobjects/:SOBJECT_API_NAME/:FIELD_NAME

Use a PATCH request with sObject Collections to either create or update (upsert) up to 200 records based on an external ID field. This method returns a list of UpsertResult objects. You can choose whether to roll back the entire request when an error occurs. This request is available in API version 46 and later.

https://developer.salesforce.com/docs/atlas.en-us.apirest.meta/apirest/resourcescompositesobjectscollectionsupsert.htm

Request Body

{"allOrNone"=>false, "records"=>[{"attributes"=>{"type"=>"Account"}, "Name"=>"Test Upsert", "Id"=>"0012o00003OBzVSAA1"}]}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

[{"id":"001...","success":true,"errors":[],"created":false}]