Skip to Content
IdentityThe Identity API

The Identity API

The identity API lets your systems look a person up by any identifier, and read their profile and the evidence behind it. Together with identity tokens and server write credentials, it is how your own systems take part in realtime identity.

CredentialUsed byFor
Identity API key (a serving key, svk_…, scope serve:identity)your serversLooking anyone up. Never accepted from a web page.
Site key (psk_…)your web pages and appsThe current visitor’s own profile ID, through /v1/identity/me.
Identity tokenyour site, via the SDKVouching for a login on one device. See Verifying Identity.
Server write credential (swk_…)your serversSending events whose identifiers are all verified. See Verifying Identity.

Create an identity API key under API Keys → Identity API Keys, or from Find a person on a graph’s Realtime tab, and a Site key on the Site’s page. Both are shown once. An identity API key works for the whole workspace and carries only serve:identity; a key for the Profile API is a separate serving key.

Looking a person up

curl https://membership.zeotap.com/v1/identity/user_id/customer-42 \ -H "Authorization: Bearer svk_..."
{ "graph_id": "f03d5957-63ef-46a9-a10d-7e6e16b84c0f", "graph_name": "Event identity", "profile_id": "01a1ffc6-9118-77e2-a1c2-495a0a3c6344", "status": "resolved", "identifiers": [ { "family": "anonymous_id", "value_key": "visitor-7", "trust": "client_asserted" }, { "family": "email", "value_key": "8b1a…", "trust": "verified" }, { "family": "user_id", "value_key": "customer-42", "trust": "verified" } ] }

Requests

RequestReturns
GET /v1/identity/{family}/{value}The person an identifier belongs to. Add ?variant=email_sha256_lowercase (or another variant) to send a value you have already hashed.
GET /v1/identity/profiles/{profile_id}A profile by ID. An ID that was merged into another profile answers with the profile it became, and redirected_from names the ID you asked for.
GET /v1/identity/profiles/{profile_id}/linksThe evidence joining the profile’s identifiers: each link’s source, trust and time. See Why Are These Merged?.
POST /v1/identity/resolveUp to 100 identifiers in one call: {"identifiers": [{"family": "email", "value": "pat@example.com"}]}.
GET /v1/identity/meWith a Site key: the current visitor’s profile ID, from the identifiers your page knows (?anonymous_id=…&user_id=…). No identifiers are returned. It answers for a live Site, called from one of the Site’s domains.

Every request answers for your workspace’s primary realtime graph. Add ?graph={graph_id} to ask another graph that serves realtime, and ?policy={policy} to read the profile under one of your read policies.

Status

statusMeaning
resolvedA settled profile.
pendingA profile created in the last moment that may still join another; ask again shortly, or use it and follow profile changes.
unknownNobody with that identifier has been linked yet.

Personal data is never returned in plain text, only as a SHA-256 hash, and each identifier’s hashed says whether its value_key is one. Emails, phone numbers, names, addresses and IP addresses come back as hashes, and so does an email address or a phone number used as another identifier, such as a user ID. Anonymous IDs and ordinary customer IDs come back as they are. You can still look a person up by the plain value.

Every answer comes from the graph itself. If the graph is briefly unavailable, the API answers 503 with the code identity_unavailable and a Retry-After header; retry the request after that many seconds.

The profile ID you receive is safe to store. If the profile is later merged into another, asking for the old ID answers with the profile it became. See Profile IDs: When They Change.

From the browser

A page asks for its own visitor’s profile ID with the Site key, and never sees anyone’s identifiers. The signed-in user is preferred, so on a shared browser the person signed in is answered:

curl "https://membership.zeotap.com/v1/identity/me?anonymous_id=visitor-7&user_id=customer-42" \ -H "Authorization: Bearer psk_..."

The SDKs do this for you with getProfileId(); see the SDK.

Linking identifiers from your server

When your server knows identifiers belong to one person, for example at sign-up or sign-in, link them directly and get the person back in the same call:

curl -X POST https://agentic.zeotap.com/api/v1/workspaces/{id}/realtime-identity/link \ -H "Authorization: Bearer rk_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: signup-7f3a" \ -d '{"identifiers": [{"family": "user_id", "value": "customer-42"}, {"family": "email", "value": "pat@example.com"}, {"family": "anonymous_id", "value": "visitor-7"}]}'

The answer comes once the link is written, with the person’s profile_id and identifiers:

  • A person is created when none of the identifiers is known yet ("created": true).
  • Identifiers already on different people are joined into one person, within the graph’s rules and safeguards; merged_profile_ids names the people joined.
  • An identifier a safeguard keeps out, such as a second user ID for one person, is listed in refused with the reason, and the rest are linked.
  • Every identifier you send counts as verified, as on an event your server sends with a server write credential.
  • An Idempotency-Key makes a retry safe: the same key answers the same person and links nothing twice.

Use a REST API key holding the identity.write permission, which workspace owners and admins have. The full request and response are in the API reference.

To get the profile ID while sending the event your server sends anyway, post the event to /v1/identity/link on the events host with a server write credential instead. It answers the same fields, and the event is accepted like any other. See Getting a Profile ID With an Event.

Sending verified identity from your server

curl https://events.zeotap.com/v1/identify \ -H "Authorization: Bearer swk_..." \ -H "Content-Type: application/json" \ -d '{"userId": "customer-42", "anonymousId": "visitor-7", "traits": {"email": "pat@example.com"}}'

Every identifier on an event sent with a server write credential is verified, so it can join known customers whatever your verification level.

Last updated on