Principle
Use a simple split:- Public, cacheable reads for explicitly published artifacts
- Private, authenticated reads for account/document state
- Private, authenticated writes for all mutations
read public, write private.
Route classes
Public read surface (/v1/documents/...)
Designed for published/shareable outputs and CDN caching.
Examples:
GET /v1/documents/{id}GET /v1/documents/{id}/pages/{n}/imageGET /v1/documents/{id}/entities/tables/{index}
Private authenticated surface (/document/...)
Designed for operational state, configuration, and mutations.
Examples:
GET /document/{id}/configPUT /document/{id}/configPOST /document/{id}/reparsePOST /document/{id}/extract
/v1 write routing
For consistency, non-GET requests under /v1/documents/{id}/... are rewritten to /document/{id}/... before handling.
This keeps a clean external namespace while preserving private/authenticated mutation handling.
Caching rule
- Public routes: cacheable (
public) - Private routes: non-public cache headers (
private/no-store) for config/state