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
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: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
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
plugin/framework page from the terraform-plugin-framework product.