Agent API
The agent backend ships in the open-source repo, gated behind one environment flag that defaults to false.
The agent-facing CRM backend is not a separate product you buy. It is already in this repository, under Apache-2.0, behind a flag.
apps/api/src/routes/ contains nineteen agent*.ts route files: contacts, transactions, tasks, events, notes, campaigns, market reports, inquiries, listings, properties, portals, segments, search, reports, dashboard, Google integration, MLS verification, AI, and the AI action queue.
The flag
export const AGENT_API_DISABLED_CODE = 'AGENT_API_DISABLED';export function parseAgentApiEnabled(value: string | undefined): boolean { return value === 'true';}Note that the parse is an exact string comparison against 'true'. 1, yes, TRUE, and an unset variable are all false. There is no clever coercion, because a routing surface that opens on a typo is worse than one that stays shut.
Routes mount only inside the guard:
if (agentApiEnabled) { app.use('/api/agent/dashboard', authMiddleware, agentDashboardRoutes); app.use('/api/agent/contacts', authMiddleware, agentContactRoutes); app.use('/api/agent/transactions', authMiddleware, agentTransactionRoutes); // …sixteen more}What happens while it is off
Disabled is the default, and every checked-in example uses AGENT_API_ENABLED=false.
While disabled, /api/agent/* simply does not exist, and agent registration answers explicitly rather than ambiguously:
const agentApiUnavailable: RequestHandler = (_req, res) => res.status(404).json({ error: 'Agent API is disabled', code: AGENT_API_DISABLED_CODE,});if (!agentApiEnabled) { app.post('/api/auth/register-agent', agentApiUnavailable);}A client receiving AGENT_API_DISABLED knows the difference between "this deployment has not enabled the agent surface" and "this route does not exist in this version."
Owner portal operations remain available either way. Lead inbox and collection management live at /api/owner/* and are unaffected by the flag — running a portal and its lead operations never requires opening the agent surface.
Turning it on
AGENT_API_ENABLED=trueThat is the whole upgrade path.
Only an operator integrating a compatible external client should set it. The routes are authenticated, but authentication is not the same as intent: leaving an unused API surface mounted is avoidable attack surface, which is why the default is closed rather than open.
What this means commercially
Agent HQ is Frontstead's licensed CRM frontend. It is a separate application — a Next.js frontend with its own backend-for-frontend — that consumes this same versioned HTTP API. It does not include the Frontstead API or a database; it runs against yours.
So the boundary is a documented HTTP seam, not a fork in the road:
- You are not migrating off the open-source core to adopt Agent HQ.
- You are not locked in by adopting it, because the API it talks to is Apache-2.0 and yours.
- If you would rather build your own agent frontend against
/api/agent/*, that is a supported thing to do — the routes are open source and versioned.
Commercial frontends are distributed separately and are not covered by this repository's license. See Agent HQ for licensing terms, or Pro if you would rather have it deployed and run for you.
Next
Architecture — how the services actually fit together.