WysLeap
WysLeap Docs

Erase a visitor's data

POST
/api/v1/subjects/erase

Permanently delete everything WysLeap holds for one of your site's visitors, to fulfil an erasure request (GDPR Art. 17, CCPA right to delete): page views, events, session replays, heatmap data, hot leads, journeys, fingerprints, visitor links, server events sent with only a userId, and the known-person record. Send a visitorId, or a userId or email for a known person; it covers every browser ID linked to the same person. This cannot be undone. As the controller, you verify the request before calling this. Limit: 60 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

Exactly one of visitorId, userId or email.

visitorId?string

The visitor's WysLeap visitor ID (WysLeap.visitorId in their browser), or the ID you sent with server events.

Match^[\w.-]{1,100}$
Lengthlength <= 100
userId?string

Your user ID for a known person (WysLeap.identify or userId on server events).

Lengthlength <= 200
email?string

The email given with identify() or a server event.

Formatemail

Response Body

What was deleted.

application/json
  1. response
visitorIds?array<string>
deleted?integer

Records deleted in total.

byCollection?

Records deleted per kind of data.

Example Request
curl -X POST https://wysleap.com/api/v1/subjects/erase \  -H "Authorization: Bearer $WYSLEAP_SECRET_KEY" \  -H "Content-Type: application/json" \  -d '{ "visitorId": "vis_abc123" }'
Example Response
{  "visitorIds": [    "string"  ],  "deleted": 0,  "byCollection": {    "property1": 0,    "property2": 0  }}