query

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-query"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/6b9f02b1-3d03-4964-99f8-d70e34c6b457/social-card.svg?v=3e7ae33eec8b" alt="query" width="600" height="315"></a>
GEThttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/logsScope insight:read

Parameters

project_idstringpathrequired
slugstringpathrequired
levelstringquery
info | error
qstringquery
Text in the error, path or execution id
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/logs"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of EndpointRun, newest first
404
PUThttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/materializationScope insight:write

Parameters

project_idstringpathrequired
slugstringpathrequired

Request body

application/json
enabledbooleanrequired
{
  "enabled": true
}

Code samples

cURL
curl -X PUT "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/materialization" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Switched; the first materialization starts immediately
Example
{
  "active": true,
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "current_version": 0,
  "description": "string",
  "id": "string",
  "last_error": "string",
  "last_refresh_at": "2024-01-01T00:00:00Z",
  "materialization_error": "string",
  "materialization_status": "string",
  "materialized": true,
  "materialized_at": "2024-01-01T00:00:00Z",
  "materialized_version": 0,
  "name": "string",
  "refresh_every_minutes": 0,
  "slug": "string",
  "updated_at": "2024-01-01T00:00:00Z"
}
Schema
activebooleanrequired
Inactive endpoints answer 404 to callers.
created_atstringrequired
created_bystring
current_versionintegerrequired
Version served when a caller names none.
descriptionstringrequired
idstringrequired
last_errorstring
last_refresh_atstring
materialization_errorstring
materialization_statusstring
pending | running | completed | failed; null when never materialized.
materializedbooleanrequired
Serve from precomputed rows (refreshed on the schedule) instead of running the query.
materialized_atstring
materialized_versioninteger
namestringrequired
refresh_every_minutesinteger
Refresh the current version this often; null = only on request.
slugstringrequired
updated_atstringrequired
400 Query not eligible (the detail says why)
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/openapi.jsonScope insight:read

Parameters

project_idstringpathrequired
slugstringpathrequired
versionintegerquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/openapi.json"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OpenAPI 3.0 document for this endpoint, with its variables as a schema
404
POSThttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/pinScope insight:write

Parameters

project_idstringpathrequired
slugstringpathrequired

Request body

application/json
versionintegerrequired
{
  "version": 0
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/pin" \
  -H "Content-Type: application/json" \
  -d '{"version":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Rolled back or forward to that version

Same as 200 · PUT /v1/projects/{project_id}/endpoints/{slug}/materialization

403
404
GEThttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/resultScope insight:read

Parameters

project_idstringpathrequired
slugstringpathrequired
versionintegerquery
refreshbooleanquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/result"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "refreshed_at": "2024-01-01T00:00:00Z",
  "result": {},
  "slug": "string",
  "version": 0
}
Schema
refreshed_atstringrequired
resultobjectrequired
A QueryResult.
slugstringrequired
versionintegerrequired
404
422
503
POSThttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/run

Parameters

project_idstringpathrequired
slugstringpathrequired

Request body

application/json
debugboolean
Include the compiled ClickHouse query in the response.
limitinteger
Rows to return (1 to 50000); required with offset.
offsetinteger
refreshstring
cache (default: cached or materialized result when present), force (recompute, update the cache) or direct (skip materialized rows and the cache).
variablesobject
Variable values by name (date_from/date_to and breakdown keys are built in).
versioninteger
{
  "debug": true,
  "limit": 0,
  "offset": 0,
  "refresh": "string",
  "variables": {},
  "version": 0
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/run" \
  -H "Content-Type: application/json" \
  -d '{"debug":true,"limit":0,"offset":0,"refresh":"string","variables":{},"version":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "cache_hit": true,
  "columns": [
    "string"
  ],
  "compiled_query": "string",
  "computed_at": "2024-01-01T00:00:00Z",
  "endpoint": "string",
  "execution_id": "string",
  "has_more": true,
  "materialized_at": "2024-01-01T00:00:00Z",
  "mode": "string",
  "results": [
    [
      {}
    ]
  ],
  "version": 0
}
Schema
cache_hitbooleanrequired
columnsstring[]required
compiled_querystring
Present with debug: true.
computed_atstringrequired
endpointstringrequired
execution_idstringrequired
Execution id: matches the log entry.
has_morebooleanrequired
More rows exist past offset + limit.
materialized_atstring
modestringrequired
cache | direct | materialized
resultsobject[][]required
versionintegerrequired
400 problem+json with code (required_variable_missing, variable_not_allowed, invalid_variable_value, invalid_request) and attr
403 The key lacks endpoint:read, query:read or admin
404 Unknown, inactive, or disabled version
422
429 Retry-After set
503 Retry-After set
504
GEThttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/versionsScope insight:read

Parameters

project_idstringpathrequired
slugstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/versions"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 {data: QueryEndpointVersion[]}, newest first (an endpoint holds few versions, so no cursor)
404
POSThttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/versionsScope insight:write

Parameters

project_idstringpathrequired
slugstringpathrequired

Request body

application/json
notestring
queryobjectrequired
variablesobject[]
As on create.
{
  "note": "string",
  "query": {},
  "variables": [
    {}
  ]
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/versions" \
  -H "Content-Type: application/json" \
  -d '{"note":"string","query":{},"variables":[{}]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
403
404
422
PATCHhttps://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/versions/{version}Scope insight:write

Parameters

project_idstringpathrequired
slugstringpathrequired
versionintegerpathrequired

Request body

application/json
disabledboolean
A disabled version answers 404; the current version cannot be disabled.
notestring
{
  "disabled": true,
  "note": "string"
}

Code samples

cURL
curl -X PATCH "https://lucidace.com/v1/projects/{project_id}/endpoints/{slug}/versions/{version}" \
  -H "Content-Type: application/json" \
  -d '{"disabled":true,"note":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "created_at": "2024-01-01T00:00:00Z",
  "created_by": "string",
  "disabled": true,
  "last_executed_at": "2024-01-01T00:00:00Z",
  "note": "string",
  "query": {},
  "result": {},
  "result_at": "2024-01-01T00:00:00Z",
  "variables": [
    {}
  ],
  "version": 0
}
Schema
created_atstringrequired
created_bystring
disabledbooleanrequired
Disabled versions answer 404.
last_executed_atstring
notestringrequired
queryobjectrequired
resultobject
Newest cached result (a QueryResult); null before the first run.
result_atstring
variablesobject[]required
[{name, type, default?, required?, description?}].
versionintegerrequired
400
403
404

Updated