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 CodeDescriptionSchema
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 CodeDescriptionSchema
200 List of document sets Array of DocSetInfo

Produces

  • application/json

Parameters

TypeNameDescriptionSchema
Path

docSetId
required

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 CodeDescriptionSchema
200 Document set info DocSetInfo
404 Document set not found ProblemDetail

Produces

  • application/json
  • application/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

TypeNameDescriptionSchema
Path

docSetId
required

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
required

Zip archive of AST-rendered content with toc.json at root string (binary)

Responses

HTTP CodeDescriptionSchema
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/json
  • application/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

TypeNameDescriptionSchema
Path

docSetId
required

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
required

Zip archive of AST-rendered content with toc.json at root string (binary)

Responses

HTTP CodeDescriptionSchema
201

Document set created successfully
Headers: Location (string)

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/json
  • application/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

TypeNameDescriptionSchema
Path

docSetId
required

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 CodeDescriptionSchema
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

TypeNameDescriptionSchema
Path

docSetId
required

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 CodeDescriptionSchema
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 CodeDescriptionSchema
200 Chrome configuration object

Produces

  • application/json

Replaces the entire chrome.json configuration.

Parameters

TypeNameDescriptionSchema
Body

body
required

New chrome configuration object

Responses

HTTP CodeDescriptionSchema
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/json
  • application/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

TypeNameDescriptionSchema
Body

body
required

New chrome configuration object

Responses

HTTP CodeDescriptionSchema
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/json
  • application/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

TypeNameDescriptionSchema
Path

topicPath
required

Path to topic file (relative to data dir) string
Path

topicPath
required

Path to toc.json string

Responses

HTTP CodeDescriptionSchema
200 File contents object
404 File not found No Content

Produces

  • application/json

Definitions

Metadata about a document set

NameDescriptionSchema

id
required

Unique identifier (path relative to data dir, "default" for root)
Example: my-docs

string

title
required

Display name (from toc.json or defaults to id)
Example: My Documentation

string

description
optional

Long-form description (optional, from toc.json or index.json)
Example: Complete guide to the system

string

group
optional

Parent path for nested doc sets (e.g. "parent" if id="parent/child")
Example: api-docs

string

navToc
optional

Stringified TOC structure for navigation sidebar (optional) string

scrollspyToc
optional

Stringified TOC for scrollspy highlights (optional) string

menubar
optional

Whether to show a menubar (optional) boolean

topicCount
required

Number of JSON topic files in this doc set
Example: 42

integer

featured
optional

Whether this doc set is featured (appears first in listings) boolean

priority
optional

Sort priority (higher = earlier, default 100 if featured, else 0)
Example: 50

integer

A single AST-rendered DITA topic

NameDescriptionSchema

meta
optional

Topic metadata object

content
optional

AST tree - see AstNode Array of AstNode

Merged table of contents for all topics in a doc set

NameDescriptionSchema

title
optional

Doc set title string

description
optional

Doc set description string

shortdesc
optional

string

featured
optional

boolean

priority
optional

integer

lang
optional

string

toc
optional

TOC entries (each is an AstNode with href pointing to topic .json) Array of AstNode

RFC 9457 Problem Details response

NameDescriptionSchema

type
required

URI identifying the problem type
Example: https://dita-bootstrap.org/errors/doc-set-not-found

string (uri)

title
required

Short human-readable error title
Example: Not Found

string

status
required

HTTP status code
Example: 404

integer

detail
optional

Detailed explanation
Example: Doc set 'missing' not found

string

Security

  • bearerAuth (http) : Optional RFC 6750 bearer token (only required if AUTH_TOKEN env var is set). Header format: Authorization: Bearer <token>