Home / Guides

Connecting an AI agent to a CRM: the integration guide

An AI agent CRM integration is not one connection, it is three: a tool definition the model can select and fill in, an authenticated endpoint that accepts or rejects the call, and an event channel that tells something the state changed. This guide works through all three in build order, and names where each one breaks when the CRM underneath was designed for a human with a mouse.

Fathom is not open yet, so anything on this page about what it does is what it is being built to do.

What an AI agent CRM integration actually consists of

An AI agent CRM integration is three connections, not one. The model needs a tool definition it can choose and fill in. The CRM side needs an authenticated endpoint that accepts a well-formed call and rejects a malformed one in a way the caller can parse. And something has to tell the agent, or the next agent, that state changed after the write landed. Most integration write-ups cover the first connection and assume the other two are trivial. The other two are where integrations fail in week three.

Concretely, the loop looks like this. Your agent runtime holds a list of tool definitions in the dialect of whichever model you run. The model returns a tool call with arguments. Your code posts those arguments to an HTTP endpoint with a credential attached. The endpoint validates the body, writes the record, and returns a result small enough for the model to reason over on the next turn. When the write changes something another process cares about, a lead moving to qualified for example, an event is queued and delivered to a URL you registered, and the next step of the pipeline starts from there.

Everything else is a consequence of that loop: which verbs you expose rather than which tables, what the schema makes required, how you stop duplicate contacts, and what a failure looks like when the caller is a language model rather than a person who can read a stack trace. There are five common shapes for the integration, and each one breaks in a different place.

Five ways teams wire an agent to a CRM, and where each breaks

ApproachHow the agent calls itWhere it breaks
Browser automation over the CRM UIThe agent drives a headless browser through the same forms a rep usesAny DOM change breaks the run, there is no transaction boundary, and write throughput is capped by page loads
MCP server or wrapper over an incumbent CRMTool call reaches a translation server that calls the vendor's REST APITwo hops to debug, and the vendor's request accounting and required-field model still apply underneath
Direct REST calls against an incumbent CRMYour code maps model tool calls onto vendor endpoints and custom field idsThe object model was shaped for human forms: required owner, required pipeline stage, per-seat licensing for a caller that is not a seat
Workflow or iPaaS step between agent and CRMThe agent fires a trigger and a hosted workflow performs the writeAdded latency, and failures land in a run log the agent cannot read or retry from
A data layer built for agent callersTool call hits an endpoint whose schema is generated from the same definition the model was givenYou run one more service, and there is no dashboard for humans to browse, which has to be a deliberate decision

Wiring the integration in the order that survives production

  1. Settle the object graph before you write a single tool

    Agent sales work fits five objects in almost every case: Leads, Contacts, Accounts, Deals, Interactions. Write down, per object, which fields the agent genuinely knows at call time and which ones exist only because a human form needed them. Every field in the second group is a field the model will hallucinate a value for. This is the step that decides whether the integration is a mapping layer or a translation layer.

  2. Issue one credential per agent, not one per team

    A single shared key means you cannot revoke a misbehaving agent without taking the fleet down, and you cannot attribute a write to the process that made it. Issue a key per agent, per environment, and treat unauthenticated or malformed credentials as a hard 401 on every route rather than a soft fallback to a default identity.

  3. Name the actions as verbs, not as tables

    Models select tools by name and description. A tool called update_deal invites the model to invent field values; a tool called advance_deal_stage constrains it to the transition you meant. A working sales loop is covered by around six verbs: qualify a lead, advance a deal stage, log an interaction, create a contact, flag churn risk, assign an owner. Fewer, sharper verbs beat full CRUD surface area exposed to a model.

  4. Generate the tool schemas, do not hand-write them twice

    OpenAI documents its tool interface as function calling and Anthropic documents its own as tool use, and the JSON shapes differ. Maintaining one copy per vendor guarantees drift: a parameter is renamed in one dialect, the other keeps accepting the old name, and the model starts sending arguments your validator rejects. Derive both from one internal action definition so a parameter change is a single edit.

  5. Decide idempotency and identity resolution before the first write

    Duplicate contacts are a common failure mode of agent-written CRM data. Decide the natural key, usually the email address on a contact and the domain on an account, and decide what an agent should do when it matches: read and update, or refuse. An endpoint that silently creates a second record on a repeated call will produce a thousand of them under a retry loop.

  6. Define the failure contract as carefully as the success one

    The caller is a model. A bare 500 with an empty body teaches it nothing and it will retry the same body forever. A 400 or 422 that names the offending field, the expected type and the allowed enum values gives the agent something to act on in the next turn. The same applies to filters: a query parameter that is ignored rather than rejected returns a plausible 200 over the wrong rows, which is worse than an error.

  7. Close the loop with events rather than polling

    Polling a record list on a timer to notice that a deal moved is expensive, slow and duplicated across every agent that cares. Register a subscription per event type, take the delivery on your own URL, and let the write path be the thing that decides when the next agent runs. Keep delivery attempts, status and retry state visible so a missed event is diagnosable rather than mysterious.

  8. Put the human gate on the classifying actions specifically

    Creating a contact and logging an interaction are record-keeping. Qualifying a lead, flagging churn risk and assigning an owner are classifications about a named person, and they are the actions a regulator will ask about. Make the acknowledgement of human review and the lawful basis for the processing required arguments on those three tools, enforced server-side, so the gate cannot be skipped by an agent that forgot.

  9. Meter the loop before it meters you

    Agent traffic is bursty and non-obvious: a single reasoning turn can read fifty records to write one. Count stored records and executed actions per credential from day one, so that when an agent goes into a retry spiral you can see which key did it and cap it, rather than inferring it from a bill.

