WysLeap
WysLeap Docs

Look up a visitor's data

POST
/api/v1/subjects/lookup

What WysLeap holds for one of your site's visitors, to answer an access request (GDPR Art. 15, CCPA right to know). Send a visitorId, or a userId or email for a known person. Covers every browser ID linked to the same person, and server events sent with only a userId. 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 is held, per linked ID.

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

The ID you sent plus every browser ID linked to the same person.

visitors?array<>
serverOnly?

Server events counted as this person that carry no visitor ID of their own.

Example Request
curl -X POST https://wysleap.com/api/v1/subjects/lookup \  -H "Authorization: Bearer $WYSLEAP_SECRET_KEY" \  -H "Content-Type: application/json" \  -d '{ "visitorId": "vis_abc123" }'
Example Response
{  "visitorIds": [    "string"  ],  "visitors": [    {      "visitorId": "string",      "pageviews": 0,      "events": 0,      "sessions": 0,      "replays": 0,      "firstSeen": "2019-08-24T14:15:22Z",      "lastSeen": "2019-08-24T14:15:22Z",      "browser": "string",      "country": "string",      "screenResolution": "string",      "recentPages": [        {          "path": "string",          "at": "2019-08-24T14:15:22Z"        }      ]    }  ],  "serverOnly": {    "pageviews": 0,    "events": 0  }}