POST /api/v1/visitors/identify

Attach a stable ID to visitors. Agent's memory will follow.

Request

FieldTypeRequiredDescription
agentIdstringYesThe agent's public ID
sessionIdstringYesThe anonymous session ID used so far
visitorIdstringYesStable hashed ID for the now-known user.
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" }

On a plan with cross-session memory, everything under sessionId merges into visitorId. If applied=false please contact Humaner support

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