The read path is where agents quietly go wrong

Write failures are loud. Read failures are not, and they are more dangerous, because the agent acts on what it read and the audit trail looks clean.

Three patterns account for most of it.

Filters that fail open

If ?status=qualified is accepted but not applied, the agent receives disqualified leads with a 200 and a plausible total, and then emails them. Query parameters need the same rejection discipline as write bodies: an unknown or invalid filter should be an error, not a silent full-table read.

Result sets too large to reason over

A tool that can return two thousand records will eventually return two thousand records into a context window, and the model will either truncate or lose the thread. Bound the page size server-side, return a total, and prefer a lookup-by-natural-key tool over a list-and-scan tool wherever the agent's real intent is find this one.

Reads that are not the basis of the write

An agent reads a deal at stage demo, reasons for eleven seconds, and writes advance_deal_stage. Meanwhile a human or a second agent moved it. If the write does not carry the expected current state, the second writer wins silently. Passing the stage the agent believed it was transitioning from turns a lost update into a rejected call, which is the outcome you want.

Two dialects, one definition

The model-facing half of an integration is a JSON schema per tool. OpenAI publishes this interface as function calling, Anthropic publishes the equivalent as tool use, and the envelope differs between them even when the parameters are identical. If your fleet runs more than one model, and most fleets do, you now have two representations of the same action.

The structural problem is not the translation, it is ownership. Two hand-maintained copies of a schema diverge on the first parameter rename. The divergence does not show up as a build error, it shows up as a model confidently sending note to an endpoint that now expects summary, and your validator returning a 422 the agent cannot fix by retrying.

There is a second detail worth knowing before you paste anything into a runtime. OpenAI's strict mode is specific about the relationship between declared properties and the required list: every field in properties must appear in required, additionalProperties must be false, and an optional parameter is expressed by adding null to its type rather than by leaving it out of required. A schema that is perfectly valid JSON Schema will still be refused at tool registration time if it omits a nullable parameter from the required list. Test the generated artefact against the provider that will consume it, not against a JSON Schema linter.

The defensible architecture is one internal action definition file and two serialisers, so that the REST endpoint, the OpenAI function definition and the Anthropic tool definition are three renderings of one source of truth. Fathom is built this way: six pre-built agent action endpoints, qualify_lead, advance_deal_stage, log_interaction, create_contact, flag_churn_risk and assign_owner, exposed both as REST endpoints and as generated OpenAI function-calling and Anthropic tool-use JSON schemas from one definition.

Authentication, and why 401 is part of the integration

An agent fleet is a set of long-running processes holding credentials you did not hand out individually. The credential model is therefore part of the integration design, not an afterthought at deployment.

