Create knowledge document
Knowledge
Create knowledge document
Create a new knowledge document.
Default filename
When filename is omitted, the destination filename is still derived from title
via the existing slugifier (lowercase, hyphenated). That behavior is unchanged.
Optional filename (request body)
Pass filename in the JSON body to control the stored name while preserving casing.
- Accepts either a bare name (
MyNote) or with the.mdextension (MyNote.md); the stored file always ends in.md. - Case is preserved verbatim —
MyNotebecomesMyNote.md, notmynote.md. This is the main reason to use this parameter. - Spaces are normalized to hyphens:
My Note→My-Note.md. - Characters outside
[A-Za-z0-9._-]are stripped:hello!→hello.md. - Path components are stripped for safety:
foo/bar→bar.md. - If the sanitized result is empty (for example
!!!or all-whitespace input), the API returns 400 Bad Request. - If a file with the resolved filename already exists, the API returns 409 Conflict.
Example
curl -X POST https://api.coconut.dev/api/v1/knowledge \
-H 'Content-Type: application/json' \
-d '{"title":"Quick Note","content":"...","filename":"QuickNote"}'
Successful responses include the created document under data, with filename reflecting
the resolved value (for example QuickNote.md).
POST
Create knowledge document
Documentation Index
Fetch the complete documentation index at: https://docs.coconut.dev/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Session cookie authentication
Body
application/json