PilotFoxDocs

Send events

POST
/api/v1/ingest/events

Records a batch of 1 to 500 events from a server, through the same pipeline as the tracker's (400 when the body is not { events: [...] } of that size). Each event names its site (a site of the key's organization within its sites) and may carry the visitor's ip (else the request's address), user_agent (never the request's own) or anonymous_id, and ts (7 days back to 5 minutes ahead; default now). The answer counts the events taken and lists the refused ones by index: invalid, forbidden_site or ts_out_of_range; excluded or bot events count as taken, never saying why.

Requires an API key holding ingest:write. Session cookies and share links: 401.

Authorization

headerx-api-key<token>

An organization API key (ak_…), with the permissions and the sites it was created with. For servers and scripts: no cookie and no Origin check. Also accepted as Authorization: Bearer ak_… (apiKeyBearer). A request carries one credential: a key sent with a share token or a live session cookie is 400 (details.reason: ambiguous_credentials).

Scope: ingest:write

Request Body

application/json
  1. body
events*array<>
Items1 <= items <= 500

Response Body

OK

application/json
  1. response
data*
Example Request
curl -X POST 'https://pilotfox.app/api/v1/ingest/events' \  -H 'Content-Type: application/json' \  -d '{  "events": [    {      "site": "string",      "type": "pageview"    }  ]}'
Example Response200
{  "data": {    "accepted": -9007199254740991,    "rejected": [      {        "index": -9007199254740991,        "code": "invalid"      }    ]  }}