(((meta ((content . "API: Refresh internal data") (name . "title"))) (meta ((content . "manual") (name . "role"))) (meta ((content . "#api #manual #zettelstore") (name . "tags"))) (meta ((content . "zmk") (name . "syntax"))) (meta ((content . "00001012000000 00001012080100 00001018000000") (name . "back"))) (meta ((content . "00001012000000 00001012051400 00001012080100 00001018000000") (name . "backward"))) (meta ((content . "1") (name . "box-number"))) (meta ((content . "(c) 2020-present by Detlef Stern ") (name . "copyright"))) (meta ((content . "20211230230441") (name . "created"))) (meta ((content . "00001004011200 00001004020000 00001004051100 00001010040100 00001010070300 00001012050600 00001012051400 00001012920000") (name . "forward"))) (meta ((content . "en") (name . "lang"))) (meta ((content . "EUPL-1.2-or-later") (name . "license"))) (meta ((content . "20260702143501") (name . "modified"))) (meta ((content . "20260702143501") (name . "published"))) (meta ((content . "public") (name . "visibility")))) (p "Zettelstore maintains internal data to make operations faster." " " "This allows it, for example, to quickly " (a ((href . "00001012051400")) "find occurrences of a word") " without checking every zettel individually." " " "It also avoids repeatedly scanning " (a ((href . "00001004011200")) "ZIP files") " containing zettel by remembering their metadata.") (p "In rare cases, this internal data may become outdated." " " "This should not happen, but differences in file systems and operating systems can occasionally lead to inconsistencies." " " "It may also happen if certain " (a ((href . "00001004020000")) "system configuration settings") " have been changed.") (p "To resolve such issues without restarting Zettelstore, you can trigger a refresh of the internal data." " " "During a refresh, all zettel are read and processed again, and the internal data is updated accordingly.") (p "To trigger a refresh, send an HTTP POST request to the " (kbd "/x") " " (a ((href . "00001012920000")) "endpoint") " with 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, the request returns HTTP status code 204 (No Content) with an empty body.") (p "The request succeeds if one of the following conditions is met:") (ul (li "Authentication is not enabled, and Zettelstore was started with the " (a ((href . "00001004051100")) (kbd "run-simple")) " command or " (a ((href . "00001004010000#refresh-mode")) (kbd "refresh-mode")) " is set to " (@L (@H "“") "true" (@H "”"))) (li (a ((href . "00001010040100")) "Authentication is enabled") ", and you " (a ((href . "00001012050600")) "provide a valid access token") ", while your " (a ((href . "00001010070300")) "user role") " is not " (@L (@H "“") "creator" (@H "”"))) (li "Authentication is enabled, you are either an anonymous user or your user role is " (@L (@H "“") "creator" (@H "”")) ", and Zettelstore was started with the " (kbd "run-simple") " command or " (kbd "refresh-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." " " "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."))))