Skip to main content

Who a person is

A person is whatever you send as user on an event: your own user ID, or an email. Lurk makes the person the first time it sees the ID. The identifier is stored sealed. Anything else Lurk knows about them is their profile, and only what you send. Because the ID is yours, the same person is the same in every event, in the API and in webhooks. A person belongs to one project: the same ID in Staging and in Production is two people.
A person has balances (what they hold of each unit), created_at (when Lurk first heard of them), last_active_at (when they last did something), a status and a profile.

A person’s profile

The profile is what you tell Lurk about someone beyond the identifier. Every field is optional, and Lurk checks none of it: an email is not verified, and a handle is not proof of the account. Send it with the event that makes the person, so a sign-up needs no second call:
Or change it at any time with PATCH /v1/users/{id} and { "profile": { … } } (MCP: lurk.users.update). The person must exist already. A field you leave out is kept, and null clears it. In handles, an entry replaces that platform’s, null removes it, and platforms you leave out are kept. "profile": null erases the whole profile.
  • A profile is applied once per event: a retry with the same idempotency_key changes nothing, and the same key with a different profile is a conflict.
  • An invalid profile refuses the whole request with validation_failed, and nothing is recorded.
  • A profile changes no balance, runs no rule and is not kept with the event. Rules, audiences and views do not read it, and webhooks do not carry it.
  • It is kept sealed, like the identifier. Lurky, the assistant in the dashboard, never sees it.
  • Two people may share an email or a handle. A handle never merges people.
  • A merge moves no profile: each person keeps their own.
Every person the API answers with has profile. A field you never set is null, handles is empty, and updated_at says when it last changed.

Visitors who become account holders

Use an opaque, stable identifier for rewards, such as person_7f4c. Your app owns the mapping between this identifier, its guest session and its signed-in account. Sending the same user value on later events keeps the same Lurk person and balances. An event’s user value identifies a person; it does not authenticate them. For a visitor creating a new account, your server can keep the guest’s reward identifier and associate it with that account. Continue sending that identifier after signup, and persist the mapping so it survives another browser or device. Your server should choose the identifier from its authenticated session or stored account, rather than trusting a browser-supplied account ID. For a visitor signing into an existing account, use the account’s existing reward identifier. If guest events used a different identifier, those are a separate Lurk person. To see what they did as a guest in the account’s history, make the guest identifier an alias of the account’s person: it moves no balance. Do not replace an established account’s identifier with the latest guest identifier. To let a signed-in person read their own balance and receipts from the browser, see Sign-in for your app’s users. Changing user from a guest ID to an email or account ID creates another person unless your app has kept the same reward identifier. Lurk does not infer that two identifiers belong to one person: an alias is you saying so.

Aliases: who a visitor was

An alias says that another identifier was this person too, such as the anonymous visitor ID they had before signing in. Their history then reads that identifier’s events and receipts as well. Nothing moves: balances, rules, limits, audiences and views stay each identifier’s own, and the alias’s own person is left out of GET /v1/users (unless you search for them). Send it with the event that signs them in:
Or make one at any time with POST /v1/users/{id}/aliases and { "alias": "…" } (MCP: lurk.users.alias), and remove it with DELETE /v1/users/{id}/aliases and the same body (lurk.users.unalias), which restores every read.
  • The identifier need not have sent an event yet.
  • An alias is made once per event: a retry with the same idempotency_key changes nothing.
  • Refused with a sentence, and nothing recorded: an identifier that is already another person’s alias, a person who is an alias themselves or an identifier with aliases of its own (aliases don’t chain), an identifier merged into someone, a person merged away, more than 20 aliases, and a usr_… ID.
  • With an event, a refused alias is skipped and the event is recorded all the same, so the sign-in still counts. The answer says what happened: "alias": { "made": false, "reason": "…" }, or { "made": true }.
  • A person with aliases can’t be merged into someone else: remove the aliases first.
  • Never alias an identifier that stands for many people, such as one shared ID for every visitor counted without consent: it would join the first person to sign in to everyone else under it. The shared ID v_000000000000000000000000 is always refused.
  • Lurk keeps events for at least 13 months.

A person’s history

Now on Reading people, with finding a person, status and export.

Merging existing people

Now on Merging people.

Audiences

An audience is a group of people a rule can read in if, or a unit can follow. Two kinds:
  • A list you add people to (POST /v1/audiences/{id}/users).
  • A condition that works itself out from what people do.
Rules that read an audience look only at its members, which keeps a rule for a small group cheap in a big project.