Identity API
Resolve anonymous visitors to known leads. The stitch endpoint is public for use by the snippet and SDK; other endpoints require authentication.
Get Visitor Journey
/api/identityRetrieve a visitor's event history and identity data
| Parameter | Type | Description |
|---|---|---|
visitorIdrequired | string | Anonymous visitor ID (query parameter) |
Returns the visitor's event timeline, any linked lead IDs, and attribution data:
{
"visitorId": "v_abc123",
"leadId": "lead_456",
"firstSeen": "2025-01-10T08:00:00Z",
"lastSeen": "2025-01-15T14:30:00Z",
"events": [
{ "type": "pageview", "url": "/pricing", "timestamp": "2025-01-10T08:00:00Z" },
{ "type": "form_submit", "url": "/signup", "timestamp": "2025-01-15T14:30:00Z" }
],
"attribution": {
"channel": "organic_search",
"source": "google",
"landingPage": "/blog/growth-tips"
}
}
Link Visitor to Lead
/api/identityManually stitch a visitor to a known lead
Used to link an anonymous visitor to a CRM lead when the association is known server-side (e.g. after a HubSpot webhook identifies the contact).
| Parameter | Type | Description |
|---|---|---|
visitorIdrequired | string | Anonymous visitor ID to link |
leadIdrequired | string | Known lead or contact ID from your CRM |
source | string | How the link was established (e.g. hubspot_webhook, manual) |
Email Stitch (Public)
/api/identity/stitchStitch a visitor to a lead via email — called by the snippet or SDK
Info
This endpoint is public and requires no authentication. It is designed to be called from the browser when a visitor submits their email.
| Parameter | Type | Description |
|---|---|---|
visitorIdrequired | string | Anonymous visitor ID from the snippet |
emailrequired | string | Email address provided by the visitor |
projectKeyrequired | string | Your Apex project key |
The API matches the email against known leads and merges the visitor's event history into the lead's journey. If no matching lead exists, one is created automatically.