SlimeFarm Canon API =================== Base: /Slime/api.php Auth: Reads are PUBLIC (no key). Writes / mutations require ?key=KEY or X-API-Key: KEY header. Allowed: .md .html .txt (path traversal blocked) READ METHOD List files (JSON) ?action=list GET Read one file (JSON-wrapped) ?action=read&file=PATH GET Read one file (raw md, preferred) ?action=read&file=PATH&format=md GET Full canon as one md bundle ?action=export&format=md GET WRITE METHOD Overwrite a file (body = content) ?action=write&file=PATH POST Soft-delete (restorable) ?action=delete&file=PATH POST Rename ?action=rename&file=OLD&new=NEW POST Make / remove / rename directory ?action=mkdir|rmdir|rename_dir POST HISTORY / TRASH METHOD Revision manifest ?action=history&file=PATH GET Read one revision ?action=revision&file=PATH&rev=N GET Unified diff vs rev-1 ?action=diff&file=PATH&rev=N GET Revert to a revision ?action=revert&file=PATH&rev=N POST List trashed files ?action=trash_list GET Restore from trash ?action=restore&uuid=UUID POST EDITING PATTERN 1. GET ?action=read&file=X&format=md → fetch current content 2. Modify locally. 3. POST ?action=write&file=X with body = full new content 4. GET ?action=diff&file=X&rev=LATEST → verify change CURL # ingest the whole canon curl -s "https://mojichang.tailfe9dc4.ts.net/Slime/api.php?action=export&format=md&key=KEY" # read one file as raw markdown curl -s "https://mojichang.tailfe9dc4.ts.net/Slime/api.php?action=read&file=Characters/Aria.md&format=md&key=KEY" # write (body = full file content) curl -s -X POST "https://mojichang.tailfe9dc4.ts.net/Slime/api.php?action=write&file=Characters/Aria.md&key=KEY" --data-binary @local.md NOTES • Prefer ?format=md — returns text/markdown directly, no escaping. • All writes are full-file overwrites. There is no patch endpoint. • Reads are uncached (Cache-Control: no-store). • Responses are JSON {ok: true|false, ...} unless format=md/txt.