Skip to main content
Templates guide how Shelv organizes documents with common structural patterns.

Available templates

TemplateTypical use
bookBooks, manuals, long-form publications
legal-contractContracts and legal agreements
charter-partyMaritime charter party contracts
academic-paperResearch papers and journal-style documents

Use a template

curl -X POST https://api.shelv.dev/v1/shelves \
  -H "Authorization: Bearer sk_your_api_key" \
  -F "file=@document.pdf" \
  -F "template=legal-contract"

If you do not specify one

Shelv still structures the document automatically.

Choosing a template

  • Use book when chapter and part boundaries are important in downstream processing
  • Use legal-contract when clause-level navigation and section references matter
  • Use charter-party for maritime charter parties (voyage, time, bareboat) — separates Part I commercial terms, printed clauses, and rider clauses into distinct directories
  • Use academic-paper when you need predictable research-section grouping
You can start without a template, inspect output quality, then add one once your document patterns are clear.

Output expectations

Templates improve consistency, but exact file names and directory depth can vary by source document shape. Integrations should rely on discovered paths from tree or your own file selection logic, not hardcoded paths. For stable integrations, treat templates as organization guidance, then discover concrete paths at runtime before file reads. This approach prevents brittle assumptions when source documents vary in section naming or depth.