Menu

How I made a 14-year-old Rails CRM safe for AI agents
📰

How I made a 14-year-old Rails CRM safe for AI agents

DEV Community: rails·Rizwan Ali·2 days ago
#FEZxaXuf
#devtorails#devto#dev#agents#agent
Long article (634 words) — no AI summary yet.
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.