Reference
Facts API
Fact extraction and management endpoints
Fact extraction and management endpoints
GET /api/facts
List facts
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Maximum number of facts to return |
offset | integer | No | Number of facts to skip |
Response: 200 OK
| Field | Type | Required | Description |
|---|---|---|---|
data | Fact[] | No | |
count | integer | No |
Example:
curl -X GET "https://api.memnexus.ai/api/facts" \
-H "Authorization: Bearer cmk_live_xxx.yyy"
POST /api/facts
Create fact
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
subject | string | Yes | Fact subject (entity name) |
predicate | string | Yes | Relationship type |
object | string | Yes | Fact object (related entity) |
Response: 201 Created
| Field | Type | Required | Description |
|---|---|---|---|
data | Fact | No |
Example:
curl -X POST "https://api.memnexus.ai/api/facts" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
GET /api/facts/{id}
Get fact by ID
Path parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The fact ID |
Response: 200 OK
| Field | Type | Required | Description |
|---|---|---|---|
data | Fact | No |
Example:
curl -X GET "https://api.memnexus.ai/api/facts/mem_abc123" \
-H "Authorization: Bearer cmk_live_xxx.yyy"
PUT /api/facts/{id}
Update fact
Path parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The fact ID |
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
subject | string | No | Fact subject (entity name) |
predicate | string | No | Relationship type |
object | string | No | Fact object (related entity) |
confidence | number | No | Confidence score (0-1) |
Response: 200 OK
| Field | Type | Required | Description |
|---|---|---|---|
data | Fact | No |
Example:
curl -X PUT "https://api.memnexus.ai/api/facts/mem_abc123" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
DELETE /api/facts/{id}
Delete fact
Path parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The fact ID |
Response: 204 No Content
Example:
curl -X DELETE "https://api.memnexus.ai/api/facts/mem_abc123" \
-H "Authorization: Bearer cmk_live_xxx.yyy"
POST /api/facts/search
Search facts
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query string |
limit | integer | No | Maximum number of results to return |
Response: 200 OK
| Field | Type | Required | Description |
|---|---|---|---|
data | Fact[] | No | |
count | integer | No | Total number of results |
metadata | object | No | Search metadata |
Example:
curl -X POST "https://api.memnexus.ai/api/facts/search" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'