Skip to content

Event Ingestion via API

You can send events to Adwize from any system using the REST API. This is useful for sources not covered by native integrations.

Endpoint

POST https://api.getadwize.com/api/v1/events

Authentication

Include your API key in the X-API-Key header:

X-API-Key: your-api-key-here

Find your API key in Settings > API Keys.

Request Format

Send a batch of events as a JSON array:

[
  {
    "source": "backend",
    "event_type": "purchase",
    "data": {
      "transaction_id": "TXN-12345",
      "value": 99.99,
      "currency": "USD"
    }
  },
  {
    "source": "backend",
    "event_type": "signup",
    "data": {
      "user_id": "usr_abc123",
      "plan": "pro"
    }
  }
]
Field Type Required Description
source string Yes Identifier for the data source
event_type string Yes Type of event
data object Yes Arbitrary key-value payload

Response

Success (201 Created):

{
  "ingested": 2
}

Error (401 Unauthorized):

{
  "detail": "Invalid or missing API key"
}

Rate Limits

The events endpoint is rate-limited to 1,000 requests per minute per API key. Each request can contain multiple events in the batch, so you can ingest significantly more than 1,000 events per minute.

Batch your events

Instead of sending one event per request, collect events and send them in batches. This reduces overhead and stays well within rate limits.

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())
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)
});