Identify customers

Tell Messy who your users are, so you can segment, target and automate around them.

POST /customers/identify upserts a contact by email and merges any attributes you pass. Call it from your backend whenever someone signs up, logs in or updates their profile, and your audience stays current. The attributes you set here are exactly what segments and drips match on.

FieldTypeDescription
emailreqstringThe contact's email; used as the identity key.
first_namestringUpdates the contact's first name.
last_namestringUpdates the contact's last name.
custom_attributesobjectArbitrary key/values, merged into existing attributes (not replaced).
identify.sh
curl https://api.messy.sh/customers/identify \
  -H "Authorization: Bearer $MESSY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@example.com",
    "first_name": "Ada",
    "custom_attributes": { "plan": "pro", "country": "NL", "mrr": 99 }
  }'

The response returns the contact. When attributes change, Messy recomputes the contact’s segment memberships in the background and records an entry on its activity timeline.

Backfill in bulk

To seed an existing user base, loop over your users and call identify for each. (This is how Messy itself backfills contacts from the Lalaaji app.) It pairs naturally with file-based template sync: one job keeps content current, another keeps the audience current.

This is the server-side identify, authenticated with your environment API key. The chat widget has its own visitor-side identify for attaching live chats to a known contact; see Embed the chat widget.