Skip to main content
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 with userId and merges any traits onto their profile.
  • Traits-only update — send isNewIdentify: false to change traits without the backfill, the equivalent of the browser SDK’s setTraits().
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:
See identify users for the full browser API.

Frequently asked questions

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().
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.
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.

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.