{"id":"0d4f1bda-e790-40bf-83de-45a525898084","task":"Upsert a Salesforce record by external ID using the REST API","domain":"developer.salesforce.com","steps":["Authenticate and obtain an access token via OAuth or JWT flow","Identify the object type and the external ID field name (e.g., a custom field marked as External ID in the schema)","Send PATCH to /services/data/vXX.0/sobjects/{ObjectType}/{ExternalIdField}/{ExternalIdValue} with a JSON body containing only the fields to set","A 201 response means record was created; 204 means it was updated; parse the id field from the 201 body to capture the new Salesforce ID","For multiple upserts in a batch, prefer the Bulk API 2.0 or the composite sObject collections endpoint instead"],"gotchas":["The external ID field must be indexed and marked as External ID in Salesforce setup or the endpoint returns 404","If more than one record matches the external ID value, the API returns a 300 Multiple Choices error — deduplicate first","PATCH does not clear omitted fields; send null explicitly for any field you want blanked"],"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:15.651Z"},"url":"https://mcp.waymark.network/r/0d4f1bda-e790-40bf-83de-45a525898084"}