API Reference

While Kollect is running, it exposes a small REST API that the web interface (and the built-in MCP server) use. It listens on http://localhost:8080 by default and binds to loopback only — the API is unauthenticated, so it is never exposed to other hosts. Change the port with --port or KOLLECT_PORT.

Base URL

http://localhost:8080/api

Core data endpoints

GET /api/data

Return the complete collected inventory across every platform.

POST /api/import

Import a previously exported JSON inventory into the running instance.

POST /api/switch

Switch the active dataset (used by the web interface when swapping between imported datasets).

/api/data response shape

Keys are present only for platforms that were collected:

{
  "aws":        { "EC2Instances": [...], "S3Buckets": [...], "RDSInstances": [...], ... },
  "azure":      { "VirtualMachines": [...], "StorageAccounts": [...], ... },
  "gcp":        { "ComputeInstances": [...], "StorageBuckets": [...], ... },
  "kubernetes": { "Namespaces": [...], "Pods": [...], "PersistentVolumes": [...], ... },
  "openshift":  { ... },
  "docker":     { "containers": [...], "images": [...], "volumes": [...], "networks": [...] },
  "terraform":  { "Resources": [...], "Outputs": [...], "Variables": [...] },
  "vault":      { "SecretsEngines": [...], "AuthMethods": [...], "Policies": [...] },
  "vsphere":    { "VirtualMachines": [...], "Hosts": [...], "Datastores": [...], "Clusters": [...] },
  "proxmox":    { ... },
  "hyperv":     { ... },
  "nutanix":    { ... }
}

Snapshots & costs

GET /api/snapshots

Snapshot inventory across Kubernetes, AWS, Azure and GCP (Snapshot Hunter).

GET /api/snapshots/vsphere

vSphere VM snapshot inventory.

GET /api/costs

Cost analysis for cloud resources and snapshots (Cost Explorer).

Query parameters

Status & export

GET /api/check-credentials

Report which platforms have working credentials — used for the connection badges in the UI.

{ "aws": true, "azure": false, "gcp": true, "kubernetes": true, "docker": true, "terraform": false, "vsphere": false }

POST /api/export/scenario

Generate a Veeam Scenario Builder CSV from the collected data.

Platform connection endpoints

The web interface uses these to connect to a platform and trigger collection. Most are POST; a few return supporting lists.

MethodEndpointPurpose
POST/api/aws/connectConnect to AWS and collect
GET/api/aws/profilesList local AWS profiles
POST/api/azure/connectConnect to Azure and collect
GET/api/azure/subscriptionsList Azure subscriptions
POST/api/gcp/connectConnect to GCP and collect
GET/api/gcp/projectsList GCP projects
POST/api/kubernetes/connectConnect to a Kubernetes cluster and collect
GET/api/kubernetes/contextsList kubeconfig contexts
POST/api/kubernetes/upload-kubeconfigUpload a kubeconfig file
POST/api/openshift/connectConnect to OpenShift and collect
POST/api/docker/connectConnect to the Docker daemon and collect
GET/api/docker/test-connectionTest Docker connectivity
POST/api/terraform/connectAnalyze Terraform state
POST/api/terraform/upload-stateUpload a Terraform state file
POST/api/vault/connectConnect to Vault and collect
GET / POST/api/vsphere, /api/vsphere/collectvSphere status and collection
POST/api/hyperv/connectConnect to Hyper-V and collect
POST/api/proxmox/connectConnect to Proxmox VE and collect
POST/api/nutanix/connectConnect to Nutanix Prism and collect

MCP server

Running ./kollect --mcp starts a Model Context Protocol server (stdio) alongside the API, exposing three tools that read from the endpoints above:

See mcp.md for MCP client configuration.

Usage examples

# All collected data
curl http://localhost:8080/api/data

# Which platforms are connected
curl http://localhost:8080/api/check-credentials

# Snapshots and costs
curl http://localhost:8080/api/snapshots
curl "http://localhost:8080/api/costs?platform=aws"

# Import a previously exported inventory
curl -X POST http://localhost:8080/api/import \
  -H "Content-Type: application/json" \
  -d @my-infrastructure-data.json