/api/[...name]/route.ts
using the new Nextra <TSDoc />
component.
GET /api/status
request: NextRequest
- The incoming HTTP requestparams: { name: string[] }
- Route parameters containing the API endpoint namePromise<NextResponse>
{ status: 'ok', service: 'cognee-api' }
GET /api/health
request: NextRequest
- The incoming HTTP requestparams: { name: string[] }
- Route parameters containing the API endpoint namePromise<NextResponse>
{ status: 'healthy', timestamp: string, version: string }
POST /api/add
request: NextRequest
- The incoming HTTP request with JSON bodyparams: { name: string[] }
- Route parameters containing the API endpoint namePromise<NextResponse>
{ message: 'Content added successfully', data: object }
POST /api/cognify
request: NextRequest
- The incoming HTTP request with JSON bodyparams: { name: string[] }
- Route parameters containing the API endpoint namePromise<NextResponse>
{ message: 'Cognify operation completed', status: 'processed' }
POST /api/search
request: NextRequest
- The incoming HTTP request with JSON bodyparams: { name: string[] }
- Route parameters containing the API endpoint namePromise<NextResponse>
{ message: 'Search completed', query: string, results: array }
DELETE /api/prune
request: NextRequest
- The incoming HTTP requestparams: { name: string[] }
- Route parameters containing the API endpoint namePromise<NextResponse>
{ message: 'Prune operation completed', deleted: true }
/api/status
- Returns the API status/api/health
- Returns health check information/api/add
- Add content to the knowledge graph/api/cognify
- Process and build the knowledge graph/api/search
- Search the knowledge graph/api/prune
- Clean up and reset data<TSDoc />
component provides several advantages: