{"openapi":"3.0.0","info":{"title":"Knolo CMS API","version":"1.0","description":"REST API to access minds (knowledge bases) and their entries. Use a space-scoped API key (Bearer token) created in Space Settings > API Access."},"servers":[{"url":"https://api.knolo.io","description":"CMS API base path"}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Space-scoped API key (Bearer token). Create in Space Settings > API Access."}},"schemas":{"Mind":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"indexable":{"type":"boolean"},"docCount":{"type":"number"},"dataType":{"type":"string","enum":["default","table"]},"schema":{"type":"object","nullable":true},"statusBreakdown":{"type":"object"}}},"MindsListResponse":{"type":"object","properties":{"minds":{"type":"array","items":{"$ref":"#/components/schemas/Mind"}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}}},"Entry":{"type":"object","properties":{"id":{"type":"string"},"ref":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"metadata":{"type":"object"}}},"EntriesListResponse":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/Entry"}},"total":{"type":"number"},"hasMore":{"type":"boolean"},"limit":{"type":"number"},"offset":{"type":"number"}}},"DownloadUrlResponse":{"type":"object","properties":{"ref":{"type":"string"},"filename":{"type":"string"},"mimeType":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}},"DownloadContentResponse":{"type":"object","properties":{"ref":{"type":"string"},"filename":{"type":"string"},"content":{"type":"string"},"contentLength":{"type":"number"}}},"CreateMindRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"dataType":{"type":"string","enum":["default","table"],"default":"default","description":"\"default\" for document/file minds, \"table\" for structured-row minds."},"indexable":{"type":"boolean","description":"Document minds only. Table minds are always non-indexable."},"schema":{"type":"object","nullable":true,"description":"JSON-schema-like table definition (table minds only)."},"folderId":{"type":"string","nullable":true}}},"UpdateMindRequest":{"type":"object","description":"Provide only the fields to change.","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"indexable":{"type":"boolean"},"schema":{"type":"object","nullable":true,"description":"Table minds only. Pass null to clear."},"folderId":{"type":"string","nullable":true}}},"CreateEntryRequest":{"type":"object","description":"Shape depends on the mind's dataType. Table minds require `data`. Document minds require `filename` plus either `content` or `contentBase64`.","properties":{"data":{"type":"object","description":"Table minds only. A row object validated against the mind schema."},"filename":{"type":"string","description":"Document minds only. The file name (extension selects parsing, e.g. .pdf, .csv, .md)."},"content":{"type":"string","description":"Document minds only. Plain-text/markdown content."},"contentBase64":{"type":"string","description":"Document minds only. Base64-encoded bytes for binary uploads (max 20 MB decoded)."}}},"UpdateEntryRequest":{"type":"object","description":"Table minds: provide `updates`. Document minds: provide `content` (with optional `operation`) and/or `name`.","properties":{"updates":{"type":"object","description":"Table minds only. Partial row object; only included fields are changed."},"content":{"type":"string","description":"Document minds only. New text content."},"operation":{"type":"string","enum":["replace","append","prepend"],"default":"replace","description":"Document minds only. How to apply `content`."},"name":{"type":"string","description":"Document minds only. Rename the file."}}}}},"security":[{"BearerAuth":[]}],"paths":{"/cms/minds":{"get":{"tags":["Minds"],"summary":"List all minds in the space","security":[{"BearerAuth":[]}],"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","default":50},"description":"Max minds to return (max 100)"},{"in":"query","name":"offset","schema":{"type":"integer","default":0},"description":"Number of minds to skip"}],"responses":{"200":{"description":"Paginated list of minds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MindsListResponse"}}}},"401":{"description":"Invalid or missing API key"}}},"post":{"tags":["Minds"],"summary":"Create a mind","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMindRequest"}}}},"responses":{"201":{"description":"Created mind","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mind"}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid or missing API key"}}}},"/cms/minds/{mindId}":{"get":{"tags":["Minds"],"summary":"Get single mind metadata","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Mind metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mind"}}}},"401":{"description":"Invalid or missing API key"},"404":{"description":"Mind not found"}}},"patch":{"tags":["Minds"],"summary":"Update mind metadata","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMindRequest"}}}},"responses":{"200":{"description":"Update result"},"400":{"description":"Invalid request"},"401":{"description":"Invalid or missing API key"},"404":{"description":"Mind not found"}}},"delete":{"tags":["Minds"],"summary":"Delete a mind and all its entries","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deletion result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deletedEntryCount":{"type":"number"}}}}}},"401":{"description":"Invalid or missing API key"},"404":{"description":"Mind not found"}}}},"/cms/minds/{mindId}/entries":{"get":{"tags":["Entries"],"summary":"List or query entries in a mind","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer","default":20},"description":"Max entries (max 100)"},{"in":"query","name":"offset","schema":{"type":"integer","default":0}},{"in":"query","name":"filters","schema":{"type":"string"},"description":"JSON array for table minds. e.g. [{\"field\":\"status\",\"operator\":\"==\",\"value\":\"published\"}]"},{"in":"query","name":"sortBy","schema":{"type":"string"},"description":"Field to sort by (table minds only)"},{"in":"query","name":"sortDirection","schema":{"type":"string","enum":["asc","desc"],"default":"asc"},"description":"Sort direction (table minds only)"}],"responses":{"200":{"description":"Paginated entries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntriesListResponse"}}}},"401":{"description":"Invalid or missing API key"},"404":{"description":"Mind not found"}}},"post":{"tags":["Entries"],"summary":"Create an entry (file/document or table row)","description":"For document minds, provide `filename` plus `content` (text) or `contentBase64` (binary upload). For table minds, provide `data`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEntryRequest"}}}},"responses":{"201":{"description":"Created entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid or missing API key"},"404":{"description":"Mind not found"},"413":{"description":"Upload too large"}}}},"/cms/minds/{mindId}/entries/{entryId}":{"get":{"tags":["Entries"],"summary":"Get single entry metadata","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}},{"in":"path","name":"entryId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Entry metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Entry"}}}},"401":{"description":"Invalid or missing API key"},"404":{"description":"Entry not found"}}},"patch":{"tags":["Entries"],"summary":"Update an entry","description":"For table minds, provide `updates`. For document minds, provide `content` (with optional `operation`) and/or `name`.","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}},{"in":"path","name":"entryId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEntryRequest"}}}},"responses":{"200":{"description":"Update result"},"400":{"description":"Invalid request"},"401":{"description":"Invalid or missing API key"},"404":{"description":"Mind or entry not found"}}},"delete":{"tags":["Entries"],"summary":"Delete an entry (file/document or table row)","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}},{"in":"path","name":"entryId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deletion result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deletedRef":{"type":"string"}}}}}},"401":{"description":"Invalid or missing API key"},"404":{"description":"Mind or entry not found"}}}},"/cms/minds/{mindId}/entries/{entryId}/download":{"get":{"tags":["Entries"],"summary":"Get file content or download URL","security":[{"BearerAuth":[]}],"parameters":[{"in":"path","name":"mindId","required":true,"schema":{"type":"string"}},{"in":"path","name":"entryId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"For text/structured files returns content; for media returns downloadUrl","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/DownloadUrlResponse"},{"$ref":"#/components/schemas/DownloadContentResponse"}]}}}},"401":{"description":"Invalid or missing API key"},"404":{"description":"Entry not found"}}}}},"tags":[]}