Profile API

A low-latency read of one person or group for personalization and AI agents: the properties you allowlist, computed traits, current cohort memberships and...

Embed
Preview of the card
<a href="https://lucidace.com/help/profile-api"><img src="https://lucidace.com/help/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/2f4b888b-c4e6-488b-81bd-6e838fb12d2e/pages/b105eb76-d735-4c77-96e7-029785020571/social-card.svg?v=3e7ae33eec8b" alt="Profile API" width="600" height="315"></a>

A low-latency read of one person or group for personalization and AI agents: the properties you allowlist, computed traits, current cohort memberships and the last events. The gateway serves it with an edge cache, so a website backend, an edge function or an agent tool can call it on every request.

Turn it on (Customers, Profile API)

Off by default. Nothing outside the lists below is ever returned.

Setting (PUT /v1/projects/{id}/settings/profiles)

Default

Meaning

enabled

false

Serve profiles to profiles:read keys (members can preview while it is off)

properties

none

Person properties served (exact names, up to 200)

group_properties

none

Group properties served on group profiles

event_properties

none

Event properties kept on the last events (name and time are always there)

include_traits

true

Enabled computed traits of the entity (Customers, Computed traits)

include_cohorts

true

The person's current cohort memberships (id and name)

events_limit

10

Last events served, 0 to 50, from the last 90 days

cache_ttl_secs

30

How long the gateway caches a profile, 0 to 3600 (0 = no edge cache)

Properties tagged PII in the data catalog stay masked unless the key also holds pii:read.

The key

Create a secret key with the profiles:read scope (Project settings, API keys). The scope grants nothing else: the key cannot query, read persons through the management API or capture. A valid key without the scope gets 403 (the key's own permission); a profile that does not exist, or a project with the API off, gets 404. Public keys get 401.

Requests

GET {gateway}/v1/profiles/{distinct_id}?events=5
GET {gateway}/v1/profiles/groups/{group_type_index}/{group_key}
Authorization: Bearer <secret key with profiles:read>

events asks for fewer last events than the project serves (never more). The answer:

{
  "type": "person",
  "distinct_id": "user-42",
  "person_id": "0192...",
  "properties": {"plan": "pro"},
  "traits": {"trait_orders_30d": 4},
  "cohorts": [{"id": "0193...", "name": "Power users"}],
  "events": [{"event": "checkout", "timestamp": "2026-11-01 09:12:01.000", "properties": {"amount": 40}}],
  "cache_ttl_secs": 30,
  "enabled": true
}

Headers: Cache-Control: private, max-age=<remaining ttl> and X-Lucida-Cache: hit|miss. Unknown ids answer 404 and are cached for 10 seconds, so a lookup storm for a missing id stays at the edge.

How it works

The gateway authenticates the key (profiles:read, secret), then answers from its in-memory cache keyed by project, profile, events and whether the key holds pii:read. On a miss it calls lc-api (GET /v1/projects/{id}/profiles/..., LC_API_URL) with the caller's key; lc-api checks the scope and the switch again, reads the person or group from ClickHouse, applies the allowlist and masking and sets the cache time. A settings change reaches the edge when the cached entries expire.

Variable

Where

Meaning

LC_API_URL

lc-gateway

lc-api base the profile API reads through; unset = 503

The same profile is available to members at GET /v1/projects/{id}/profiles/{distinct_id} (person read) for previews and tests.

Updated