Reference
Patterns API
Pattern detection and behavioral analysis endpoints
Pattern detection and behavioral analysis endpoints
GET /api/patterns
List patterns
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Maximum number of patterns to return |
offset | integer | No | Number of patterns to skip |
Response: 200 List of patterns retrieved successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | Pattern[] | No | |
pagination | object | No |
Example:
curl -X GET "https://api.memnexus.ai/api/patterns" \
-H "Authorization: Bearer cmk_live_xxx.yyy"
PATCH /api/patterns/{id}
Update pattern
Path parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The pattern ID |
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | |
description | string | No | |
confidence | number | No | |
metadata | object | No |
Response: 200 Pattern updated successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | Pattern | No |
Example:
curl -X PATCH "https://api.memnexus.ai/api/patterns/mem_abc123" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/patterns/analyze
Analyze pattern trends
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
timeRange | integer | No | Analysis time range in days |
groupBy | type \ | context \ | confidence |
includeDetails | boolean | No | Include detailed breakdown |
Response: 200 Analysis completed successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | object | No |
Example:
curl -X POST "https://api.memnexus.ai/api/patterns/analyze" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/patterns/compile
Compile patterns
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
minOccurrences | integer | No | |
timeWindow | string | No |
Response: 200 Patterns compiled successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | Pattern[] | No | |
count | integer | No |
Example:
curl -X POST "https://api.memnexus.ai/api/patterns/compile" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/patterns/detect
Detect behavioral patterns
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
contextFilter | string | No | Filter patterns by context |
timeframeStart | string | No | Start of detection timeframe |
timeframeEnd | string | No | End of detection timeframe |
minConfidence | number | No | Minimum confidence threshold |
maxResults | integer | No | Maximum patterns to return |
autoStore | boolean | No | Automatically store detected patterns |
Response: 200 Patterns detected successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | object | No |
Example:
curl -X POST "https://api.memnexus.ai/api/patterns/detect" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/patterns/feedback
Record pattern feedback
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
patternId | string | Yes | |
feedback | string | Yes |
Response: 200 Feedback recorded successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | Pattern | No |
Example:
curl -X POST "https://api.memnexus.ai/api/patterns/feedback" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'