1.4 KiB
1.4 KiB
The server API is relatively small. The client primarily communicates with the server for file “CRUD” (Create, Read, Update, Delete) style operations.
Here’s an attempt to document this API:
GET /index.json
(when sent with anAccept: application/json
request header): will return a full listing of all files in your space including metadata like when the file was last modified, as well as permissions. This is primarily for sync purposes with the client. A request sent without the mentionedAccept
header will redirect to/
(to better support authentication layers like Authelia).GET /*.*
: Reads and returns the content of the file at the given path. This means that if youGET /index.md
you will receive the content of yourindex
page. TheGET
response will have a few additional SB-specific headers:X-Last-Modified
as a UNIX timestamp in ms (as coming fromData.now()
)X-Permission
: eitherrw
orro
which will change whether the editor opens in read-only or regular mode.
PUT /*.*
: The same asGET
except that it takes the body of the request and writes it to a file.DELETE /*.*
: Again the same, except this will delete the given file.GET /.client/*
: Retrieve files implementing the clientGET /*
andGET /
: Anything else (any path without a file extension) will serve the SilverBullet UI HTML.