Documentation Index
Fetch the complete documentation index at: https://docs.dataharbor.co/llms.txt
Use this file to discover all available pages before exploring further.
Output Formatting
JSON in, any format out. Zero client code. Virtual API responses are JSON by default. Output formatting lets you convert responses to Markdown, CSV, or YAML — configured in your Virtual API Configuration, requested via URL extension, or negotiated through the HTTPAccept header. Especially useful for AI agents that present data to humans, or for feeding governed data directly into spreadsheets and configuration tools.
Output formatting runs after input normalization and the ordered controls pipeline. It only changes how the final governed payload is rendered. See Data Pipeline for the full request flow.
Quick start
Adddefault_output_format to any Virtual API Configuration:
Supported output formats
| Format | Best for | Response Content-Type |
|---|---|---|
json | System-to-system integrations and default runtime behavior | application/json |
markdown | AI agents, human-readable responses, quick inspection | text/markdown; charset=utf-8 |
csv | Spreadsheets, BI tools, exports | text/csv; charset=utf-8 |
yaml | Config workflows and human-readable structured output | text/yaml; charset=utf-8 |
Requesting a format
Usedefault_output_format to set a default, or request a format per call with a URL extension or Accept header.
- Spec default
- URL extension
- Accept header
Set
default_output_format in the Virtual API Configuration when one format should be returned by default.default_output_format: json is also valid when you want to make the contract explicit without changing behavior.Precedence
Format selection follows a four-tier precedence (highest to lowest):| Priority | Source | Example |
|---|---|---|
| 1 | URL extension | .md, .csv, .yaml, .json |
| 2 | Accept header | Accept: text/markdown |
| 3 | Spec default | default_output_format: markdown |
| 4 | Runtime default | JSON |
default_output_format | URL extension | Accept header | Result |
|---|---|---|---|
markdown | .json | text/csv | JSON — URL extension wins |
json | (none) | text/markdown | Markdown — Accept header wins over spec |
markdown | (none) | (none) | Markdown — spec default applies |
| (omitted) | (none) | text/csv | CSV — Accept header applies |
| (omitted) | .md | text/csv | Markdown — URL extension wins |
| (omitted) | (none) | (none) | JSON — default runtime behavior |
How each format renders
Markdown
Markdown output is structure-driven.| JSON shape | Markdown representation |
|---|---|
| Array of flat objects | Table |
| Single flat object | Key-value list |
| Nested object | Headings plus nested content |
| Array of scalars | Bullet list |
| Scalar value | Plain text |
CSV
CSV output follows RFC 4180.| JSON shape | CSV representation |
|---|---|
| Array of flat objects | Header row plus one row per object |
| Single flat object | Header row plus a single row |
| Nested objects or arrays | Serialized as JSON strings in the cell |
| Null values | Empty cell |
| Scalar value | Plain text |
YAML
YAML output uses standard YAML 1.2 formatting.| JSON shape | YAML representation |
|---|---|
| Object | key: value pairs |
| Array of objects | - key: value block sequence |
| Array of scalars | - item list |
| Strings with special characters | Quoted with escape sequences |
| Numbers and booleans | Unquoted |
| Null | null |
Response headers
The responseContent-Type reflects the selected output format, and Vary: Accept is always included so caches differentiate negotiated responses correctly.
Advanced HTTP negotiation
AI agents and Accept headers
AI agents and Accept headers
Many AI agents already send
Accept headers that prefer Markdown. For example, Claude Code typically sends Accept: text/markdown, text/html, */*, which means DataHarbor can return Markdown without any spec or URL changes.This behavior also carries through MCP delivery when the agent’s Accept header is forwarded to the lease endpoint.Quality values (q-values)
Quality values (q-values)
The DataHarbor picks the supported format with the highest q-value.
Accept header supports quality values (q) to express preference.406 responses and caching
406 responses and caching
When the
Accept header explicitly excludes all supported formats and contains no wildcard fallback, DataHarbor returns 406 Not Acceptable.When Accept is */* or missing, DataHarbor falls through to the spec default or JSON behavior instead. Responses always include Vary: Accept for cache correctness.Next steps
Connect Sources
Start with how upstream formats enter DataHarbor
Input Normalization
See how upstream JSON, CSV, YAML, and Markdown are parsed
Markdown Input
Learn how Markdown sources normalize before controls run
REST API Delivery
Request formatted responses over fetch and relay endpoints

