Skip to main content

Import Events API

Import historical event data by uploading a CSV file. Each row is processed through the scoring engine, allowing you to backfill engagement history for leads that were active before LeadVibe was set up.

POST /import

Upload a CSV file containing historical events. Each row is scored individually, and any matching triggers fire unless explicitly skipped.

Request

This endpoint accepts a multipart/form-data upload.

ParameterTypeRequiredDescription
filefileYesCSV file containing event data
skip_triggersbooleanNoSet to true to suppress trigger evaluation during import (default: false)

CSV Columns

ColumnRequiredDescription
lead_idNoLead identifier. If omitted, resolved from alias columns
event_typeYesType of event (e.g., page_view, email_open)
timestampNoEvent timestamp in RFC 3339 format. Defaults to current time if omitted
external_idNoExternal system identifier (alias)
emailNoEmail address (alias)
phoneNoPhone number (alias)
cookieNoCookie identifier (alias)
socialNoSocial profile identifier (alias)

At least one of lead_id or an alias column (external_id, email, phone, cookie, social) must be provided for each row. If only an alias is supplied, a lead is created or resolved automatically.

Response

202 Accepted

{
"imported": 142,
"errors": 3
}

Response Fields

FieldTypeDescription
importedintegerNumber of events successfully processed
errorsintegerNumber of rows that failed to process

Example

curl -X POST "https://api.leadvibe.com/import" \
-H "Authorization: Bearer <token>" \
-F "file=@events.csv"

Skip triggers during import:

curl -X POST "https://api.leadvibe.com/import?skip_triggers=true" \
-H "Authorization: Bearer <token>" \
-F "file=@events.csv"

Example CSV:

lead_id,event_type,timestamp
ld_abc123,page_view,2025-06-15T10:30:00Z
ld_abc123,email_open,2025-06-16T14:00:00Z
ld_def456,demo_request,2025-06-20T09:00:00Z

Using email alias instead of lead_id:

email,event_type,timestamp
jane@acme.com,webinar_attend,2025-07-01T11:00:00Z
bob@example.com,form_submit,2025-07-02T15:30:00Z

Common Errors

StatusMeaningSolution
400Bad RequestCheck CSV format, ensure file field is provided
401UnauthorizedCheck authentication credentials

Notes

  • The import endpoint is OU-scoped to the active Organizational Unit
  • Each row is processed through the scoring engine, so scores update in real time
  • Use skip_triggers=true when backfilling historical data to avoid firing notifications for old events
  • The source field is automatically set to import for all imported events
  • Large files are supported up to 10 MB
  • Ingest - Ingest events programmatically via JSON
  • Lead Import - Import leads with metadata
  • Events - List and manage events