REST API Reference

Server-side tracking via HTTP API for backend integrations

Endpoint
POST /api/events
Authentication

Include your API key in the request headers:

X-API-Key: ed_your_api_key_here
# or
Authorization: Bearer ed_your_api_key_here
Request 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 successfully
401
Invalid API key
400
Invalid request format
200
Quota exceeded (silent success)
Event Types
pageview

Page view events

custom

Custom events with name and properties

goal

Goal tracking events

scroll

Scroll visibility events

error

Error tracking events

performance

Performance metrics