Track an event
curl --request POST \
--url https://api.engagefabric.com/events \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"externalUserId": "user_12345",
"eventType": "lesson_completed",
"properties": {
"lessonId": "math-101",
"score": 95,
"duration": 300
},
"timestamp": "2025-11-17T10:30:00Z",
"idempotencyKey": "evt_user12345_lesson_20251117_103000"
}
'import requests
url = "https://api.engagefabric.com/events"
payload = {
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"externalUserId": "user_12345",
"eventType": "lesson_completed",
"properties": {
"lessonId": "math-101",
"score": 95,
"duration": 300
},
"timestamp": "2025-11-17T10:30:00Z",
"idempotencyKey": "evt_user12345_lesson_20251117_103000"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: '123e4567-e89b-12d3-a456-426614174000',
externalUserId: 'user_12345',
eventType: 'lesson_completed',
properties: {lessonId: 'math-101', score: 95, duration: 300},
timestamp: '2025-11-17T10:30:00Z',
idempotencyKey: 'evt_user12345_lesson_20251117_103000'
})
};
fetch('https://api.engagefabric.com/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.engagefabric.com/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => '123e4567-e89b-12d3-a456-426614174000',
'externalUserId' => 'user_12345',
'eventType' => 'lesson_completed',
'properties' => [
'lessonId' => 'math-101',
'score' => 95,
'duration' => 300
],
'timestamp' => '2025-11-17T10:30:00Z',
'idempotencyKey' => 'evt_user12345_lesson_20251117_103000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engagefabric.com/events"
payload := strings.NewReader("{\n \"projectId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"externalUserId\": \"user_12345\",\n \"eventType\": \"lesson_completed\",\n \"properties\": {\n \"lessonId\": \"math-101\",\n \"score\": 95,\n \"duration\": 300\n },\n \"timestamp\": \"2025-11-17T10:30:00Z\",\n \"idempotencyKey\": \"evt_user12345_lesson_20251117_103000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engagefabric.com/events")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"externalUserId\": \"user_12345\",\n \"eventType\": \"lesson_completed\",\n \"properties\": {\n \"lessonId\": \"math-101\",\n \"score\": 95,\n \"duration\": 300\n },\n \"timestamp\": \"2025-11-17T10:30:00Z\",\n \"idempotencyKey\": \"evt_user12345_lesson_20251117_103000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"externalUserId\": \"user_12345\",\n \"eventType\": \"lesson_completed\",\n \"properties\": {\n \"lessonId\": \"math-101\",\n \"score\": 95,\n \"duration\": 300\n },\n \"timestamp\": \"2025-11-17T10:30:00Z\",\n \"idempotencyKey\": \"evt_user12345_lesson_20251117_103000\"\n}"
response = http.request(request)
puts response.read_body{
"eventId": "123e4567-e89b-12d3-a456-426614174000",
"status": "PENDING",
"skipped": false,
"message": "Event queued for processing",
"existingEventId": "<string>"
}Events
Track an event
Submit an event for processing. Events are queued asynchronously and processed by the rules engine.
POST
/
events
Track an event
curl --request POST \
--url https://api.engagefabric.com/events \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"externalUserId": "user_12345",
"eventType": "lesson_completed",
"properties": {
"lessonId": "math-101",
"score": 95,
"duration": 300
},
"timestamp": "2025-11-17T10:30:00Z",
"idempotencyKey": "evt_user12345_lesson_20251117_103000"
}
'import requests
url = "https://api.engagefabric.com/events"
payload = {
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"externalUserId": "user_12345",
"eventType": "lesson_completed",
"properties": {
"lessonId": "math-101",
"score": 95,
"duration": 300
},
"timestamp": "2025-11-17T10:30:00Z",
"idempotencyKey": "evt_user12345_lesson_20251117_103000"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: '123e4567-e89b-12d3-a456-426614174000',
externalUserId: 'user_12345',
eventType: 'lesson_completed',
properties: {lessonId: 'math-101', score: 95, duration: 300},
timestamp: '2025-11-17T10:30:00Z',
idempotencyKey: 'evt_user12345_lesson_20251117_103000'
})
};
fetch('https://api.engagefabric.com/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.engagefabric.com/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => '123e4567-e89b-12d3-a456-426614174000',
'externalUserId' => 'user_12345',
'eventType' => 'lesson_completed',
'properties' => [
'lessonId' => 'math-101',
'score' => 95,
'duration' => 300
],
'timestamp' => '2025-11-17T10:30:00Z',
'idempotencyKey' => 'evt_user12345_lesson_20251117_103000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engagefabric.com/events"
payload := strings.NewReader("{\n \"projectId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"externalUserId\": \"user_12345\",\n \"eventType\": \"lesson_completed\",\n \"properties\": {\n \"lessonId\": \"math-101\",\n \"score\": 95,\n \"duration\": 300\n },\n \"timestamp\": \"2025-11-17T10:30:00Z\",\n \"idempotencyKey\": \"evt_user12345_lesson_20251117_103000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engagefabric.com/events")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"externalUserId\": \"user_12345\",\n \"eventType\": \"lesson_completed\",\n \"properties\": {\n \"lessonId\": \"math-101\",\n \"score\": 95,\n \"duration\": 300\n },\n \"timestamp\": \"2025-11-17T10:30:00Z\",\n \"idempotencyKey\": \"evt_user12345_lesson_20251117_103000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engagefabric.com/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"externalUserId\": \"user_12345\",\n \"eventType\": \"lesson_completed\",\n \"properties\": {\n \"lessonId\": \"math-101\",\n \"score\": 95,\n \"duration\": 300\n },\n \"timestamp\": \"2025-11-17T10:30:00Z\",\n \"idempotencyKey\": \"evt_user12345_lesson_20251117_103000\"\n}"
response = http.request(request)
puts response.read_body{
"eventId": "123e4567-e89b-12d3-a456-426614174000",
"status": "PENDING",
"skipped": false,
"message": "Event queued for processing",
"existingEventId": "<string>"
}Body
application/json
Project ID
Example:
"123e4567-e89b-12d3-a456-426614174000"
External user ID from client system
Example:
"user_12345"
Event type
Example:
"lesson_completed"
Event properties
Example:
{
"lessonId": "math-101",
"score": 95,
"duration": 300
}
Event timestamp (ISO 8601)
Example:
"2025-11-17T10:30:00Z"
Idempotency key for preventing duplicate processing
Example:
"evt_user12345_lesson_20251117_103000"
Response
Event accepted and queued for processing
Event ID
Example:
"123e4567-e89b-12d3-a456-426614174000"
Processing status
Available options:
PENDING, PROCESSING, PROCESSED, FAILED, SKIPPED Example:
"PENDING"
Whether event was skipped due to idempotency
Example:
false
Message
Example:
"Event queued for processing"
Existing event ID if duplicate
⌘I
