Skip to content

Events API

Ingest Events

POST /api/v1/events

Send a batch of events for monitoring.

Authentication: X-API-Key header

Rate limit: 1,000 requests/minute

Request Body

JSON array of event objects:

[
  {
    "source": "backend",
    "event_type": "purchase",
    "data": {
      "transaction_id": "TXN-001",
      "value": 99.99,
      "currency": "USD"
    }
  },
  {
    "source": "backend",
    "event_type": "signup",
    "data": {
      "user_id": "usr_abc123",
      "plan": "pro"
    }
  }
]
Field Type Required Description
source string Yes Source identifier (e.g. gtm, backend, website)
event_type string Yes Event type identifier (e.g. purchase, page_view, error)
data object Yes Arbitrary event payload with the fields you want to monitor

Response

201 Created

{
  "ingested": 2
}

Error Responses

Status Body Cause
401 Unauthorized {"detail": "Invalid or missing API key"} Missing or invalid X-API-Key header
403 Forbidden {"detail": "Domain not allowed"} Request origin not in your allowed domains
422 Unprocessable Entity {"detail": "..."} Invalid request body (missing required fields)
429 Too Many Requests {"detail": "Rate limit exceeded"} More than 1,000 requests/minute

Examples

curl -X POST https://api.getadwize.com/api/v1/events \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "source": "backend",
      "event_type": "purchase",
      "data": {"transaction_id": "TXN-001", "value": 49.99}
    }
  ]'
import httpx

events = [
    {
        "source": "backend",
        "event_type": "purchase",
        "data": {"transaction_id": "TXN-001", "value": 49.99},
    }
]

response = httpx.post(
    "https://api.getadwize.com/api/v1/events",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json=events,
)
print(response.json())  # {"ingested": 1}
const events = [
  {
    source: "frontend",
    event_type: "page_view",
    data: { page: "/checkout", referrer: "/cart" }
  }
];

const response = await fetch("https://api.getadwize.com/api/v1/events", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(events)
});

const result = await response.json();
console.log(result); // { ingested: 1 }

List Events

GET /api/v1/events/

Retrieve stored events with optional filters.

Authentication: X-API-Key header or session cookie

Query Parameters

Parameter Type Default Description
source string Filter by source
event_type string Filter by event type
skip integer 0 Pagination offset
limit integer 100 Page size (max 1,000)

Response

[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "source": "gtm",
    "event_type": "purchase",
    "data": { "transaction_id": "TXN-001", "value": 99.99 },
    "created_at": "2026-02-11T14:00:00Z"
  }
]

Examples

curl "https://api.getadwize.com/api/v1/events/?source=gtm&limit=50" \
  -H "X-API-Key: YOUR_API_KEY"
import httpx

response = httpx.get(
    "https://api.getadwize.com/api/v1/events/",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={"source": "gtm", "limit": 50},
)

for event in response.json():
    print(event["event_type"], event["created_at"])
const params = new URLSearchParams({ source: "gtm", limit: "50" });
const response = await fetch(
  `https://api.getadwize.com/api/v1/events/?${params}`,
  { headers: { "X-API-Key": "YOUR_API_KEY" } }
);
const events = await response.json();

Get Event Types

GET /api/v1/events/types

Returns distinct event types seen in your data.

Authentication: X-API-Key header or session cookie

Response

["page_view", "purchase", "signup", "error"]

Get Event Sources

GET /api/v1/events/sources

Returns distinct source identifiers.

Authentication: X-API-Key header or session cookie

Response

["gtm", "backend", "segment"]

Pixel-Based Collection

GET /api/v1/events/collect

A lightweight endpoint used by the Google Tag Manager integration. Events are sent as query parameters in an image pixel request.

Rate limit: 2,000 requests/minute

Query Parameters

Parameter Type Description
k string Your API key
d string Base64-encoded event data

This endpoint returns a 1x1 transparent GIF. It is designed for browser-side collection via <img> tags and is used internally by the Adwize GTM template. For server-side integrations, use POST /events instead.

See the Google Tag Manager integration for setup details.