Logo
Salesforce Developers API Documentation

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

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
Content-Type
string




RESPONSES

status OK

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



Curl
curl -X PATCH '/services/data/v61.0/composite/sobjects/:SOBJECT_API_NAME/:FIELD_NAME' -H 'Content-Type: application/json' -d '{"allOrNone":false,"records":[{"attributes":{"type":"Account"},"Name":"Test Upsert","Id":"0012o00003OBzVSAA1"}]}'

ENDPOINTS