---
title: "Create or update a customer identity"
method: POST
path: "/customer_identities/create_or_update"
tags: ["Customer Identities"]
---

# Create or update a customer identity

`POST /customer_identities/create_or_update`

Creates a new customer identity or updates an existing one.

## Request body

- object
  - `customer_identity` object, required
    - `first_name` string — The first name of the customer in the external system.
    - `last_name` string — The last name of the customer in the external system.
    - `email` string, email, required — The email of the customer in the external system.
    - `distinct_id` string, required — The unique identifier for the customer in the external system.
    - `properties` object — A restricted hash of additional attributes for the customer identity. Keys are allowlisted on a per-integration basis.

## Response `200`

Customer identity successfully updated.

- object
  - `customer_identity` CustomerIdentity
    - `id` integer — Unique identifier for the customer identity in Smile.
    - `first_name` string, nullable — The first name of the customer in the external system.
    - `last_name` string, nullable — The last name of the customer in the external system.
    - `email` string, email — The email of the customer in the external system.
    - `distinct_id` string — The unique identifier for the customer in the external system.
    - `properties` object — A restricted hash of additional attributes for the customer identity. Keys are allowlisted on a per-integration basis.
    - `customer_id` integer — The ID of the customer in Smile that this customer identity is linked to.

## Other responses

- `201` — Customer identity successfully created.

---

[API](https://skmtc.dev/smile/apis/smile-io-rest-api.md) · [All operations](https://skmtc.dev/smile/apis/smile-io-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smile/smile-io-rest-api/revisions/081bc804c5df/schema)
