query
POST
https://lucidace.com /v1/projects/{project_id}/query Scope insight:readParameters
project_idstringpathrequiredRequest body
application/json
client_query_idstringYour id for this run (
[A-Za-z0-9_-], at most 64): poll and cancel by it. A second call with the same id while the run is in progress attaches to it (202, same query_id).filters_overrideobject{date_range?: {from, to}, filters?: group}: replaces the date range and ANDs the filters, as dashboard overrides do. Insight kinds with a date range only.namestringLabel for the server log (at most 128 characters).
offsetintegerNot supported: results are not paged by offset (400); use
limit in the query.queryobjectrequiredA Query IR document (
{"kind": "trends" | "funnel" | "retention", ...}); JSON Schema: GET /v1/query.schema.json; examples: help page query-api.refreshRefreshModevalidate_onlybooleanParse and compile only (the insight source editor): 200
{valid, kind, columns}.variables_overrideobject{name: value} replacing the variables of a sql query (dashboard variable overrides).{
"client_query_id": "string",
"filters_override": {},
"name": "string",
"offset": 0,
"query": {},
"refresh": "blocking",
"validate_only": true,
"variables_override": {}
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/query" \
-H "Content-Type: application/json" \
-d '{"client_query_id":"string","filters_override":{},"name":"string","offset":0,"query":{},"refresh":"blocking","validate_only":true,"variables_override":{}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Result, or
Validated with validate_onlyExample
{
"columns": [
"string"
],
"meta": {
"bytes_read": 0,
"cache_hit": true,
"cache_key": "string",
"clamped_range": true,
"computed_at": "2024-01-01T00:00:00Z",
"execution_ms": 0,
"next_allowed_client_refresh": "2024-01-01T00:00:00Z",
"rows_read": 0,
"sampled": true,
"sql_hash": "string"
},
"rows": [
[
{}
]
]
}Schema
columnsstring[]requiredmetaobjectrequiredShow child parameters
bytes_readintegerBytes
ClickHouse read, like rows_read.cache_hitbooleanrequiredcache_keystringrequiredStable hash of the cache key (project, SQL, timezone, canonical query).
clamped_rangebooleanrequiredcomputed_atstringrequiredWhen the result was computed (
last_refresh).execution_msintegerWall time of the
ClickHouse call; None on a cache hit.next_allowed_client_refreshstringrequiredBefore this,
refresh: "force_*" recomputes but the dashboards' auto refresh serves the cache.rows_readintegerRows
ClickHouse read (its X-ClickHouse-Summary header); None when not reported.sampledbooleanrequiredsql_hashstringrequiredrowsobject[][]required202 Still running after 5 s; poll GET /query/{query_id}
Example
{
"query_id": "string",
"status": "string"
}Schema
query_idstringrequiredstatusstringrequired400
404 Project absent, or
force_cache with no cached result422
429
503
GET
https://lucidace.com /v1/projects/{project_id}/query-log Scope insight:readParameters
project_idstringpathrequiredstatusstringqueryok | cached | error
limitintegerquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/query-log"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of QueryLogEntry, newest first
Example
{
"data": [
{
"api_key_id": "string",
"created_at": "2024-01-01T00:00:00Z",
"duration_ms": 0,
"error": "string",
"id": "string",
"kind": "string",
"name": "string",
"row_count": 0,
"status": "string",
"user_id": "string"
}
],
"next_cursor": "string"
}Schema
dataQueryLogEntry[]requiredShow child parameters
api_key_idstringcreated_atstringrequiredduration_msintegerClickHouse wall time; absent for cache hits and errors.errorstringrequiredidstringrequiredkindstringrequiredQuery IR kind (
trends, funnel, ...).namestringrequiredThe caller's
name, "" when unnamed.row_countintegerrequiredstatusstringrequiredok | cached | erroruser_idstringnext_cursorstring400
404
POST
https://lucidace.com /v1/projects/{project_id}/query/forecast Scope insight:readProject a trends query forward. Past 5 s the call answers 202 like `POST /query`; repeat it once the query finished (the result is cached).
Parameters
project_idstringpathrequiredRequest body
application/json
confidencenumberInterval level in (0, 1), default 0.8.
horizonintegerBuckets to project (1 to 90, default 7).
queryobjectrequiredA trends Query IR document.
refreshbooleanseasonintegerSeason length in buckets; default 7 for day, 24 for hour, none for week and month. 0 = none.
{
"confidence": 0,
"horizon": 0,
"query": {},
"refresh": true,
"season": 0
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/query/forecast" \
-H "Content-Type: application/json" \
-d '{"confidence":0,"horizon":0,"query":{},"refresh":true,"season":0}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"confidence": 0,
"interval": "string",
"season": 0,
"series": [
{
"breakdown": "string",
"forecast": [
{
"bucket": "string",
"lower": 0,
"point": 0,
"upper": 0
}
],
"history": [
{
"bucket": "string",
"value": 0
}
],
"series": 0
}
]
}Schema
confidencenumberrequiredintervalstringrequiredseasonintegerrequiredseriesSeriesForecast[]requiredSeries too short to fit are left out.
Show child parameters
breakdownstringThe breakdown value of the series, when the query has a breakdown.
forecastForecastPoint[]requiredShow child parameters
bucketstringrequiredlowernumberrequiredpointnumberrequireduppernumberrequiredhistoryPoint[]requiredShow child parameters
bucketstringrequiredvaluenumberrequiredseriesintegerrequired202
400
404
422
429
503
POST
https://lucidace.com /v1/projects/{project_id}/query/impact Scope insight:readWhich early behaviours go with reaching a goal. Past 5 s the call answers 202 like `POST /query`; repeat it once the query finished (the result is cached).
Parameters
project_idstringpathrequiredRequest body
application/json
alphanumberSignificance level in (0, 1), default 0.05.
queryobjectrequiredAn
impact Query IR document.refreshboolean{
"alpha": 0,
"query": {},
"refresh": true
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/query/impact" \
-H "Content-Type: application/json" \
-d '{"alpha":0,"query":{},"refresh":true}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"alpha": 0,
"behaviour_days": 0,
"candidates": [
{
"adjusted_p_value": 0,
"ci_high": 0,
"ci_low": 0,
"conversion_with": 0,
"conversion_without": 0,
"converted_with": 0,
"converted_without": 0,
"correlation": 0,
"difference": 0,
"event": "string",
"lift": 0,
"p_value": 0,
"people_with": 0,
"people_without": 0,
"significant": true
}
],
"converted": 0,
"goal_days": 0,
"note": "string",
"people": 0
}Schema
alphanumberrequiredbehaviour_daysintegerrequiredcandidatesImpactCandidate[]requiredLargest absolute correlation first.
Show child parameters
adjusted_p_valuenumberBenjamini-Hochberg adjusted across the listed candidates.
ci_highnumberci_lownumberconversion_withnumberrequiredGoal rate among people who did the event.
conversion_withoutnumberrequiredconverted_withintegerrequiredconverted_withoutintegerrequiredcorrelationnumberPhi coefficient of event x goal, -1 to 1.
differencenumberconversion_with - conversion_without.eventstringrequiredliftnumberconversion_with / conversion_without - 1; null when nobody without it converted.p_valuenumberTwo-sided two-proportion z-test; null when the groups cannot be compared.
people_withintegerrequiredpeople_withoutintegerrequiredsignificantbooleanrequiredAdjusted p-value below
alpha.convertedintegerrequiredgoal_daysintegerrequirednotestringrequiredAlways states the limit of the method.
peopleintegerrequiredPeople who started in the range and were observed for the whole window.
202
400
404
422
429
503
POST
https://lucidace.com /v1/projects/{project_id}/query/personas Scope insight:readCluster the people of a `persona_features` query into personas. Past 5 s the call answers 202 like `POST /query`; repeat it once the query finished (the result is cached).
Parameters
project_idstringpathrequiredRequest body
application/json
kintegerNumber of personas (2 to 8, default 4).
queryobjectrequiredA
persona_features Query IR document.refreshboolean{
"k": 0,
"query": {},
"refresh": true
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/query/personas" \
-H "Content-Type: application/json" \
-d '{"k":0,"query":{},"refresh":true}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"features": [
"string"
],
"k": 0,
"people": 0,
"personas": [
{
"centre": {},
"example_person_ids": [
"string"
],
"index": 0,
"label": "string",
"people": 0,
"share": 0,
"traits": [
{
"feature": "string",
"z": 0
}
]
}
]
}Schema
featuresstring[]requiredkintegerrequiredpeopleintegerrequiredPeople clustered (the query returns at most the project row cap).
personasPersona[]requiredShow child parameters
centreobjectrequiredCluster centre per feature, in the feature's own unit.
example_person_idsstring[]requiredindexintegerrequiredlabelstringrequiredpeopleintegerrequiredsharenumberrequiredtraitsPersonaTrait[]requiredFeatures that set the persona apart, strongest first.
Show child parameters
featurestringrequiredznumberrequiredStandard deviations from the all-people mean.
202
400
404
422
429
503
Updated