A home-improvement contractor runs its whole business on a custom CRM first written in 2012: leads, projects, change orders, invoices, crews and payroll commissions. It works, it's full of years of business rules, and nobody wants to rewrite it.
Then came the question every older system is now getting: can our AI agents use this data? For example, "where is this job at?", or matching a customer in one tool to the same customer in the CRM.
The CRM had no API. Here's how I opened it up without putting the legacy core at risk.
1. Read-only and versioned, on purpose
The first decision was the most important: the API is read-only , and it lives under /api/v1 .
Read-only means an agent that misunderstands something can't damage production data. Writes can come later, one deliberate endpoint at a time.
Versioning means the API can change later without breaking the agents and integrations already using it.
I wrote the controllers from scratch rather than exposing existing internal endpoints.…