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.
| Field | Type | Description |
|---|---|---|
emailreq | string | The contact's email; used as the identity key. |
first_name | string | Updates the contact's first name. |
last_name | string | Updates the contact's last name. |
custom_attributes | object | Arbitrary key/values, merged into existing attributes (not replaced). |
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.