Two properties matter. First, revocability at the granularity of a single agent: when one process starts writing nonsense you want to cut that one off inside a minute without redeploying the others. Second, consistency of rejection. Every route, including the ones you added last, should answer a missing key, an invalid key and a malformed Authorization header the same way, with 401, and nothing should leak a 200 or a 500 on the unauthenticated path. Fathom issues API keys and runs authentication middleware that rejects unauthenticated requests with 401.

That consistency is what lets an agent distinguish "my credential is wrong" from "my request body is wrong" from "the service is down", which are three different recovery behaviours. Without it, every failure looks the same to the model and the recovery is always the same unhelpful retry. The sibling page on revocable API keys per agent goes into the per-agent key model in detail, and the developer dashboard page covers where keys, their labels and their counters are managed from.

Events back to the agent: subscriptions over polling

The last connection is the one people skip, and then rebuild badly six weeks later as a cron job that scans for changes.

The argument for events is not elegance, it is that the write path already knows. When a lead becomes qualified, exactly one process has the information at the exact moment it becomes true. Turning that into a delivery is cheap. Discovering it by polling means every interested agent runs a query on a timer, most of which return nothing, and the latency of your pipeline becomes the length of your polling interval.

What an agent-facing event system needs beyond the delivery itself:

  • A subscription per event type, so an agent that only cares about deal stage changes is not parsing every contact update.
  • A queue with logged deliveries, because your subscriber will be down at some point and the event still happened.
  • Retry with backoff and visible status, so a delivery that failed four times is a row you can look at rather than a silence you have to reconstruct from timestamps.

Fathom's webhook subscription system works on that shape: register a webhook per event type, with deliveries queued and logged, retry and backoff, and status tracking on each attempt. The sibling page on CRM webhooks for agent state changes covers the event types and the delivery log, and the page on delivery retries covers the backoff schedule and attempt count.

One design note. Deliveries are at-least-once in any system that retries, so the agent receiving them has to be idempotent on its own side. Key your handler on the event id and drop repeats, or you will create two follow-up tasks for one qualified lead.

Article 22: the part of the integration that is not code

If any of your data subjects are in the EU or the UK, the classifying actions in your agent loop sit next to a specific legal constraint, and the integration design is where you meet it or fail to.

Article 22 of the GDPR gives a data subject the right not to be subject to a decision based solely on automated processing, including profiling, which produces legal effects concerning them or similarly significantly affects them, with exceptions for contractual necessity, authorising law and explicit consent, and a requirement for safeguards including human intervention where those exceptions apply. We are describing its shape rather than giving legal advice: whether a given qualification or churn flag falls inside it is a question for your own counsel and your DPO, and it depends on what the decision causes downstream.

What is useful here is the engineering consequence. Three of the six verbs above, qualifying a lead, flagging churn risk and assigning an owner, are classifications attached to a named person. The other three are record-keeping. If a human review step and a recorded lawful basis are going to be required for the classifying three, they belong in the tool schema as required arguments, enforced server-side, rather than in a runbook. A field the model must fill is a field that exists in the audit trail. A policy in a Notion page is not. Fathom enforces human_review_ack and lawful_basis as required fields on qualify_lead, flag_churn_risk and assign_owner, and stores an audit row for every executed agent action carrying both values.

Two things to check against your own obligations before you load real prospect data. Fathom runs on Amazon Web Services, with every record in one Postgres database there; there is no region pinning or EU-only hosting, and the deployment region is not customer-selectable. There is also no signed data processing agreement in place by default, and no SOC 2 or ISO 27001 certification and no independent penetration test behind it; ask through the contact page and we will put a DPA in place before you load personal data at volume. The page on hosting, accounts and keys sets out the rest of what is stored and where.

One adjacent constraint on inputs. Whatever you pipe into a CRM through an agent, the source's terms travel with it: several platforms prohibit automated collection of their data outright. Do not build an ingestion path that depends on breaking one, because the integration you are designing will outlive the enrichment vendor you started with.

Sizing the loop: records and actions, not seats

Per-seat pricing is the pricing model of a system whose users are people. An agent is not a seat, and asking how many seats your fleet needs produces a number that means nothing. The two quantities that describe an agent CRM integration are how many records are stored and how many actions are executed per month.

