Agent Protocol
This document describes the protocol between the Yacht server and yacht-agent.
Base URL
The agent uses the Yacht server's /api prefix. Set YACHT_SERVER_URL to the base server URL; the agent appends /api if missing.
Endpoints
Register
POST /agents/register
Header: X-Yacht-Agent-Enrollment-Token: <token>
Body: registration payload
Response includes host_id, agent_id, agent_token, and heartbeat_interval.
Heartbeat
POST /agents/heartbeat
Header: X-Yacht-Agent-Token: <agent_token>
Body: heartbeat payload
Inventory Sync
POST /agents/sync
Header: X-Yacht-Agent-Token: <agent_token>
Body: inventory payload
Job Polling
GET /agents/jobs/next
Header: X-Yacht-Agent-Token: <agent_token>
Job Result
POST /agents/jobs/{job_id}/result
Header: X-Yacht-Agent-Token: <agent_token>
Body: result payload
Job Types
container_action: start, stop, restart, kill, removecompose_action: up, down, pull