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¶
Authentication¶
Include your API key in the X-API-Key header:
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):
Error (401 Unauthorized):
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¶
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)
});