agent (ak_... prefix) and mediates all task orchestration, CSR intake, and discovery result submission.
Base URL — typically https://collector.<your-domain> in production. All Collector routes are documented here relative to that host.
Collector responses are plain JSON objects, not the
{ data: ... } envelope used by the main API. Field names remain camelCase.Authentication
Every/api/collector/* route requires an agent API key. Send it either as:
auth.api_key_header config (default X-Agent-API-Key). Failed authentication returns 401 with one of invalid API key, API key has expired, API key has been revoked, or API key not authorized for agent access.
Agents are workspace-scoped — an agent belongs to the workspace of the API key that registered it. Attempts to access agents in a different workspace return 403 agent does not belong to this workspace.
Health
GET /health and GET /ready — public, unauthenticated:
Register (or re-register) an agent
POST /api/collector/agents/register
Idempotent — sending the same id updates the existing agent’s config and status rather than creating a duplicate. On first registration the agent is bound to the API key’s workspace.
Stable agent identifier chosen by the agent (e.g.
agent-dc1-01).linux, windows, darwin.Stable machine identifier used for host deduplication.
Falls back to
r.RemoteAddr when omitted.e.g.
["file", "jks", "pkcs11", "aws-kms"].Nested
{ discovery, kubernetes, cloud } blocks describing what the agent is willing to scan.200 OK with "existing": true.
Poll for tasks
GET /api/collector/agents/:agentId/tasks
Returns up to 10 pending tasks and atomically transitions each to in_progress. Agents should call this on a short interval (typically 5–15 s) between heartbeats.
id, taskType (csr_generation, cert_deploy, key_rotation, discovery, health_check), priority, payload (opaque JSON per task type), certificateId, maxRetries, scheduledFor, expiresAt.
Submit a task result
POST /api/collector/agents/:agentId/results
Result payload — task-type-specific.
Populated when
success=false.{ "message": "result submitted", "taskId": 12345 }.
Heartbeat
POST /api/collector/agents/:agentId/heartbeat
Records live agent telemetry and returns the count of tasks currently waiting so the agent can size its poll.
Typically
active.Submit a CSR
POST /api/collector/agents/:agentId/csr
Called when an agent completes a csr_generation task. The Collector stores the CSR result and records a keyReference (where the private key lives on the agent host), then triggers downstream renewal processing.
PEM-encoded CSR.
Target certificate this CSR is for.
{ keyIdentifier, keyStore, keyPath } — where the private key is stored on the agent (PKCS#11 slot, KMS ARN, file path, etc.).{ "message": "CSR submitted", "taskId", "keyReference" }.
When the Collector receives a CSR, it publishes an internal event to trigger immediate downstream renewal processing without waiting for the next scheduled check.
Submit discovery results
POST /api/collector/agents/:agentId/discovery
Bulk-submit certificate discovery findings from an agent scan. Also used for startup inventories.
startup, rescan, or task.Discovery scan ID for progress tracking.
DiscoveryResults payload containing certificates, totalScanned, totalFound.Submit SSH key discovery
POST /api/collector/agents/:agentId/ssh-discovery
Same shape as the certificate discovery endpoint but for SSH .pub files and authorized_keys entries.
.pub file discoveries with
{ path, type, fingerprint, comment, bits, publicKey }.Entries with
{ filePath, username, hostname, lineNum, fingerprint, keyType, publicKey, options }.SSH host key fingerprint of the scanned box.
Scan duration in seconds.
{ new, updated, unchanged } key counts.
Agent status
GET /api/collector/agents/:agentId/status
Lightweight probe used by the dashboard to render the agent card:
See also
- Authentication — how to mint agent API keys
- Discovery — how backend-side scans reach the agent as tasks
- Certificates — where CSR results end up as issued certs