Skip to content

REST API

Server-side tracking via HTTP for backends and workers.

Endpoints
POST /api/events
POST /api/goals
Authentication
bash
X-API-Key: ed_your_api_key_here
# or
Authorization: Bearer ed_your_api_key_here
Events 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 require Standard or Pro — 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": ""
      }
    ]
  }'
Response codes
200
Events processed successfully
400
Invalid request format
401
Invalid API key
403
Quota exceeded or plan restriction
429
Rate limit exceeded