WysLeap
WysLeap Docs

Send server-side events

POST
/api/v1/events

Send events from your backend: signups, purchases, subscription changes. Authenticated with a site secret key (Authorization: Bearer wl_sk_…); one event per request, or up to 100 as { "events": [...] }.

Every event needs an eventId that is unique for your site. Retries with the same eventId are counted once.

Events that fail validation are listed in rejected with their index and the reason; the rest are still stored. The response is 400 only when every event was rejected. Limit: 600 requests a minute per secret key.

Authorization

SecretKeyBearer
headerAuthorizationBearer <token>

A site secret key (wl_sk_…) from Site Settings, for server-to-server calls. Never use it in a browser.

Request Body

application/json
  1. body
eventId*string

Your unique ID for this event, such as your order ID or your payment provider's event ID. Retries with the same eventId are counted once, so it's safe to resend after a timeout.

Lengthlength <= 128
type?string
Default"event"
Value in"event""pageview"
event?string

Event name in Title Case, e.g. "Purchase Completed" (required for type event).

Lengthlength <= 100
timestamp?string

When it happened, up to 72 hours ago. Defaults to now.

Formatdate-time
visitorId?string

The tracker's visitor ID for this person, if your site passed it to your backend.

Lengthlength <= 100
sessionId?string
Lengthlength <= 200
url?string

Page URL; campaign parameters in it are recorded (required for type pageview).

Formaturi
title?string
Lengthlength <= 300
referrer?string
Lengthlength <= 2048
properties?

JSON metadata, under 8 KB.

value?number

Monetary value of the event.

currency?string

ISO 4217 code for value, e.g. USD.

Match^[A-Z]{3}$
conversion?boolean

Mark the event as a conversion (or not); otherwise decided from its name.

Response Body

At least one event stored or already known.

application/json
  1. response
accepted?integer
duplicates?integer
rejected?array<>
Example Request
curl -X POST https://wysleap.com/api/v1/events \  -H "Authorization: Bearer $WYSLEAP_SECRET_KEY" \  -H "Content-Type: application/json" \  -d '{    "event": "Purchase Completed",    "eventId": "order_1042",    "visitorId": "vis_abc123",    "value": 49.0,    "currency": "USD",    "properties": { "plan": "Pro" }  }'
Example Response
{  "accepted": 1,  "duplicates": 0,  "rejected": []}