Skip to main content
POST
/
customer_identities
/
create_or_update
Create or update a customer identity
curl --request POST \
  --url https://api.smile.io/v1/customer_identities/create_or_update \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_identity": {
    "email": "jane@doe.com",
    "distinct_id": "cust_19238475",
    "first_name": "Jane",
    "last_name": "Doe",
    "properties": {}
  }
}
'
{
  "customer_identity": {
    "id": 863291377,
    "first_name": "Jane",
    "last_name": "Doe",
    "email": "jane@doe.com",
    "distinct_id": "cust_19238475",
    "properties": {},
    "customer_id": 123
  }
}
This endpoint requires the scope.
This endpoint is only available to apps making calls using an OAuth token. Attempting to use this endpoint with an API key will fail.
Creating: If no customer identity exists with the provided distinct_id, a new customer identity is created.
  • If the provided email matches an existing customer record, the customer identity is linked to that customer.
  • If the provided email does not match an existing customer record, a new customer is created and a customer identity is linked to the new customer.
Updating: If a customer identity exists with the provided distinct_id, it is updated with any new information provided in the request.
  • No changes to the linked customer record will occur.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
customer_identity
object
required

Response

Customer identity successfully updated.

customer_identity
object