Base URL
Use the URL of the region your organization was created in. A key from one region gets a401 from the other.
Authentication
Every request carries a key as a bearer token:
The events route takes either key. Data lands in the environment the key belongs to.
Requests and responses
Send JSON withContent-Type: application/json. Each endpoint page shows its method, its fields and which of them are required.
Most routes answer inside an envelope, with the route’s own result in data. Searching the knowledge base, for example:
Errors
A failed request answers with a 4xx or 5xx status. The body carries the error code inerror, and errorId identifies the failure if you contact support:
{ "error": "INVALID_API_KEY", "requestId": "ingest_req_..." }.
Send events
POST /api/mcp/events/v2/batch takes a batch of events and stores each one that passes the checks. This is the route the SDK’s track() calls.
The batch
Put your channel’s id in
properties.channelId. Waniwani files each event under a channel, and without an id it tries to match source to a channel’s label. An event that matches no channel is rejected.
Neither the batch nor an event takes other keys. An unknown key in the batch fails the whole request with a 400, and one in an event rejects that event alone.
The response
Each event is checked on its own, so a200 can list events that were not stored:
accepted counts the events that passed. rejected lists the others and is absent when there are none. Send a rejected event again later when its retryable is true. When it is false, fix the event first.
Retries
Waniwani stores an event id once. When a request times out and you can’t tell whether it arrived, send the same batch again with the same ids, and the events already stored are skipped. They still count inaccepted, so count delivered events by their ids, not by adding up accepted.
The SDK sends up to 20 events per batch.