API: Refresh internal data

00001012080500 · Ref · Info · (manual) · #api #manual #zettelstore (all) · Context

Zettelstore maintains internal data to make operations faster. This allows it, for example, to quickly find occurrences of a word without checking every zettel individually. It also avoids repeatedly scanning ZIP files containing zettel by remembering their metadata.

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 system configuration settings have been changed.

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.

To trigger a refresh, send an HTTP POST request to the /x endpoint with the query parameter cmd=refresh:

# curl -X POST 'http://127.0.0.1:23123/x?cmd=refresh'

If successful, the request returns HTTP status code 204 (No Content) with an empty body.

The request succeeds if one of the following conditions is met:

HTTP Status codes

204

Operation was successful, the body is empty.

400

Request was not valid. There are several reasons for this. Most likely, no query parameter cmd was given, or it did not contain the value “refresh”.

403

You are not allowed to perform this operation.