Those are also the two numbers to instrument before launch, because the second one is much larger than intuition suggests. A single reasoning turn that reads a list, looks up two contacts and writes one interaction is four calls, and a retrying agent multiplies that by its backoff policy. Usage metering per API key, counted separately for stored records and executed agent actions, is what turns "the agent is being weird" into "this key did 40x its normal action volume after 02:00". Those counters read in the dashboard and from GET /api/v1/usage.

Fathom meters per key and prices against the same two numbers. Developer is free: the full API surface on your own keys, 1,000 stored records and 10,000 agent actions per month, all six actions in both tool schema formats, webhooks with queued delivery and retry, and a key per agent, each metered and revocable on its own.

Fathom runs on Amazon Web Services, sign-in is email and password, and card payments go through Stripe.

Where to read the detail

This page is the map. Five companion pages in this pillar go one level deeper on the parts you will touch first.

  • A CRM API for AI agents covers the five-object model, the CRUD surface, and what it means for a schema to have no required UI fields.
  • Revocable API keys per agent covers credential granularity and the 401 contract across every /api/v1 route.
  • CRM webhooks for agent state changes covers subscriptions per event type, the delivery queue, and the event types you can register against.
  • Webhook delivery retries covers backoff, attempt count and the per-delivery status log.
  • The minimal developer dashboard covers what a headless product still needs a screen for: key management, usage against tier limits, and read-only schema inspection.

If you take one thing from the order above, take this: the integration is not finished when the model successfully writes a record. It is finished when a failed write is legible to the agent, a duplicate is impossible, a state change reaches the next process without polling, and a classification about a person carries the fields that prove how it was made.

Questions

How do I connect an AI agent to my CRM?

Three connections. Give the model tool definitions in its own dialect, either OpenAI function calling or Anthropic tool use, generated from one internal action definition. Post the resulting tool-call arguments to an authenticated HTTP endpoint that validates the body and returns a small, parseable result. Then register an event subscription so a state change reaches the next process without polling. Everything else, dedupe rules, error shapes, metering, is a consequence of those three.

Can ChatGPT or Claude update my CRM directly?

Not by itself. A model emits a tool call; your runtime is what performs the HTTP request and holds the credential. That is the right place for the boundary, because it is where you enforce authentication, validate the arguments, and decide whether a repeated call updates an existing record or creates a new one.

Do I need an MCP server to integrate an agent with a CRM?

It is one transport option, not a requirement. The Model Context Protocol standardises how a runtime discovers and calls tools, which is useful when you want one server to serve several clients. It does not change the underlying problem: if the CRM behind it demands fields a human form invented and meters requests per app, wrapping it in a protocol does not make the object model agent-shaped.

Why does my agent keep creating duplicate contacts?

Because the create endpoint is not idempotent and the agent retries. Pick a natural key, typically the email address for a contact and the domain for an account, decide whether a match should update the existing record or return an error, and enforce that server-side. A retrying agent against a plain create endpoint will produce hundreds of duplicates and no error to explain them.

Why is my generated tool schema rejected before any call is made?

Most often strict mode. OpenAI requires every field in properties to appear in the required array and additionalProperties to be false, with optional parameters expressed by adding null to their type. A schema that passes a JSON Schema linter can still be refused at registration. Generate both dialects from one definition and test each against the provider that will consume it.

Webhooks or polling for agent state changes?

Webhooks, with two caveats. Delivery is at-least-once once retries exist, so the receiving agent must deduplicate on the event id. And a queue is only as useful as its visibility: you want logged attempts, retry and backoff status, so a delivery that failed is a row you can inspect rather than a silence.

Does GDPR allow automated lead scoring?

Article 22 gives a person the right not to be subject to a decision based solely on automated processing that produces legal effects or similarly significantly affects them, with exceptions and required safeguards where those exceptions apply, and whether a specific scoring step falls inside it depends on what it causes downstream. This is not legal advice. The engineering answer that holds either way is to make human-review acknowledgement and lawful basis required arguments on the classifying actions, enforced server-side, so the record exists whether or not anyone later argues about it.

Can I use Fathom today, and what will it cost?

Not yet. Fathom is pre-launch and currently taking waitlist signups.

Sources

Tell us which endpoint you need first

Join the waitlist with the objects, actions and event types your agents are blocked on today. We read every response and it shapes what ships in what order.

One email when it launches, and one now to confirm your address. Unsubscribe any time. Privacy.