query
POST
https://lucidace.com /v1/projects/{project_id}/query/survival Scope insight:readKaplan-Meier curve and time-between-events histogram for a `survival` query. 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.95.
queryobjectrequiredA
survival Query IR document.refreshboolean{
"confidence": 0,
"query": {},
"refresh": true
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/query/survival" \
-H "Content-Type: application/json" \
-d '{"confidence":0,"query":{},"refresh":true}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"censored": 0,
"confidence": 0,
"converted": 0,
"curve": [
{
"at_risk": 0,
"censored": 0,
"events": 0,
"lower": 0,
"survival": 0,
"time_s": 0,
"upper": 0
}
],
"histogram": [
{
"count": 0,
"from_s": 0,
"to_s": 0
}
],
"median_s": 0,
"total": 0,
"unit_s": 0,
"window_days": 0
}Schema
censoredintegerrequiredconfidencenumberrequiredconvertedintegerrequiredcurveSurvivalCurvePoint[]requiredShow child parameters
at_riskintegerrequiredcensoredintegerrequiredeventsintegerrequiredlowernumberrequiredsurvivalnumberrequiredShare of people who have not yet had the end event after this bucket.
time_sintegerrequiredSeconds after the start event at the start of this bucket.
uppernumberrequiredhistogramHistogramBin[]requiredShow child parameters
countintegerrequiredPeople whose end event fell into this bucket.
from_sintegerrequiredto_sintegerrequiredmedian_sintegerSeconds until half the people had the end event (bucket start); null if fewer than half did.
totalintegerrequiredPeople who started in the range.
unit_sintegerrequiredwindow_daysintegerrequired202
400
404
422
429
503
GET
https://lucidace.com /v1/projects/{project_id}/query/{query_id} Scope insight:readParameters
project_idstringpathrequiredquery_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/query/{query_id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"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
Example
{
"query_id": "string",
"status": "string"
}Schema
query_idstringrequiredstatusstringrequired404
DELETE
https://lucidace.com /v1/projects/{project_id}/query/{query_id} Scope insight:readParameters
project_idstringpathrequiredquery_idstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/query/{query_id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
404
POST
https://lucidace.com /v1/projects/{project_id}/sql Scope insight:readParameters
project_idstringpathrequiredRequest body
application/json
breakdownstring{filters.breakdown}: an event property key.date_rangeobjectValue of
{filters}: {from, to?, explicit?}; unless explicit, days are snapped.explainbooleanAdd
meta.generated_sql (the rewritten ClickHouse text) to the response.filtersobjectProperty group applied by
{filters}.intervalstring{filters.interval}.refreshbooleanSkip the result cache and recompute.
sqlstringrequiredOne
SELECT in the LQL dialect.validate_onlybooleanCompile with the caller's access (views, live
wh_ tables, masking) and answer {valid, kind, columns} without running.variablesobject{variables.name} values.{
"breakdown": "string",
"date_range": {},
"explain": true,
"filters": {},
"interval": "string",
"refresh": true,
"sql": "string",
"validate_only": true,
"variables": {}
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/sql" \
-H "Content-Type: application/json" \
-d '{"breakdown":"string","date_range":{},"explain":true,"filters":{},"interval":"string","refresh":true,"sql":"string","validate_only":true,"variables":{}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
202 Still running after 5 s; poll GET /query/{query_id}
Same as 202 · GET /v1/projects/{project_id}/query/{query_id}
400 problem+json with message, line, column for compile errors
404
422
429
503
POST
https://lucidace.com /v1/projects/{project_id}/sql/complete Scope insight:readParameters
project_idstringpathrequiredRequest body
application/json
cursorintegerrequiredByte offset of the cursor in
sql.sqlstringrequired{
"cursor": 0,
"sql": "string"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/sql/complete" \
-H "Content-Type: application/json" \
-d '{"cursor":0,"sql":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
[
{
"detail": "string",
"kind": "string",
"label": "string"
}
]Schema
detailstringrequiredkindstringrequiredtable | column | functionlabelstringrequired404
GET
https://lucidace.com /v1/projects/{project_id}/sql/schema Scope insight:readParameters
project_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/sql/schema"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"tables": [
{
"columns": [
{
"name": "string",
"type": "string"
}
],
"name": "string"
}
]
}Schema
tablesTable[]requiredShow child parameters
columnsColumn[]requiredShow child parameters
namestringrequiredtypestringrequirednamestringrequired404
Updated