REST API Reference
Server-side tracking via HTTP API for backend integrations
Endpoint
POST
/api/eventsAuthentication
Include your API key in the request headers:
X-API-Key: ed_your_api_key_here
# or
Authorization: Bearer ed_your_api_key_hereRequest Format
{
"id": "batch_123",
"sessionId": "session_abc",
"anonymousId": "anon_xyz",
"timestamp": 1234567890000,
"compressed": false,
"events": [
{
"type": "pageview",
"timestamp": 1234567890000,
"pageUrl": "https://example.com/page",
"pageTitle": "Page Title",
"referrer": "https://google.com"
},
{
"type": "custom",
"name": "button_click",
"timestamp": 1234567891000,
"pageUrl": "https://example.com/page",
"pageTitle": "Page Title",
"properties": {
"buttonId": "cta-button",
"variant": "primary"
}
}
]
}cURL Example
curl -X POST https://www.eventda.sh/api/events \
-H "Content-Type: application/json" \
-H "X-API-Key: ed_your_api_key_here" \
-d '{
"id": "batch_123",
"sessionId": "session_abc",
"anonymousId": "anon_xyz",
"timestamp": 1234567890000,
"compressed": false,
"events": [
{
"type": "pageview",
"timestamp": 1234567890000,
"pageUrl": "https://example.com",
"pageTitle": "Home",
"referrer": ""
}
]
}'Response Codes
200
Events processed successfully401
Invalid API key400
Invalid request format200
Quota exceeded (silent success)Event Types
pageviewPage view events
customCustom events with name and properties
goalGoal tracking events
scrollScroll visibility events
errorError tracking events
performancePerformance metrics