POST /api/v1/visitors/identify

/ Attach a stable visitor ID to a session. Memory and history follow the user from there.

Request

FieldTypeRequiredDescription
agentIdstringYesThe agent's public ID
sessionIdstringYesThe anonymous session ID used so far
visitorIdstringYesStable hashed ID for the now-known user. 1 to 255 characters
const res = await fetch("https://app.humaner.io/api/v1/visitors/identify", {
  method: "POST",
  headers: {
    Authorization: "Bearer hm_live_xxxxxxxx",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    agentId: "AGENT_ID",
    sessionId: "sess_xxx",
    visitorId: "usr_hashed_123"
  })
});

Response

200 OK

{ "ok": true, "applied": true, "visitorId": "usr_hashed_123" }

applied is false, memory unaffected, when the plan does not include personalization. On a plan with cross-session memory, everything under sessionId merges into visitorId.

Errors

StatusMeaning
400agentId, sessionId, or visitorId missing or invalid
401Missing or invalid API key, or no Origin header and no key
403Origin not on the allowed-domains list
404Agent not found
500Memory merge failed. Safe to retry