Lead Webhooks

Receive known viewer details and use them to create or update a contact.

Receive the record for a known viewer. Use it to create or update a contact in your application. Mindstamp treats a viewer as known when it has an email address, phone number, custom ID, or a name that is not an anonymous display name.

The JSON uses id, name, email, phone, and custom_id. The viewer_ prefix belongs to the view and interaction payloads.

See Webhooks for setup and delivery handling.

Example POST body

This complete example contains a fictional viewer with an email address and a custom employee ID. A lead can have a null email address.

{
  "created_at": "2026-09-08T14:00:00.000Z",
  "name": "Alex Morgan",
  "email": "[email protected]",
  "phone": null,
  "owner_id": "20000000-0000-4000-8000-000000000001",
  "user_id": null,
  "custom_id": "employee-1042",
  "stats_views": 1,
  "stats_interactions": 2,
  "stats_streaming": 120,
  "stats_engagement": 120,
  "variables": {
    "department": "Operations",
    "course_id": "safety-intro"
  },
  "updated_at": "2026-09-08T14:02:00.000Z",
  "id": "50000000-0000-4000-8000-000000000001",
  "group_id": "30000000-0000-4000-8000-000000000001",
  "group_name": "New employee training"
}

Use this payload

Use id as the Mindstamp viewer key. If your application supplied custom_id, use it to find the existing customer or learner. Use email only when it is present and your application uses it as an identifier.

const contact = {
  mindstampViewerId: body.id,
  externalId: body.custom_id,
  name: body.name,
  email: body.email,
  phone: body.phone,
  department: body.variables?.department ?? null
};
// Create or update the contact. Keep the Mindstamp viewer ID on the record.

Link a lead to later activity

Lead fieldMatching field in a view or interaction
idviewer_id
custom_idviewer_custom_id
emailviewer_email
nameviewer_name
phoneviewer_phone

The lead body does not include a video_id, view_id, question response, or completion score. Use view and interaction webhooks for those fields. Match records by viewer ID, even if the requests arrive in a different order.

Field reference

The stats_* fields are stored totals. Mindstamp updates them in a background job, so they can lag behind the event that caused delivery. Do not use them to confirm one view's completion.

FieldJSON typeDescription
created_atstringTime Mindstamp created the viewer record, as an ISO 8601 timestamp.
namestring or nullViewer name. A lead can have a name without an email address.
emailstring or nullViewer email, when available.
phonestring or nullViewer phone, when available.
owner_idstring or nullOwner ID stored on the viewer.
user_idstring or nullAssociated user ID, when stored. This is separate from the viewer ID.
custom_idstring or nullYour identifier for the viewer, when supplied.
stats_viewsintegerStored total view count for this viewer.
stats_interactionsintegerStored total interaction count across the viewer's views.
stats_streamingintegerStored sum of tracked video seconds across the viewer's views.
stats_engagementintegerStored engagement time in seconds. The current calculation uses the larger of total elapsed time and total tracked video seconds. This is not a percentage.
variablesobject or nullStored variables. Values can have different JSON types. Privacy settings can remove values. The lowercase setting can change key names.
updated_atstringViewer record update time at serialization. This is not a delivery timestamp.
idstringViewer ID. Matches viewer_id in view and interaction webhooks.
group_idstring or nullGroup ID from the video associated with the viewer record. It can differ from the video that triggered delivery.
group_namestring or nullName of that group, when available.

Delivery behavior

Mindstamp checks lead delivery during view post-processing. The current sender skips unknown viewers and viewers whose lead webhook already succeeded. It stores success on the viewer record, across videos and destination URLs. Use view webhooks to track returning viewers or later changes in their recorded activity.