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.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | Yes | CSV file containing event data |
skip_triggers | boolean | No | Set to true to suppress trigger evaluation during import (default: false) |
CSV Columns
| Column | Required | Description |
|---|---|---|
lead_id | No | Lead identifier. If omitted, resolved from alias columns |
event_type | Yes | Type of event (e.g., page_view, email_open) |
timestamp | No | Event timestamp in RFC 3339 format. Defaults to current time if omitted |
external_id | No | External system identifier (alias) |
email | No | Email address (alias) |
phone | No | Phone number (alias) |
cookie | No | Cookie identifier (alias) |
social | No | Social 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
| Field | Type | Description |
|---|---|---|
imported | integer | Number of events successfully processed |
errors | integer | Number 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
| Status | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | Check CSV format, ensure file field is provided |
| 401 | Unauthorized | Check 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=truewhen backfilling historical data to avoid firing notifications for old events - The
sourcefield is automatically set toimportfor all imported events - Large files are supported up to 10 MB
Related Endpoints
- Ingest - Ingest events programmatically via JSON
- Lead Import - Import leads with metadata
- Events - List and manage events