Campaign Event Stream
curl --request GET \
--url https://api.example.com/v1/campaigns/{id}/eventsimport requests
url = "https://api.example.com/v1/campaigns/{id}/events"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/campaigns/{id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/campaigns/{id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/campaigns/{id}/events"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/campaigns/{id}/events")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/campaigns/{id}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"events": [
{
"id": "<string>",
"type": "<string>",
"contact_id": "<string>",
"email": "<string>",
"step_id": "<string>",
"timestamp": "<string>",
"metadata": {}
}
]
},
"meta": {
"page": 123,
"per_page": 123,
"total": 123
}
}Campaigns
Campaign Event Stream
Retrieve granular per-event activity (sends, opens, clicks, replies) for a campaign
GET
/
v1
/
campaigns
/
{id}
/
events
Campaign Event Stream
curl --request GET \
--url https://api.example.com/v1/campaigns/{id}/eventsimport requests
url = "https://api.example.com/v1/campaigns/{id}/events"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/campaigns/{id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/campaigns/{id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/campaigns/{id}/events"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/campaigns/{id}/events")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/campaigns/{id}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"events": [
{
"id": "<string>",
"type": "<string>",
"contact_id": "<string>",
"email": "<string>",
"step_id": "<string>",
"timestamp": "<string>",
"metadata": {}
}
]
},
"meta": {
"page": 123,
"per_page": 123,
"total": 123
}
}Request
Path Parameters
string
required
The campaign’s unique ID (UUID)
Query Parameters
integer
default:"1"
Page number for pagination
integer
default:"50"
Events per page (max: 100)
string
Filter by event type:
sent, delivered, opened, clicked, replied, bounced, unsubscribed, complainedstring
Filter events for a single contact (UUID)
string
Only events on or after this ISO 8601 timestamp
string
Only events on or before this ISO 8601 timestamp
Headers
Authorization: Bearer wbk_your_api_key_here
Requires an API key with the
campaigns:read permission. Events are retained for 180 days.Response
object
Show properties
Show properties
array
Array of event objects, newest first.
Show Event object
Show Event object
curl "https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/cmp_abc123/events?type=opened&per_page=100" \
-H "Authorization: Bearer wbk_your_api_key_here"
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
CAMPAIGN_ID = "cmp_abc123"
response = requests.get(
f"{BASE_URL}/v1/campaigns/{CAMPAIGN_ID}/events",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"type": "opened", "per_page": 100},
)
events = response.json()["data"]["events"]
const CAMPAIGN_ID = 'cmp_abc123';
const response = await fetch(
`https://data.leadlex.com/functions/v1/api-gateway/v1/campaigns/${CAMPAIGN_ID}/events?type=opened&per_page=100`,
{ headers: { 'Authorization': 'Bearer wbk_your_api_key_here' } }
);
Example Response
{
"data": {
"events": [
{
"id": "evt_a1b2c3d4",
"type": "opened",
"contact_id": "123e4567-e89b-12d3-a456-426614174000",
"email": "jane@example.com",
"step_id": "step_1",
"timestamp": "2026-04-17T14:23:05Z",
"metadata": {
"user_agent": "Mozilla/5.0 ...",
"ip_country": "DE"
}
},
{
"id": "evt_b2c3d4e5",
"type": "clicked",
"contact_id": "123e4567-e89b-12d3-a456-426614174000",
"email": "jane@example.com",
"step_id": "step_1",
"timestamp": "2026-04-17T14:23:42Z",
"metadata": {
"url": "https://leadlex.com/demo"
}
}
]
},
"meta": { "page": 1, "per_page": 100, "total": 2341 }
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | invalid_event_type | Unrecognized type value |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing campaigns:read permission |
| 404 | campaign_not_found | No campaign with this ID |
| 429 | rate_limited | Rate limit exceeded |