Skip to main content

Endpoint

GET /api/assets/:productSlug/:version/:assetPath
Serves binary assets (images, diagrams, and other files) from the product’s versioned content directory. dev-portal uses this endpoint to load images embedded in documentation pages. Assets are stored under assets/<productSlug>/<version>/ in the repository’s build output. The content-type response header is set based on the asset’s file extension.

Path parameters

productSlug
string
required
The slug identifying the product whose assets you want to retrieve.Examples: terraform-plugin-framework, vault, consul
version
string
required
The documentation version. Use latest to resolve to the most recent stable version.Examples: latest, v1.9.x, v20220610-01
assetPath
string
required
The path to the asset within the product’s assets directory. Segments are joined with /.Example: img/docs/plan-comments.png

Example requests

curl http://localhost:8080/api/assets/terraform-plugin-framework/latest/img/docs/overview.png

Response

Returns the raw binary content of the asset with an appropriate content-type header.

Response headers

HeaderDescription
content-typeMIME type of the asset, determined from the file extension (e.g., image/png, image/svg+xml)
served-fromIndicates whether the asset was served from current build or production

Error responses

StatusBodyCause
404Not foundThe productSlug is not in the product configuration, the version does not exist, or no asset was found at the specified assetPath.

How assets are stored

Assets are copied from product content directories during the prebuild step into public/assets/<productSlug>/<version>/. The API reads assets from this pre-built output directory rather than from the content/ source directory directly.
public/
  assets/
    terraform-plugin-framework/
      v1.15.x/
        img/
          docs/
            overview.png
    vault/
      v1.20.x/
        img/
          vault-seal-workflow.png

Build docs developers (and LLMs) love