Siren

Events

Event ingestion API. POST a registered slug to create a domain event from outside the WordPress runtime — site visits, sales, refunds, and anything else extensions register.

Requires Siren Pro

Last updated: October 26, 2026

Events come from your server with credentials on /event/{slug}, and a visitor’s browser records a referred visit on /track/visit with no credentials.

The event ingestion API turns external HTTP requests into Siren domain events. A POST to /event/{slug} looks up a registered factory by slug, builds the corresponding event from the request body, and broadcasts it through the same event system that powers WordPress-rendered traffic. Engagement triggers, conversion building, and obligation creation all run identically — the API is just a transport.

This is the primary interface a headless frontend, a connector plugin, or any non-WordPress runtime uses to participate in Siren’s attribution pipeline. The headless attribution guide walks through the most common usage end to end.

Endpoints

MethodPathDescription
POST/track/visitRecord a referred visit from a visitor’s browser. Takes no credentials.
POST/event/site-visitedReport a site visit from your server. Creates or updates an opportunity for a referred visitor.
POST/event/saleReport a sale. Creates a sale event for a sale from a non-WordPress checkout, such as one a custom commerce bridge reports.
POST/event/refundReport a refund. Reverses a previously reported sale by external ID.

Tier availability

The event ingestion controller lives in lib/Events, which ships with Siren Pro. Lite, Essentials, and Plus do not include it, so on those editions WordPress answers /event/{slug} and /track/visit with 404 and the code rest_no_route. On Siren Cloud, every plan can send events with an API key.

Authentication

In a WordPress install, every /event/{slug} request needs a signed-in administrator or Siren Platform Manager, for every event type, site-visited and custom events included. A headless frontend sends these from its server with a WordPress application password over HTTP Basic auth. Keep the application password on the server.

A visitor’s browser records a referred visit on /track/visit instead. That route takes no credentials and records only an anonymous visit.

On Siren Cloud, send events to https://api.sirenaffiliates.com/siren/v1/event/{slug} with an API key in Authorization: Bearer sk_live_.... The key needs event:* or the event’s own scope, such as event:sale, or the request answers 403 with the code missing_scope. An organization can send 5,000 events a minute, and over that the API answers 429 with Retry-After. Siren Cloud has no /track/visit route. A Stripe or Shopify store records visits with the tracking line, and your own server reports them on /event/site-visited.

Response shape

Every event-ingestion endpoint returns 200 OK on success. The refund endpoint returns an empty body. The sale and site-visited endpoints return a JSON body that says what Siren did with the event, described on each event’s page. On Siren Cloud, while your organization’s processing is paused, the response can be 202 or 429 instead. A 202 doesn’t mean Siren recorded the event. Siren writes the opportunity ID for the request to the X-Siren-OID response header, whether it created a new one or resolved it from an inbound X-Siren-OID header or browser cookie. The response also includes Access-Control-Expose-Headers: X-Siren-OID so JavaScript can read the value across origins.

Validation failures return 400 with the field errors. Unknown slugs return 404.

In a WordPress install, a request with no signed-in user answers 401 with the code rest_not_logged_in and the message “Sign in to send events. Headless sites send a WordPress application password from their server. Browsers record referred visits on /track/visit.” A signed-in user who can’t send events gets 403 with the code rest_forbidden and “You don’t have permission to send events.” Both come back in WordPress’s {code, message, data} error shape. WordPress itself refuses a wrong application password before Siren runs, with its own 401 code, such as incorrect_password. On Siren Cloud, API Keys lists the codes a refused key gets.

Adding new event factories

The factory registry is event-driven. An extension can listen for EventFactoryRegistryInitiated and call addFactoryClass(MyEventFactory::class) to register a new slug. The factory implements EventFactory, declares its slug, validation rules, and how to build a domain event from the request. The extension quickstart and event bindings and transformers cover the patterns.

Your privacy choices

Account, checkout and chat you request work without optional tracking. Choose whether to allow these other uses on this website.

You can change or withdraw your choices at any time using “Privacy choices.” We remember your choice for 180 days. Read our privacy policy.