upsert
Url
/V2.0/services/data/upsert
HTTP Method
POST
Description
Create or update an entity 
Parameters
Name Type Description
insertEntity* entity The entity Id and the fields that will be used to create the entity
updateEntity* entity The entity Id and the fields that will be used to update the entity
Result
Name Type Description
id entityId (string)
In case of failure an error object will be returned
* indicates required fields
Samples
Insert or update a Task with the ID 123456
POST /V2.0/services/data/upsert
{
    "insertEntity": {
        "Id": "/Task/123456",
        "Parent": "/Task/42",
        "Name": "A new Task",
        "StartDate": "2020-12-01",
        "Duration": {
            "value": 3,
            "unit": "Days"
        }
    }, 
    "updateEntity": {
        "Id": "/Task/123456",        
        "Name": "An updated Task"        
    }    
}
Response:
in case of successful insert -
HTTP status code - 201 Created
{
  "Id": "/Task/123456"  
}       
in case of successful update -
HTTP status code - 200 OK
{    
}