((p "Zettelstore maintains some internal data to allow faster operations.") (p "One example is the " (a (@ (href . "00001012051400")) "content search") " for a term: Zettelstore does not need to scan all zettel to find all occurrences for the term." " " "Instead, all word are stored internally, with a list of zettel where they occur.") (p "Another example is the way to determine which zettel are stored in a " (a (@ (href . "00001004011200")) "ZIP file") "." " " "Scanning a ZIP file is a lengthy operation, therefore Zettelstore maintains a directory of zettel for each ZIP file.") (p "All these internal data may become stale." " " "This should not happen, but when it comes e.g. to file handling, every operating systems behaves differently in very subtle ways.") (p "To avoid stopping and re-starting Zettelstore, you can use the API to force Zettelstore to refresh its internal data if you think it is needed." " " "To do this, you must send a HTTP POST request to the " (a (@ (href . "00001012920000")) "endpoint") " " (kbd "/x") " and you must specify the query parameter " (kbd "cmd=refresh") ".") (pre (code (@ (class . "language-sh")) "# curl -X POST 'http://127.0.0.1:23123/x?cmd=refresh'")) (p "If successful, you will get a HTTP status code 204 (No Content) with an empty HTTP body.") (p "The request will be successful if either:") (ul (li (a (@ (href . "00001010040100")) "Authentication is enabled") " and you " (a (@ (href . "00001012050600")) "provide a valid access token") ",") (li "Authentication is not enabled and you started Zettelstore with the " (a (@ (href . "00001004051100")) "run-simple") " command or " (a (@ (href . "00001004020000#expert-mode")) "expert-mode") " is set to " (@L (@H "“") "true" (@H "”")) ".")) (h2 (@ (id . "http-status-codes")) "HTTP Status codes") (dl (dt (kbd "204")) (dd (p "Operation was successful, the body is empty.")) (dt (kbd "400")) (dd (p "Request was not valid." (br) "There are several reasons for this." " " "Most likely, no query parameter " (kbd "cmd") " was given, or it did not contain the value " (@L (@H "“") "refresh" (@H "”")) ".")) (dt (kbd "403")) (dd (p "You are not allowed to perform this operation."))))