cohorts
POST
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/members Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredRequest body
application/json
Persons to add to a static cohort, as JSON (the MCP and API route; the web uploads a CSV).
keysstring[]requiredDistinct ids or emails, at most 10 000.
{
"keys": [
"string"
]
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/members" \
-H "Content-Type: application/json" \
-d '{"keys":["string"]}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"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
},
"column": "string",
"matched": 0,
"submitted": 0,
"unmatched": 0
}Schema
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.
columnstringrequiredThe column used:
person_id, distinct_id, email, or first (no header: distinct id or email).matchedintegerrequiredOf
submitted, how many name an existing person (members now, or added by this call).submittedintegerrequiredDistinct values read from the file.
unmatchedintegerrequiredsubmitted - matched: values that name no person and so were not added.400
403
404
503
GET
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/members/check Scope cohort:readParameters
project_idstringpathrequiredidstringpathrequireddistinct_idstringqueryrequiredExact distinct id
Code samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/members/check?distinct_id=<distinct_id>"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Needs
cohort:read. member is false for an unknown distinct id; person_id needs pii:readExample
{
"member": true,
"person_id": "string"
}Schema
memberbooleanrequiredThe person behind
distinct_id is a current member of the cohort.person_idstringSet when
member is true and the caller holds pii:read; omitted otherwise.400
404 Cohort absent or in another project
503
POST
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/members/check Scope cohort:readParameters
project_idstringpathrequiredidstringpathrequiredRequest body
application/json
distinct_idsstring[]requiredExact distinct ids, 1..=1000 after trimming and de-duplication.
{
"distinct_ids": [
"string"
]
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/members/check" \
-H "Content-Type: application/json" \
-d '{"distinct_ids":["string"]}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Needs
cohort:read; at most 1000 ids. person_id needs pii:readExample
{
"members": [
{
"distinct_id": "string",
"person_id": "string"
}
]
}Schema
membersMemberHit[]requiredThe submitted ids that belong to a current member; others (and unknown ids) are absent.
Show child parameters
distinct_idstringrequiredperson_idstringSet when the caller holds
pii:read; omitted otherwise.400
404 Cohort absent or in another project
503
GET
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/persons Scope cohort:readParameters
project_idstringpathrequiredidstringpathrequiredlimitintegerquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/persons"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of {id, properties, created_at, distinct_ids}, newest first
404
503
POST
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/persons Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredRequest body
application/json
person_idstringrequired{
"person_id": "string"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/persons" \
-H "Content-Type: application/json" \
-d '{"person_id":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Added (a no-op for current members)
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 Not a static cohort
404 Cohort or person absent
503
DELETE
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/persons/{person_id} Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredperson_idstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/persons/{person_id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Removed (a no-op for non-members)
Same as 200 · POST /v1/projects/{project_id}/cohorts/{id}/persons
400
404
503
POST
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/recalculate Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/recalculate"TypeScript
Python
Go
PHP
Ruby
Java
Responses
202 Queued;
lc-jobs picks it up within secondsSame as 200 · POST /v1/projects/{project_id}/cohorts/{id}/persons
403
404 Absent or not dynamic
GET
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/size-history Scope cohort:readParameters
project_idstringpathrequiredidstringpathrequireddaysintegerqueryLook-back, 1 to 730, default 90
Code samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/size-history"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"cohort_id": "string",
"points": [
{
"members": 0,
"recorded_at": "2024-01-01T00:00:00Z"
}
]
}Schema
cohort_idstringrequiredpointsSizePoint[]requiredOldest first; one point per recalculation (at most 1000, the newest).
Show child parameters
membersintegerrequiredrecorded_atstringrequired400
404
POST
https://lucidace.com /v1/projects/{project_id}/cohorts/{id}/upload Scope cohort:writeParameters
project_idstringpathrequiredidstringpathrequiredRequest body
multipart/form-data
Field file: CSV (at most 20 MB, 1M rows). A header naming person_id, distinct_id (or user_id, id) or email picks that column, in that precedence; without one the first column is matched as a distinct id or email
{}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/cohorts/{id}/upload" \
-H "Content-Type: multipart/form-data" \
-d '{}'TypeScript
Python
Go
PHP
Ruby
Java
Updated