capture

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-capture"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/603d7e7b-5567-48b1-95ab-4d6e482e54fa/social-card.svg?v=3e7ae33eec8b" alt="capture" width="600" height="315"></a>
GEThttps://lucidace.com/v1/p.gif

Tracking pixel

Public key as k (or api_key), event name as e. Signed pixels (sig, x) are verified; see POST /v1/pixel/sign.

Parameters

kstringqueryrequired
Public key.
estringqueryrequired
Event name.

Code samples

cURL
curl -X GET "https://lucidace.com/v1/p.gif?k=<k>&e=<e>" \
  -H "Authorization: Bearer $LUCIDACE_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 A 1x1 GIF; the event is recorded from the query string.
"string"
401 Missing or invalid api key (or a public key on a secret-only route).
404 Not found, or the key may not read it.
429 Rate limit; honour Retry-After.
POSThttps://lucidace.com/v1/pixel/sign

Sign a pixel URL (secret key only)

Secret key only. Returns a pixel URL carrying the project's public key and a signature, for emails and server-rendered pages.

Request body

application/json
{}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/pixel/sign" \
  -H "Authorization: Bearer $LUCIDACE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 {url, expires_at}.
{}
400 Malformed body (problem+json).
401 Missing or invalid api key.
429 Rate limit; honour Retry-After.
GEThttps://lucidace.com/v1/profiles/groups/{type_index}/{key}

Read one group profile

Secret key with the profiles:read scope.

Parameters

type_indexstringpathrequired
Group type index, 0 to 4.
keystringpathrequired
The group key.

Code samples

cURL
curl -X GET "https://lucidace.com/v1/profiles/groups/{type_index}/{key}" \
  -H "Authorization: Bearer $LUCIDACE_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 The group profile.
{}
401 Missing or invalid api key (or a public key on a secret-only route).
404 Not found, or the key may not read it.
429 Rate limit; honour Retry-After.
GEThttps://lucidace.com/v1/profiles/{distinct_id}

Read one person profile

Secret key with the profiles:read scope. Other keys and projects with the profile API off answer 404.

Parameters

distinct_idstringpathrequired
The person's distinct id.

Code samples

cURL
curl -X GET "https://lucidace.com/v1/profiles/{distinct_id}" \
  -H "Authorization: Bearer $LUCIDACE_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 The profile: properties, traits and cohort memberships.
{}
401 Missing or invalid api key (or a public key on a secret-only route).
404 Not found, or the key may not read it.
429 Rate limit; honour Retry-After.
POSThttps://lucidace.com/v1/replay

Send a chunk of session recording

Public or secret key. Up to 10 MB decompressed. Three equivalent forms: plain JSON events; events as a base64 gzip string (with ?compression=gzip); or the whole body gzipped (Content-Encoding: gzip or ?compression=gzip). seq is required. Answers {"status":1}.

Request body

application/json
api_keystring
Project key; or Authorization: Bearer <key>.
eventsobject[] | stringrequired
rrweb events: a Meta (type 4) and a FullSnapshot (type 2) to start, then Incremental (type 3). Either the JSON array, or a string holding the base64 of the gzipped JSON array (send ?compression=gzip with it). Alternatively gzip the whole request body (Content-Encoding: gzip or ?compression=gzip).
seqintegerrequired
Monotonic per window; resets when the session rotates.
session_idstringrequired
The session's UUID; set the same value as $session_id on the session's events to link them.
window_idstring
One id per tab or window. Optional; chunks without one share a single window.
{
  "api_key": "string",
  "events": [
    {}
  ],
  "seq": 0,
  "session_id": "string",
  "window_id": "string"
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/replay" \
  -H "Authorization: Bearer $LUCIDACE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api_key":"string","events":[{}],"seq":0,"session_id":"string","window_id":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Accepted (at least once; dedupe is by event uuid).
Example
{
  "status": 1
}
Schema
statusinteger
1
400 Malformed body or event (problem+json); nothing was accepted, retry is safe.
401 Missing or invalid api key (or a public key on the secret-only route).
413 Body, batch (1000 events) or single event too large.
429 Rate or quota limit; honour Retry-After.
POSThttps://lucidace.com/v1/s2s/batch

Send events from a server (secret key only)

Secret key only; historical timestamps are kept and events drain behind live data.

Request body

application/json
api_keystring
Project key (lc_pk_... public, or secret). May instead be Authorization: Bearer <key>.
batchCaptureEvent[]required
Show child parameters
distinct_idstringrequired
Who did it (your user id or an anonymous id).
eventstringrequired
Event name, e.g. purchase; $-prefixed names are Lucida's own.
propertiesobject
$lc_* keys are stripped. Strings are cut at 64 KiB; an event over about 1 MiB is rejected with 413.
timestampstring
RFC 3339. Public keys: outside -30 days..+1 hour it is replaced by arrival time. Omitted = arrival time.
uuidstring
Idempotency key: a retry with the same uuid is deduplicated. A non-UUID value discards the event with a warning.
historical_migrationboolean
Secret key only: ingest on the backfill lane.
sent_atstring
Client send time; used to correct clock skew.
{
  "api_key": "string",
  "batch": [
    {
      "distinct_id": "string",
      "event": "string",
      "properties": {},
      "timestamp": "2024-01-01T00:00:00Z",
      "uuid": "string"
    }
  ],
  "historical_migration": true,
  "sent_at": "2024-01-01T00:00:00Z"
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/s2s/batch" \
  -H "Authorization: Bearer $LUCIDACE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api_key":"string","batch":[{"distinct_id":"string","event":"string","properties":{},"timestamp":"2024-01-01T00:00:00Z","uuid":"string"}],"historical_migration":true,"sent_at":"2024-01-01T00:00:00Z"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Accepted (at least once; dedupe is by event uuid).

Same as 200 · POST /v1/replay

400 Malformed body or event (problem+json); nothing was accepted, retry is safe.
401 Missing or invalid api key (or a public key on the secret-only route).
413 Body, batch (1000 events) or single event too large.
429 Rate or quota limit; honour Retry-After.
Updated