Skip to main content
The HashiCorp Web Unified Docs API serves documentation content for HashiCorp products from a single repository. It is the backend that the dev-portal frontend queries to retrieve MDX content, navigation trees, version lists, and redirect rules. The API is built on Next.js route handlers and runs as a containerized service. When you run the stack locally with make, the API is available at http://localhost:8080.
The unified docs API is intended to eventually replace the existing content API at content.hashicorp.com. During the migration period, dev-portal sources content from both APIs.

Base URL

http://localhost:8080
In production, the API runs at the deployed service URL configured via the UNIFIED_DOCS_API environment variable in dev-portal.

Authentication

No authentication is required. All endpoints are publicly accessible.

Response format

All endpoints return JSON. Successful responses follow one of two shapes:
{ "result": ... }
or for document content:
{
  "meta": { "status_code": 200, "status_text": "OK" },
  "result": { ... }
}
Error responses return plain-text bodies with an appropriate HTTP status code (typically 404 or 400).

How it relates to dev-portal

dev-portal is the HashiCorp documentation frontend (developer.hashicorp.com). It uses this API to:
  • Fetch MDX source for individual documentation pages
  • Build sidebar navigation trees
  • Discover all available documentation paths for static generation
  • Resolve version lists and redirect rules
You can verify the API is fully initialized by visiting http://localhost:8080/api/all-docs-paths. Once that endpoint returns data, dev-portal at http://localhost:3000 is ready to use.

Available endpoints

Get document content

GET /api/content/:productSlug/doc/:version/:docPathFetch the MDX source and metadata for a specific documentation page.

All docs paths

GET /api/all-docs-pathsRetrieve every available documentation path across all products, used for static site generation.

Content versions

GET /api/content-versionsReturn the versions in which a specific document exists for a given product.

Supported products

GET /api/supported-productsList all product slugs that have documentation in this repository.

Nav data

GET /api/content/:productSlug/nav-data/:version/:sectionFetch the navigation tree for a product section, used to render the sidebar.

Redirects

GET /api/content/:productSlug/redirectsReturn the redirect rules for a product.

Version metadata

GET /api/content/:productSlug/version-metadataReturn version metadata for a product including all available versions.

Assets

GET /api/assets/:productSlug/:version/:assetPathServe binary assets such as images from the product content directory.

Example request

curl http://localhost:8080/api/content/terraform-plugin-framework/doc/latest/plugin/framework
This fetches the latest version of the plugin/framework page from the terraform-plugin-framework product.

Build docs developers (and LLMs) love