Ingest API
Send engagement events into LeadVibe programmatically. Events are queued for background processing and scored against your active rulesets. This is the primary endpoint for real-time event ingestion from your applications, marketing tools, and integrations.
POST /ingest
Queue an event for processing. The server acknowledges receipt immediately with 202 Accepted and processes the event asynchronously.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
lead_id | string | No | Lead identifier. Required if no alias is provided |
alias_kind | string | No | Type of alias: email, external_id, phone, cookie, or social |
alias | string | No | Alias value corresponding to alias_kind |
event_type | string | Yes | Type of event (e.g., page_view, email_open, form_submit) |
timestamp | string | No | Event timestamp in RFC 3339 format. Defaults to current time |
metadata | object | No | Additional key-value data to attach to the event |
Provide either lead_id or both alias_kind and alias. If only an alias is supplied, a lead is created or resolved automatically.
{
"alias_kind": "email",
"alias": "user@example.com",
"event_type": "page_view",
"metadata": {
"path": "/pricing",
"utm_source": "google"
}
}
Response
202 Accepted
The event has been queued for processing.
Examples
Ingest using email alias:
curl -X POST "https://api.leadvibe.com/ingest" \
-H "Authorization: Basic <credentials>" \
-H "Content-Type: application/json" \
-d '{
"alias_kind": "email",
"alias": "user@example.com",
"event_type": "page_view"
}'
Ingest with lead ID and metadata:
curl -X POST "https://api.leadvibe.com/ingest" \
-H "Authorization: Basic <credentials>" \
-H "Content-Type: application/json" \
-d '{
"lead_id": "ld_abc123",
"event_type": "demo_request",
"metadata": {"product": "enterprise", "source": "website"}
}'
Ingest with a specific timestamp:
curl -X POST "https://api.leadvibe.com/ingest" \
-H "Authorization: Basic <credentials>" \
-H "Content-Type: application/json" \
-d '{
"alias_kind": "email",
"alias": "user@example.com",
"event_type": "email_open",
"timestamp": "2025-09-15T14:30:00Z"
}'
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | Active OU must be set, or required fields are missing |
| 401 | Unauthorized | Check authentication credentials |
Setting the Active OU
The ingest endpoint requires an active Organizational Unit. Set it before ingesting events:
# 1. Set the active OU
curl -X POST "https://api.leadvibe.com/org-units/active" \
-H "Authorization: Basic <credentials>" \
-H "Content-Type: application/json" \
-d '{"ouId": "unit_default"}'
# 2. Ingest an event (OU is now set via cookie)
curl -X POST "https://api.leadvibe.com/ingest" \
-H "Authorization: Basic <credentials>" \
-H "Content-Type: application/json" \
-d '{"alias_kind": "email", "alias": "user@example.com", "event_type": "page_view"}'
Notes
- Events are processed asynchronously after acknowledgment
- The organization and OU are determined from your authentication context -- do not send
unit_idin the request body - If no active OU is set, the endpoint returns
400with the message "active OU not set" - Events are scored against all active rulesets and may trigger milestone or sequence triggers
- For bulk historical imports, consider the Import Events endpoint instead
Related Endpoints
- Import Events - Bulk import events from CSV
- Events - List and manage ingested events
- Organization Units - Set the active OU