Skip to content

Get Cooccurrence Insights

GET
/users/{user_id}/insights/cooccurrence
curl --request GET \
--url 'https://example.com/users/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/insights/cooccurrence?window_days=90'

Event co-occurrence insights (Track F): event categories that show up together more than chance — same-day (“headache on poor-sleep days”) or next-day (“drinking day → skipped workout”). The relationship engine only correlates events against numeric outcomes; this catches event↔event structure. Phi on 0/1 presence series, BH-FDR, support floor; no LLM.

user_id
required
User Id
string format: uuid
window_days
Window Days
integer
default: 90 >= 14 <= 365

Successful Response

Media typeapplication/json
CooccurrenceResponse
object
cooccurrence
required
Cooccurrence
Array<object>
CooccurrenceCard

An event-category co-occurrence insight — two categories that show up together more than chance, same-day or next-day (Track F). See services/cooccurrence.py.

object
category_a
required
Category A
string
category_b
required
Category B
string
co_days
required
Co Days
integer
headline
required
Headline
string
id
required
Id
string
kind
required
Kind
string
label_a
required
Label A
string
label_b
required
Label B
string
lag
required
Lag
integer
n
required
N
integer
p_value
required
P Value
number
phi
required
Phi
number
q_value
required
Q Value
number
window_days
required
Window Days
integer
Examplegenerated
{
"cooccurrence": [
{
"category_a": "example",
"category_b": "example",
"co_days": 1,
"headline": "example",
"id": "example",
"kind": "example",
"label_a": "example",
"label_b": "example",
"lag": 1,
"n": 1,
"p_value": 1,
"phi": 1,
"q_value": 1
}
],
"window_days": 1
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}