REST API
Server-side tracking via HTTP for backends and workers.
Endpoints
POST
/api/eventsPOST
/api/goalsPOST
/api/server/eventsAuthentication
bash
# Public tracker / goals (ed_ write key)
X-API-Key: ed_your_api_key_here
# or
Authorization: Bearer ed_your_api_key_here
# Trusted revenue (eds_ server key, Standard+)
Authorization: Bearer eds_your_server_key_hereEvents batch
json
{
"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"
}
]
}Custom events are included on Free. Use goals for conversions — see Plans & limits.
Goal payload
json
{
"goal_name": "signup",
"anonymous_id": "anon_xyz",
"page_url": "https://example.com/pricing",
"metadata": {
"plan": "pro",
"source": "pricing_page"
}
}cURL
bash
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": ""
}
]
}'Crawler report
POST /api/crawl/report with an eds_ server key records a bot-like document fetch. The response is empty. The address is used to name the network and is not stored. Query strings are stripped from the path. Ordinary browser navigations are ignored.
bash
curl -X POST https://www.eventda.sh/api/crawl/report \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eds_your_server_key_here" \
-d '{
"path": "/pricing",
"host": "example.com",
"userAgent": "curl/8.7.1",
"ip": "203.0.113.10",
"secFetchDest": "",
"secFetchMode": ""
}'Trusted revenue (Standard+)
The public collector strips amount, revenue, and currency. Send money from your backend after identify() on the client. Never pass an email as identifiedUserId.
bash
curl -X POST https://www.eventda.sh/api/server/events \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eds_your_server_key_here" \
-d '{
"eventName": "purchase",
"identifiedUserId": "user_123",
"amount": 19,
"currency": "USD",
"orderId": "ord_12345"
}'Response codes
200
Events processed (or sampled at quota)400
Invalid request format401
Invalid API key403
Plan restriction (not quota). Quota uses sampling.429
Rate limit exceeded