Skip to content

Events ​

Server-side events.

Generated

This page is generated from api/openapi/v1.yaml (OpenAPI 3.1.0, API version 1.0.0).

Send server-side events ​

POST/v1/properties/{pid}/events

Scope: events:write. Up to 500 events per call, using the same canonical model as the tag (page_view, purchase, add_to_cart, sign_up… or your own snake_case names). Events are forwarded to the collector and appear in reports within seconds. Each event needs a visitor_id or a user_id. Send an Idempotency-Key header to make retries safe: the first response is replayed for 24 hours. Use actor_type when your backend knows an agent acted (for example an order placed through an agent API).

Parameters ​

NameInTypeRequiredDescription
pidpathstringyesProperty id.
Idempotency-KeyheaderstringMakes retries safe. Same key + same body replays the first response for 24 hours; same key + different body answers 409.

Request body ​

FieldTypeRequiredDescription
eventsarray of objectyes
json
{
  "events": [
    {
      "name": "purchase",
      "user_id": "u_8f2c",
      "timestamp": "2026-10-29T14:03:00Z",
      "actor_type": "ai_agent",
      "actor_name": "chatgpt-agent",
      "ecommerce": {
        "transaction_id": "T-10293",
        "revenue": 129,
        "currency": "EUR",
        "items": [
          {
            "id": "SKU-4411",
            "name": "Trail runner 2",
            "price": 129,
            "quantity": 1
          }
        ]
      }
    }
  ]
}

Responses ​

StatusDescription
202Accepted and forwarded to the collector.
400Invalid body or query (invalid_request), with errors[] for validation failures.
401Missing, invalid, expired or revoked API key (unauthorized).
403The key lacks the required scope (forbidden_scope).
404Unknown endpoint, or a property / object that does not exist or is not accessible with this key (not_found).
409Invalid body or query (invalid_request), with errors[] for validation failures.

Response fields

FieldTypeRequiredDescription
acceptedintegeryesNumber of events accepted.
batchesintegeryesNumber of wire batches sent to the collector.

Agents & humans, every visit counts!