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>
POSThttps://lucidace.com/2/httpapi

Amplitude-compatible HTTP API

Public or secret key as api_key. Amplitude events are mapped to Lucida events.

Request body

application/json
{}

Code samples

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

Responses

200 {code: 200, events_ingested}.
{}
400 Malformed body (problem+json).
401 Missing or invalid api key.
429 Rate limit; honour Retry-After.
POSThttps://lucidace.com/decide

PostHog-compatible /decide

Public or secret key as api_key or token. Answers in the PostHog decide shape so PostHog SDKs can evaluate flags.

Request body

application/json
{}

Code samples

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

Responses

200 PostHog decide response.
{}
400 Malformed body (problem+json).
401 Missing or invalid api key.
429 Rate limit; honour Retry-After.
POSThttps://lucidace.com/ofrep/v1/evaluate/flags

OpenFeature remote evaluation: all flags

Public or secret key in X-API-Key or Authorization: Bearer. OFREP 1.x.

Request body

application/json
{}

Code samples

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

Responses

200 Every flag's OFREP result.
{}
400 Malformed body (problem+json).
401 Missing or invalid api key.
429 Rate limit; honour Retry-After.
POSThttps://lucidace.com/ofrep/v1/evaluate/flags/{key}

OpenFeature remote evaluation: one flag

Public or secret key in X-API-Key or Authorization: Bearer. OFREP 1.x.

Parameters

keystringpathrequired
Flag key.

Request body

application/json
{}

Code samples

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

Responses

200 The OFREP evaluation result.
{}
400 Malformed body (problem+json).
401 Missing or invalid api key.
429 Rate limit; honour Retry-After.
POSThttps://lucidace.com/track

Mixpanel-compatible /track

Public or secret key as the token. Also accepts GET. Mixpanel events are mapped to Lucida events.

Request body

application/json
{}

Code samples

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

Responses

200 1 or {status: 1}.
{}
400 Malformed body (problem+json).
401 Missing or invalid api key.
429 Rate limit; honour Retry-After.
POSThttps://lucidace.com/v1/batch

Send up to 1000 events

Public or secret key. Body up to 20 MB.

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/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).
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/capture

Send one event

Public or secret key. Body up to 1 MB; the body is the event itself.

Request body

application/json
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.
api_keystring
{
  "distinct_id": "string",
  "event": "string",
  "properties": {},
  "timestamp": "2024-01-01T00:00:00Z",
  "uuid": "string",
  "api_key": "string"
}

Code samples

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

Responses

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

Same as 200 · POST /v1/batch

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.
GEThttps://lucidace.com/v1/config

Remote SDK config

Public or secret key. Recording, autocapture, consent and privacy settings for the browser SDK.

Code samples

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

Responses

200 The project's SDK config.
{}
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/flags

Evaluate flags for one user (decide)

Public or secret key. Sticky assignments (filters.sticky) are applied; see the flags help page.

Request body

application/json
api_keystring
Project key; may instead be Authorization: Bearer <key>.
bucketing_keystring
distinct_idstringrequired
Bucketing unit; required unless bucketing_key is sent.
flag_keysstring[]
Only these flags; omitted = all.
group_propertiesobject
groupsobject
person_propertiesobject
record_exposureboolean
Like send_exposure, with a deterministic event uuid: UUIDv5 over project, distinct_id, flag, value, UTC day and event name, so a retry or repeat call for the same user, flag and value on one UTC day is one row. Flags that need the server or lack a bucketing key are skipped.
= false
send_exposureboolean
Also record $feature_flag_called and $exposure per decided flag, with a random event uuid (not deduped).
= false
{
  "api_key": "string",
  "bucketing_key": "string",
  "distinct_id": "string",
  "flag_keys": [
    "string"
  ],
  "group_properties": {},
  "groups": {},
  "person_properties": {},
  "record_exposure": false,
  "send_exposure": false
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/flags" \
  -H "Authorization: Bearer $LUCIDACE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"api_key":"string","bucketing_key":"string","distinct_id":"string","flag_keys":["string"],"group_properties":{},"groups":{},"person_properties":{},"record_exposure":false,"send_exposure":false}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Every flag's result, by key.
Example
{
  "flags": {},
  "quota_limited": true,
  "request_id": "string"
}
Schema
flagsobject
quota_limitedboolean
Plan quota exhausted: no flags evaluated; keep cached values.
request_idstring
400 Malformed body or no distinct_id (problem+json).
401 Missing or invalid api key.
429 Rate limit; honour Retry-After.
503 Flag definitions unavailable; retry.
POSThttps://lucidace.com/v1/flags/batch

Evaluate flags for many users

Public or secret key. Body {users: [{distinct_id, ...}], flag_keys?}; one result per user.

Request body

application/json
{}

Code samples

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

Responses

200 One result per user, in order.
{}
400 Malformed body (problem+json).
401 Missing or invalid api key.
429 Rate limit; honour Retry-After.
GEThttps://lucidace.com/v1/flags/definitions

Flag definitions for local evaluation

Secret key only. Supports If-None-Match (ETag).

Code samples

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

Responses

200 Definitions, cohorts and segments.
{}
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/flags/stream

Flag change notifications (SSE)

Public or secret key. A change notice only; refetch POST /v1/flags on each event.

Code samples

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

Responses

200 Server-sent events: a definitions event with the current ETag on connect and after each flag change.
"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.
GEThttps://lucidace.com/v1/flags/{key}/remote-config

Remote-config payload of one flag

Secret key only. The plaintext payload of a json flag, without evaluating targeting.

Parameters

keystringpathrequired
Flag key.

Code samples

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

Responses

200 The payload.
{}
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.

Updated