POST
/
api
/
customers
/
upsert

The upsert endpoint is designed to allow Luadspeaker users the programmatic ability to add new customers or update existing customers.

The upsert endpoint looks up a customer document using the supplied primary_key, and then adds or changes customer attribute values specified in the properties json object in the request body.

In order to use this endpoint, a primary key must have first been selected via the Laudspeaker UI.

Authentication

Authorization
string
required

Header for authenticating with Laudspeaker. Starts with Api-Key followed by the API key, for example Api-Key M4jxXt6diYz1Dds1YmhHe93KGPAUi24PlXgaiRXi.

Body

primary_key
string
required

This field specifies the primary key value used to uniquely identify users.

properties
json

This is where additional properties are added to the customer object. To delete a property, pass the key with value set to null.

Response

id
string
required

The id of the customer object that was created or modified.

Examples

Creating an empty customer document

Updating an existing customer document

Deleting a field from an existing customer document