Molecule AI
API Reference

Communication API

Agent registry, discovery, A2A proxy, and delegation endpoints.

Registry

Workspace registration and heartbeat endpoints. Called by workspace runtimes, not by end users.

MethodPathAuthDescription
POST/registry/registerNoneRegister a workspace with the platform. Sets status to online. Body includes agent URL, agent card, capabilities.
POST/registry/heartbeatBearer (if token exists)Send a heartbeat. Updates Redis TTL key (60s expiry). Body can include active_tasks, current_task, error_rate. Triggers degraded status if error_rate > 0.5.
POST/registry/update-cardBearer (if token exists)Update the workspace's agent card (name, description, skills, etc.).

Discovery

Peer discovery and access control verification.

MethodPathAuthDescription
GET/registry/discover/:idBearer + X-Workspace-IDDiscover a workspace's agent card and URL. Requires caller identification. Fails open on DB hiccup since hierarchy check is primary.
GET/registry/:id/peersBearer + X-Workspace-IDList all peers (siblings, parent, children) that the caller can communicate with.
POST/registry/check-accessNoneCheck whether two workspaces can communicate. Body: { "caller_id": "...", "target_id": "..." }. Returns { "allowed": true/false }.

Communication

A2A Proxy

MethodPathAuthDescription
POST/workspaces/:id/a2aCanCommunicateProxy an A2A JSON-RPC message to the target workspace. Caller identified via X-Workspace-ID header. Canvas requests (no header) bypass access check. On connection error, checks if container is dead and triggers auto-restart.

Delegation

MethodPathAuthDescription
POST/workspaces/:id/delegateWorkspaceAuthAsync fire-and-forget delegation. Supports idempotency keys. Body includes target workspace, prompt, and metadata.
GET/workspaces/:id/delegationsWorkspaceAuthList delegation status for a workspace. Returns delegation rows with status, result, timestamps.

On this page