POST /api/identify associates a visitor with a stable user ID of your choosing — a database ID, an email hash — and optionally stores traits describing them. tinyanalytics backfills that ID onto the visitor’s recent events, so their history ties together the moment they sign in. Like tracking, it returns 204 No Content.
Fields
number
required
Your numeric site ID.
string
required
Your stable ID for the user, up to 255 characters.
object
Key/value attributes, up to 2 KB serialized. A
null value deletes that trait.boolean
Defaults to
true. Send false to update traits without re-running the event backfill.When should I skip the backfill?
- First identify — send
{ siteId, userId, traits? }. tinyanalytics tags the visitor’s recent events withuserIdand merges any traits onto their profile. - Traits-only update — send
isNewIdentify: falseto change traits without the backfill, the equivalent of the browser SDK’ssetTraits().
Traits merge, they don’t replace: each identify updates the keys you send and leaves the rest. Send a key with a
null value to remove it.The browser equivalent
From a browser you don’t call this endpoint directly — the tracking script wraps it:Frequently asked questions
How do I update traits without re-running the backfill?
How do I update traits without re-running the backfill?
Send
isNewIdentify: false in the POST /api/identify body. tinyanalytics updates the traits and skips tagging the visitor’s recent events with the userId — the equivalent of the browser SDK’s setTraits().How do I delete a trait?
How do I delete a trait?
Send that key with a
null value. Traits merge rather than replace: each identify updates only the keys you send and leaves the rest in place, so a null is the way to remove one.Does identify overwrite a visitor's earlier events?
Does identify overwrite a visitor's earlier events?
No — it backfills. A first identify tags the visitor’s recent events with the
userId you sent and merges any traits onto their profile, so their history ties together the moment they sign in.Related
Tracking API
Send the events an identify ties together.
Identify users
The browser identify() and setTraits() API.
Analytics read API
Read the users and traits you’ve set.
Group & B2B analytics
Associate visitors with accounts, not just IDs.