Topics API
Topic detection, clustering, and management endpoints
Topic detection, clustering, and management endpoints
GET /api/topics
List topics
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Maximum number of topics to return |
offset | integer | No | Number of topics to skip |
Response: 200 List of topics retrieved successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | Topic[] | No | |
pagination | object | No |
Example:
curl -X GET "https://api.memnexus.ai/api/topics" \
-H "Authorization: Bearer cmk_live_xxx.yyy"
GET /api/topics/{id}
Get topic by ID
Path parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The topic ID |
Response: 200 Topic retrieved successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | Topic | No |
Example:
curl -X GET "https://api.memnexus.ai/api/topics/mem_abc123" \
-H "Authorization: Bearer cmk_live_xxx.yyy"
POST /api/topics/cluster
Cluster topics
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
minClusterSize | integer | No |
Response: 200 Topics clustered successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | object | No |
Example:
curl -X POST "https://api.memnexus.ai/api/topics/cluster" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/topics/detect-communities
Detect communities
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
algorithm | string | No |
Response: 200 Communities detected successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | object | No |
Example:
curl -X POST "https://api.memnexus.ai/api/topics/detect-communities" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/topics/discover-related
Discover related topics
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
topicId | string | Yes | |
limit | integer | No |
Response: 200 Related topics discovered successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | Topic[] | No |
Example:
curl -X POST "https://api.memnexus.ai/api/topics/discover-related" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/topics/merge
Merge topics
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
sourceTopicId | string | Yes | |
targetTopicId | string | Yes |
Response: 200 Topics merged successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | Topic | No |
Example:
curl -X POST "https://api.memnexus.ai/api/topics/merge" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/topics/search
Search topics
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | |
limit | integer | No | |
offset | integer | No |
Response: 200 OK
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | No | |
total | integer | No | |
limit | integer | No | |
offset | integer | No |
Example:
curl -X POST "https://api.memnexus.ai/api/topics/search" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/topics/similar
Find similar topics
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
topicId | string | Yes | |
threshold | number | No | |
limit | integer | No |
Response: 200 Similar topics found successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | No |
Example:
curl -X POST "https://api.memnexus.ai/api/topics/similar" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/topics/similarity
Calculate topic similarity
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
topicId1 | string | Yes | |
topicId2 | string | Yes |
Response: 200 Similarity calculated successfully
| Field | Type | Required | Description |
|---|---|---|---|
data | object | No |
Example:
curl -X POST "https://api.memnexus.ai/api/topics/similarity" \
-H "Authorization: Bearer cmk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{}'