Data Store API
Overview
Static file server and document set manager for AST-rendered DITA content. Serves both topic data (JSON) and manages document collections via zip uploads.
Authentication: Optional bearer token (set AUTH_TOKEN env var).
Write operations (POST, PUT, DELETE on /api/docs/*) require auth when enabled.
Search Index: Built automatically on startup and after each doc set upload.
Version information
Version: 1.0.0
URI scheme
Host: {scheme}://{host}:{port}
Data Store - System
Server health and diagnostics
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Server is running | object |
Produces
application/json
Data Store - Document Sets
Manage collections of AST-rendered DITA topics
Returns all discovered document sets (directories with toc.json).
Ordered by featured/priority/title.
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | List of document sets | Array of DocSetInfo |
Produces
application/json
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Path | docSetId |
Document set identifier (forward-slash separated path). Root set is "default", nested sets use "parent/child" format. Cannot contain ".." or start with "/" (path traversal blocked). | string |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Document set info | DocSetInfo |
| 404 | Document set not found | ProblemDetail |
Produces
application/jsonapplication/problem+json
Response 404
{"type":"https://dita-bootstrap.org/errors/doc-set-not-found","title":"Not Found","status":404,"detail":"Doc set 'missing' not found"}
Replaces all content in an existing document set with a new zip archive. Fails with 404 if the doc set doesn't exist. Automatically rebuilds search index after extraction.
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Path | docSetId |
Document set identifier (forward-slash separated path). Root set is "default", nested sets use "parent/child" format. Cannot contain ".." or start with "/" (path traversal blocked). | string |
| Body | body |
Zip archive of AST-rendered content with toc.json at root |
string (binary) |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Document set updated successfully | DocSetInfo |
| 400 | Invalid ID or malformed zip | ProblemDetail |
| 401 | Missing or invalid Authorization header | ProblemDetail |
| 404 | Document set not found | ProblemDetail |
| 413 | Upload exceeds MAX_UPLOAD_SIZE | ProblemDetail |
| 415 | Missing or invalid Content-Type | ProblemDetail |
Produces
application/jsonapplication/problem+json
Response 400
{"type":"https://dita-bootstrap.org/errors/invalid-doc-set-id","title":"Bad Request","status":400,"detail":"Invalid doc set id '../escape'"}
Response 401
{"type":"https://dita-bootstrap.org/errors/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid Authorization: Bearer <token> header"}
Response 404
{"type":"https://dita-bootstrap.org/errors/doc-set-not-found","title":"Not Found","status":404,"detail":"Doc set 'missing' not found"}
Response 413
{"type":"https://dita-bootstrap.org/errors/payload-too-large","title":"Payload Too Large","status":413,"detail":"Request body exceeds the 100mb limit"}
Response 415
{"type":"https://dita-bootstrap.org/errors/unsupported-media-type","title":"Unsupported Media Type","status":415,"detail":"Content-Type must be application/zip"}
Uploads a zip archive containing AST-rendered DITA content. Fails with 409 if the doc set already exists. Automatically builds search index after extraction.
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Path | docSetId |
Document set identifier (forward-slash separated path). Root set is "default", nested sets use "parent/child" format. Cannot contain ".." or start with "/" (path traversal blocked). | string |
| Body | body |
Zip archive of AST-rendered content with toc.json at root |
string (binary) |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 201 | Document set created successfully |
DocSetInfo |
| 400 | Invalid ID or malformed zip | ProblemDetail |
| 401 | Missing or invalid Authorization header | ProblemDetail |
| 409 | Document set already exists | ProblemDetail |
| 413 | Upload exceeds MAX_UPLOAD_SIZE | ProblemDetail |
| 415 | Missing or invalid Content-Type | ProblemDetail |
Produces
application/jsonapplication/problem+json
Response 400
{"type":"https://dita-bootstrap.org/errors/invalid-doc-set-id","title":"Bad Request","status":400,"detail":"Invalid doc set id '../escape'"}
Response 401
{"type":"https://dita-bootstrap.org/errors/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid Authorization: Bearer <token> header"}
Response 409
{"type":"https://dita-bootstrap.org/errors/doc-set-exists","title":"Conflict","status":409,"detail":"Doc set 'my-docs' already exists"}
Response 413
{"type":"https://dita-bootstrap.org/errors/payload-too-large","title":"Payload Too Large","status":413,"detail":"Request body exceeds the 100mb limit"}
Response 415
{"type":"https://dita-bootstrap.org/errors/unsupported-media-type","title":"Unsupported Media Type","status":415,"detail":"Content-Type must be application/zip"}
Removes the entire document set directory and all its contents.
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Path | docSetId |
Document set identifier (forward-slash separated path). Root set is "default", nested sets use "parent/child" format. Cannot contain ".." or start with "/" (path traversal blocked). | string |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 204 | Document set deleted successfully | No Content |
| 401 | Missing or invalid Authorization header | ProblemDetail |
| 404 | Document set not found | ProblemDetail |
Produces
application/problem+json
Response 401
{"type":"https://dita-bootstrap.org/errors/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid Authorization: Bearer <token> header"}
Response 404
{"type":"https://dita-bootstrap.org/errors/doc-set-not-found","title":"Not Found","status":404,"detail":"Doc set 'missing' not found"}
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Path | docSetId |
Document set identifier (forward-slash separated path). Root set is "default", nested sets use "parent/child" format. Cannot contain ".." or start with "/" (path traversal blocked). | string |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Document set exists | No Content |
| 404 | Document set not found | No Content |
Data Store - Configuration
Shared UI chrome configuration
Retrieves the shared UI chrome configuration from chrome.json.
Contains strings and state used across all document sets (headers, footers, etc).
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | Chrome configuration | object |
Produces
application/json
Replaces the entire chrome.json configuration.
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Body | body |
New chrome configuration | object |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 202 | Chrome configuration updated | object |
| 400 | Failed to write chrome.json | ProblemDetail |
| 401 | Missing or invalid Authorization header | ProblemDetail |
| 415 | Content-Type must be application/json | ProblemDetail |
Produces
application/jsonapplication/problem+json
Response 400
{"type":"https://dita-bootstrap.org/errors/chrome-write-failed","title":"Bad Request","status":400,"detail":"Failed to write chrome.json: Unexpected end of JSON input"}
Response 401
{"type":"https://dita-bootstrap.org/errors/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid Authorization: Bearer <token> header"}
Response 415
{"type":"https://dita-bootstrap.org/errors/unsupported-media-type","title":"Unsupported Media Type","status":415,"detail":"Content-Type must be application/json"}
Replaces the entire chrome.json configuration. (Alias for PUT)
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Body | body |
New chrome configuration | object |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 202 | Chrome configuration updated | object |
| 400 | Failed to write chrome.json | ProblemDetail |
| 401 | Missing or invalid Authorization header | ProblemDetail |
| 415 | Content-Type must be application/json | ProblemDetail |
Produces
application/jsonapplication/problem+json
Response 400
{"type":"https://dita-bootstrap.org/errors/chrome-write-failed","title":"Bad Request","status":400,"detail":"Failed to write chrome.json: Unexpected end of JSON input"}
Response 401
{"type":"https://dita-bootstrap.org/errors/unauthorized","title":"Unauthorized","status":401,"detail":"Missing or invalid Authorization: Bearer <token> header"}
Response 415
{"type":"https://dita-bootstrap.org/errors/unsupported-media-type","title":"Unsupported Media Type","status":415,"detail":"Content-Type must be application/json"}
Data Store - Content
Serve topic JSON and static files
Serves AST-rendered topic JSON files and static assets from the data directory.
File extensions are resolved automatically (.json added if not present).
Cache-Control header set to "no-cache" to reflect updates.
Parameters
| Type | Name | Description | Schema |
|---|---|---|---|
| Path | topicPath |
Path to topic file (relative to data dir) | string |
| Path | topicPath |
Path to toc.json | string |
Responses
| HTTP Code | Description | Schema |
|---|---|---|
| 200 | File contents | object |
| 404 | File not found | No Content |
Produces
application/json
Definitions
Metadata about a document set
| Name | Description | Schema |
|---|---|---|
id |
Unique identifier (path relative to data dir, "default" for root) |
string |
title |
Display name (from toc.json or defaults to id) |
string |
description |
Long-form description (optional, from toc.json or index.json) |
string |
group |
Parent path for nested doc sets (e.g. "parent" if id="parent/child") |
string |
navToc |
Stringified TOC structure for navigation sidebar (optional) | string |
scrollspyToc |
Stringified TOC for scrollspy highlights (optional) | string |
menubar |
Whether to show a menubar (optional) | boolean |
topicCount |
Number of JSON topic files in this doc set |
integer |
featured |
Whether this doc set is featured (appears first in listings) | boolean |
priority |
Sort priority (higher = earlier, default 100 if featured, else 0) |
integer |
A single AST-rendered DITA topic
| Name | Description | Schema |
|---|---|---|
meta |
Topic metadata | object |
content |
AST tree - see AstNode | Array of AstNode |
Merged table of contents for all topics in a doc set
| Name | Description | Schema |
|---|---|---|
title |
Doc set title | string |
description |
Doc set description | string |
shortdesc |
string | |
featured |
boolean | |
priority |
integer | |
lang |
string | |
toc |
TOC entries (each is an AstNode with href pointing to topic .json) | Array of AstNode |
RFC 9457 Problem Details response
| Name | Description | Schema |
|---|---|---|
type |
URI identifying the problem type |
string (uri) |
title |
Short human-readable error title |
string |
status |
HTTP status code |
integer |
detail |
Detailed explanation |
string |
Security
- bearerAuth (http) : Optional RFC 6750 bearer token (only required if AUTH_TOKEN env var is set).
Header format:
Authorization: Bearer <token>