Here we have an example where we upsert a person. The system will use the PersonID, PersonKey, or Email to identify the object, if one doesn't exist it will be created.
On update, only the submitted fields will update so if you need to null out a property, you need to include it with a null value in the request body.
await fetch('https://app.sitemesh.com/api/person/upsert',
{
body: JSON.stringify({
PersonKey: 'A123',
PersonGivenName: 'James'
}),
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': '#API-KEY#',
}
}
);