title: API: Zettelstore readiness
role: manual
tags: #api #manual #zettelstore
syntax: zmk
back: 00001012000000 00001012070500
backward: 00001012000000 00001012070500
box-name: manual
copyright: (c) 2020-present by Detlef Stern <ds@zettelstore.de>
created: 20220304164242
forward: 00001006020000 00001010040100
lang: en
license: EUPL-1.2-or-later
modified: 20261119141919
published: 20261119141919
visibility: public

Zettelstore starts its web service before the initial indexing of all zettel is complete.
Until then, search results and some calculated metadata may be incomplete.
Zettel metadata evaluated in this phase contains the key [`index-state`](00001006020000#index-state) with the value `incomplete`.

To find out whether the box service is completely ready, send an HTTP GET request to the endpoint `/x` with the query parameter `data=ready`.

This request does not require authentication, even if [authentication is enabled](00001010040100).
It does not provide any information about the content of the Zettelstore.

    # curl -i 'http://127.0.0.1:23123/x?data=ready'
    HTTP/1.1 503 Service Unavailable
    Cache-Control: no-store
    Retry-After: 1
    Content-Type: text/plain; charset=utf-8
    incomplete

    # curl -i 'http://127.0.0.1:23123/x?data=ready'
    HTTP/1.1 200 OK
    Cache-Control: no-store
    Content-Type: text/plain; charset=utf-8
    ready

The body contains a plain text value for human readers, followed by a newline:



The HTTP status code is authoritative.
Clients must treat the status codes `200` and `204` as &ldquo;ready&rdquo;.
Currently, only `200` is used, with the body `ready`.
Future versions may respond with `204` and an empty body.
Status `503` means &ldquo;incomplete&rdquo;.
The body is informational only and should not be evaluated by clients.
Intermediate components, such as reverse proxies, may replace the body of a `503` response.

Once `ready` is reported, the state does not change back during the lifetime of the Zettelstore process, even if the index is rebuilt later.
During a rebuild, the previous index continues to serve requests.

Clients should poll this endpoint until it reports `ready`.
The value of the `Retry-After` header is a hint for the polling interval in seconds.

## HTTP Status codes

