cohorts
GET
https://lucidace.com /v1/projects/{project_id}/cohorts Scope cohort:readParameters
project_idstringpathrequiredlimitintegerqueryqstringquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/cohorts"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of Cohort, newest first
Example
{
"data": [
{
"created_at": "2024-01-01T00:00:00Z",
"created_by": "string",
"description": "string",
"filters": {},
"id": "string",
"kind": "string",
"last_computed_at": "2024-01-01T00:00:00Z",
"last_error": "string",
"member_count": 0,
"name": "string",
"realtime": true,
"status": "string",
"updated_at": "2024-01-01T00:00:00Z",
"version": 0
}
],
"next_cursor": "string"
}Schema
dataCohort[]requiredShow child parameters
created_atstringrequiredcreated_bystringdescriptionstringrequiredfiltersobjectrequiredDynamic: the
lc-cohort definition tree. Static: {}.idstringrequiredkindstringrequiredstatic | dynamic.last_computed_atstringlast_errorstringmember_countintegernamestringrequiredrealtimebooleanrequiredDynamic cohorts: members are also added from the event stream as they qualify (G181).
statusstringrequiredpending | calculating | ready | error.updated_atstringrequiredversionintegerrequiredBumped on every definition change.
next_cursorstring404
POST
https://lucidace.com /v1/projects/{project_id}/cohorts Scope cohort:writeParameters
project_idstringpathrequiredRequest body
application/json
descriptionstringfiltersobjectDynamic cohorts: an and/or tree of criteria,
{"type": "and", "values": [{"type": "performed", "event": "x", "window": {"days": 7}}]} (performed, not_performed, sequence, person_property, in_cohort, not_in_cohort, lifecycle, stopped, started); help page cohorts-actions-api.kindstringrequireddynamic (needs filters) or static (fill it with POST .../upload).namestringrequiredrealtimebooleanDynamic cohorts: also add members from the event stream as they qualify. Only for and/or trees of
performed (event, at least once, last N days) and person_property (eq) criteria; the 15-minute recalculation still removes people who left.{
"description": "string",
"filters": {},
"kind": "string",
"name": "string",
"realtime": true
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts" \
-H "Content-Type: application/json" \
-d '{"description":"string","filters":{},"kind":"string","name":"string","realtime":true}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201
Example
{
"created_at": "2024-01-01T00:00:00Z",
"created_by": "string",
"description": "string",
"filters": {},
"id": "string",
"kind": "string",
"last_computed_at": "2024-01-01T00:00:00Z",
"last_error": "string",
"member_count": 0,
"name": "string",
"realtime": true,
"status": "string",
"updated_at": "2024-01-01T00:00:00Z",
"version": 0
}Schema
created_atstringrequiredcreated_bystringdescriptionstringrequiredfiltersobjectrequiredDynamic: the
lc-cohort definition tree. Static: {}.idstringrequiredkindstringrequiredstatic | dynamic.last_computed_atstringlast_errorstringmember_countintegernamestringrequiredrealtimebooleanrequiredDynamic cohorts: members are also added from the event stream as they qualify (G181).
statusstringrequiredpending | calculating | ready | error.updated_atstringrequiredversionintegerrequiredBumped on every definition change.
400
403
404
POST
https://lucidace.com /v1/projects/{project_id}/cohorts/from-query Scope cohort:writeParameters
project_idstringpathrequiredRequest body
application/json
descriptionstringnamestringrequiredqueryobjectrequiredAn
insight_actors or funnel_persons query IR (its limit is raised to 10 000), or a sql query with a person_id column (the first 10 000 distinct persons are kept).{
"description": "string",
"name": "string",
"query": {}
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts/from-query" \
-H "Content-Type: application/json" \
-d '{"description":"string","name":"string","query":{}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201
Example
{
"added": 0,
"cohort": {
"created_at": "2024-01-01T00:00:00Z",
"created_by": "string",
"description": "string",
"filters": {},
"id": "string",
"kind": "string",
"last_computed_at": "2024-01-01T00:00:00Z",
"last_error": "string",
"member_count": 0,
"name": "string",
"realtime": true,
"status": "string",
"updated_at": "2024-01-01T00:00:00Z",
"version": 0
}
}Schema
addedintegerrequiredPersons the query returned.
cohortobjectrequiredShow child parameters
created_atstringrequiredcreated_bystringdescriptionstringrequiredfiltersobjectrequiredDynamic: the
lc-cohort definition tree. Static: {}.idstringrequiredkindstringrequiredstatic | dynamic.last_computed_atstringlast_errorstringmember_countintegernamestringrequiredrealtimebooleanrequiredDynamic cohorts: members are also added from the event stream as they qualify (G181).
statusstringrequiredpending | calculating | ready | error.updated_atstringrequiredversionintegerrequiredBumped on every definition change.
400
403
404
422
503
POST
https://lucidace.com /v1/projects/{project_id}/cohorts/snapshot Scope cohort:writeParameters
project_idstringpathrequiredRequest body
application/json
descriptionstringfiltersobjectrequiredA cohort definition (as for dynamic cohorts), evaluated once now.
namestringrequired{
"description": "string",
"filters": {},
"name": "string"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts/snapshot" \
-H "Content-Type: application/json" \
-d '{"description":"string","filters":{},"name":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201 A static cohort of who matches now; the definition is kept, read-only
400
404
503
GET
https://lucidace.com /v1/projects/{project_id}/cohorts/{id} Scope cohort:readParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}"TypeScript
Python
Go
PHP
Ruby
Java
DELETE
https://lucidace.com /v1/projects/{project_id}/cohorts/{id} Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
403
404
409 Another cohort or a flag references it
PATCH
https://lucidace.com /v1/projects/{project_id}/cohorts/{id} Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredRequest body
application/json
descriptionstringfiltersobjectDynamic cohorts only; queues a recalculation. Static snapshots keep their definition read-only.
namestringrealtimebooleanSee
CreateCohort.realtime; checked against the new filters when both are sent.{
"description": "string",
"filters": {},
"name": "string",
"realtime": true
}Code samples
cURL
curl -X PATCH "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}" \
-H "Content-Type: application/json" \
-d '{"description":"string","filters":{},"name":"string","realtime":true}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
400
403
404
409 New filters while an enabled flag targets the cohort
POST
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/duplicate Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/duplicate"TypeScript
Python
Go
PHP
Ruby
Java
Responses
403
404
503
GET
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/members Scope cohort:readParameters
project_idstringpathrequiredidstringpathrequiredlimitintegerquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/members"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Alias of
/persons (the name the AI service and MCP use)404
503
Updated