title: API: Refresh internal data
role: manual
tags: #api #manual #zettelstore
syntax: zmk
back: 00001012000000 00001012080100 00001018000000
backward: 00001012000000 00001012051400 00001012080100 00001018000000
box-number: 1
copyright: (c) 2020-present by Detlef Stern <ds@zettelstore.de>
created: 20211230230441
forward: 00001004011200 00001004020000 00001004051100 00001010040100 00001010070300 00001012050600 00001012051400 00001012920000
lang: en
license: EUPL-1.2-or-later
modified: 20260702143501
published: 20260702143501
visibility: public

Zettelstore maintains internal data to make operations faster.
This allows it, for example, to quickly [find occurrences of a word](00001012051400) without checking every zettel individually.
It also avoids repeatedly scanning [ZIP files](00001004011200) 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](00001004020000) 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](00001012920000) 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:

* Authentication is not enabled, and Zettelstore was started with the [`run-simple`](00001004051100) command or [`refresh-mode`](00001004010000#refresh-mode) is set to &ldquo;true&rdquo;
* [Authentication is enabled](00001010040100), and you [provide a valid access token](00001012050600), while your [user role](00001010070300) is not &ldquo;creator&rdquo;
* Authentication is enabled, you are either an anonymous user or your user role is &ldquo;creator&rdquo;, and Zettelstore was started with the `run-simple` command or `refresh-mode` is set to &ldquo;true&rdquo;.

# HTTP Status codes

