Core concept

Files are protected artifacts from a session.

Fetch generated files from your server, check product ownership, then preview or download them inside your product UI.

File record

Files response shape
{
  "session_id": "hsess...",
  "count": 1,
  "files": [
    {
      "path": "index.html",
      "bytes": 12117,
      "media_type": "text/html",
      "file_id": "cfile_...",
      "download_url": "https://api.harnessrouter.ai/v1/containers/hsess.../files/cfile.../content"
    }
  ]
}

Rendering

  • Use media_type and trusted artifact metadata to choose a renderer.
  • Fetch download_url server-side with the Bearer key, then relay bytes through your product.
  • Use sandboxed previews for generated HTML and code.
  • For Office files, the same content URL has a server-converted PDF preview at /pdf.