Document Manager
This endpoint group provides methods for managing documentation instances, such as creating, listing, and deleting them. Documentation instances act as containers for structured content, often scoped to a specific context like a project or a course.
Endpoints
POST /api/rpc (Method: DocumentManagerRpc.create)
Description: Creates a new documentation instance (e.g., a wiki).
Request Body:
{ "method": "DocumentManagerRpc.create", "params": { "name": "string", "description": "string", "contextId": "string", "contextType": "string" } }Parameters:
Name Type Required Description nameStringYes The name of the documentation instance. descriptionStringNo A description for the documentation instance. contextIdStringYes The ID of the context (e.g., courseId, projectId) this instance belongs to. contextTypeStringYes The type of context (e.g., 'course-content', 'project-notes'). Response:
{ "success": true, "data": { "_id": "string", "name": "string", "description": "string", "contextId": "string", "contextType": "string", "ownerId": "string", "vectorCollectionName": "string", "isArchived": "boolean", "createdAt": "Date", "updatedAt": "Date" } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "DocumentManagerRpc.create", "params": { "name": "Project Wiki", "description": "Central documentation for the project.", "contextId": "proj_123", "contextType": "project" } }'
POST /api/rpc (Method: DocumentManagerRpc.listForContext)
Description: Lists documentation instances for a given context.
Request Body:
{ "method": "DocumentManagerRpc.listForContext", "params": { "contextId": "string", "contextType": "string" } }Parameters:
Name Type Required Description contextIdStringYes The ID of the context to list instances for (e.g., course ID, project ID). contextTypeStringYes The type of the context (e.g., 'course-content', 'project-notes'). Response:
{ "success": true, "data": [ { "_id": "string", "name": "string", "description": "string", "contextId": "string", "contextType": "string", "ownerId": "string", "vectorCollectionName": "string", "isArchived": "boolean", "createdAt": "Date", "updatedAt": "Date" } ] }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "DocumentManagerRpc.listForContext", "params": { "contextId": "proj_123", "contextType": "project" } }'
POST /api/rpc (Method: DocumentManagerRpc.delete)
Description: Deletes a documentation instance and all its contents.
Request Body:
{ "method": "DocumentManagerRpc.delete", "params": { "instanceId": "string" } }Parameters:
Name Type Required Description instanceIdStringYes The ID of the documentation instance to delete. Response:
{ "success": true, "data": { "success": "boolean", "deletedDocCount": "number" } }Example (cURL):
curl -X POST https://api.example.com/api/rpc \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "method": "DocumentManagerRpc.delete", "params": { "instanceId": "docinst_abc" } }'