Skip to content

API endpoint file

api.json in the cache folder of the working copy (<OS cache>/reqseq/<sha256 of the absolute workspace root>/, ADR-0008): where the running local API of reqseq serve api listens, and its token (ADR-0009). Written at start with mode 0600; a client reads it and sends Authorization: Bearer <token>. The API listens on loopback only (SR-079). A file left behind by a stopped API names a port nobody listens on.

Field Type Required Description
reqseq-api 1 yes
port integer yes
token string yes 256 random bits, base64url without padding; new at every start.
urls array of string yes Base URLs, one per loopback address the API listens on (::1 only where the machine has IPv6).
pid integer yes Process ID of the API. While it runs, a second API for the same working copy asks the URLs before it starts; when it does not run, the file is stale and is replaced.
# The file itself is JSON (api.json); shown here as YAML, which reads the same.
reqseq-api: 1
port: 49731
token: q1v6m0Qy8hJ1v1sQyQ0d2l1G3n2l7Pp3b8e1o4yWk9c
urls:
- http://127.0.0.1:49731
- http://[::1]:49731
pid: 41213