Skip to main content

Endpoint

GET /api/content-versions
Returns an array of version strings in which a particular document exists for a product. dev-portal uses this endpoint to render the version switcher on documentation pages, showing only the versions where the requested document is actually present.

Query parameters

product
string
required
The product slug to look up versions for.Example: terraform-enterprise, vaultThe legacy alias ptfe-releases is automatically mapped to terraform-enterprise.
fullPath
string
required
The full document path in the format doc#<path/to/document>.The path after # should be the complete path including any product base path prefix.Examples:
  • doc#docs/internals
  • doc#cdktf/api-reference/python/classes

Example requests

curl "http://localhost:8080/api/content-versions?product=terraform-enterprise&fullPath=doc%23docs/install/overview"

Response

Returns a JSON object with a versions array. The array is empty if no versions contain the requested document.
200
{
  "versions": [
    "v1.7.x",
    "v1.8.x",
    "v1.9.x"
  ]
}
200 (no matching versions)
{
  "versions": []
}

Response fields

versions
string[]
required
Array of version strings where the requested document exists. Returns an empty array when no versions match — this mirrors the behavior of the existing content API.Version strings follow one of two formats:
  • Semver-style: v1.9.x
  • Date-based (for Terraform Enterprise): v20220610-01

Error responses

StatusBodyCause
400Missing \product` query parameter…`The product parameter was not provided.
400Missing \fullPath` query parameter…`The fullPath parameter was not provided.
404Not foundThe product slug is not in the product configuration.

Build docs developers (and LLMs) love