Major

Automate ChartMogul MRR Alerts in HubSpot with AI

Turn ChartMogul expansion and contraction signals into timely HubSpot deal alerts, with a reviewable workflow that keeps MRR context, decisions, and follow-up status in one place.

Ritvij Gautam
Automate ChartMogul MRR Alerts in HubSpot with AI

TL;DR: what you'll build. You will automate ChartMogul MRR alerts in HubSpot: a scheduled workflow polls ChartMogul, an app on Major keeps an event ledger and account matches, an agent classifies each movement and drafts a note, and the account owner gets a deduplicated HubSpot deal update. The process owner is the RevOps manager. You end up with expansion and contraction signals landing on the right owner's deal the next morning instead of in a finance report weeks later.

To automate ChartMogul MRR alerts in HubSpot, poll ChartMogul customer and MRR data on a schedule, match each customer to a HubSpot company or deal, then create or update a deal with the movement context when a threshold is crossed. Keep an event ledger so retries never create duplicates, and send uncertain matches or large contractions to a person for review.

Why MRR movements need an owner in HubSpot

RevOps teams at B2B SaaS companies already trust ChartMogul to say what happened to recurring revenue. The gap is that the signal rarely becomes work for the person who owns the account. A seat upgrade or a downgrade shows up in a dashboard, someone exports it at month end, and the account owner hears about it weeks later.

The owner of this process is the RevOps manager, with account executives and customer success managers as the consumers. HubSpot holds ownership, pipelines and follow-up tasks. ChartMogul holds the subscription truth. Nothing in between turns one into the other.

This article is part of Major's coverage of AI agents for sales. Major fits as the governed app layer: it stores the event ledger and match decisions, runs polling and writes as deterministic steps, and calls an agent only for the judgment calls. The same pattern appears in our posts on usage-drop churn alerts and automated renewal-risk alerts.

What breaks without a process

  • Contraction goes unnoticed, so the account owner learns about a downgrade from the customer.
  • A wrong company match puts a note on the wrong account, which is worse than no note.

One position runs through this build: an MRR threshold alone is not enough to alert on. Match quality, movement type and idempotency (the guarantee that the same event never produces two writes) decide whether an alert is usable.

The ChartMogul and HubSpot data this workflow uses

Two systems carry this process.

ChartMogul: customers, subscriptions and MRR movements

ChartMogul's API introduction links to its authentication and rate-limit guides. The reference examples use HTTP Basic authentication with the API key as the username and a blank password. Saved vendor notes cite a limit of 40 requests per second and a possible 503 above 20 parallel connections; confirm both on ChartMogul's rate limit page before you size your polling.

  • Customers. List customers is GET /v1/customers. It filters by external ID, data source UUID, status and system, and paginates with a cursor and a has_more flag. The page size defaults to 200, which is also the maximum.
  • Subscriptions. List customer subscriptions is GET /v1/customers/{CUSTOMER_UUID}/subscriptions. This is where you read a customer's current subscription MRR, so check the reference for the exact field and its units.
  • MRR movements. The MRR movements reference is GET /v2/metrics/mrr_movements. It needs a start date, an end date and an interval of day, week, month, quarter or year. The response has one entry per interval with categories such as new business, expansion, contraction, churn and reactivation, each carrying MRR, activity count and customer count. Money values are in cents.

The honest gotcha: that metrics endpoint returns totals per interval, not one row per customer. It tells you how much expansion and contraction happened on a day, and how many customers were involved. It does not tell you which customers. A per-customer movement feed is not documented on the pages I verified, so this build derives customer-level change itself by snapshotting subscription MRR (more on that below) and uses the metrics endpoint as a control total.

Outbound webhook support for MRR changes was not confirmed in the research behind this article, so scheduled API polling is the trigger here.

HubSpot: deals, companies and search

HubSpot's Deals API guide documents the operations this build uses:

  • POST /crm/v3/objects/deals creates a deal. The guide recommends including the deal name, the stage and, with multiple pipelines, the pipeline, and says you must use the internal ID of a stage or pipeline.
  • PATCH on the deal by ID updates a deal.
  • A PUT request on the deal associations path associates an existing deal with a company or an activity.
  • Batch read accepts a custom unique identifier property through an idProperty field, which is how this build finds a deal by its alert key.

The guide describes the owner field as hubspotownerid. Auth is OAuth 2.0 for multi-account apps or a private app bearer token for a single account, per the HubSpot API overview. The deals guide lists scope requirements in a collapsed section, so read the deals read and write scopes there and grant nothing broader.

For finding records, the CRM search guide documents a date-versioned deals search with filter groups (AND inside a group, OR across groups), a default page of 10 and a maximum of 200, and a limit of 5 search requests per second per account. Note the version mismatch: the legacy deals guide shows v3 paths while the search guide shows a dated path, so pin one version in your connector and re-check it when HubSpot publishes a new one.

The usage guidelines list private-app limits of 100 requests per 10 seconds on Free or Starter and 190 on Professional and Enterprise, with daily caps shared across the account. A 429 response means a limit was hit. The docs do not specify a Retry-After header, so back off yourself.

Source object, identifier, destination, owner

  • ChartMogul customer UUID → stored as the match key in the app → HubSpot company → account executive or CSM
  • Customer external ID or email domain → fallback match key → HubSpot company → RevOps reviews when ambiguous
  • Subscription MRR snapshot delta → ledger event with an alert key → HubSpot deal note or property update → deal owner
  • Daily mrr_movements total → control total in the app → no HubSpot object → RevOps manager

What the alert should do, and where judgment belongs

Deterministic steps (no model)

  • Pull customers and subscription MRR on a schedule and compute the delta against the last snapshot.
  • Apply the threshold policy to decide whether a delta is worth an alert.
  • Build the alert key and check the ledger for duplicates.
  • Resolve the HubSpot company by matching precedence and place unresolved cases in a review queue.
  • Write to HubSpot after policy checks, record the deal ID and retries.

Judgment steps (agent)

  • Classify the movement context: a plan upgrade, a seat reduction, a billing correction, a currency effect or a reactivation that looks like expansion.
  • Decide whether a contraction reads as risk or as routine cleanup, using the account's recent history.
  • Draft the owner-ready note in plain language.

Example threshold policy

These values are example configuration, not recommended thresholds. Your pricing and customer sizes decide yours.

  • Ignore movements under 50 dollars of MRR.
  • Alert owners on expansion of 100 dollars or more, or 10 percent of the account's MRR.
  • Alert owners on contraction of 100 dollars or more, or 10 percent.
  • Require RevOps approval before writing any contraction of 1,000 dollars or more, or any movement with an uncertain match.
  • Never change a deal stage automatically. A contraction adds context; a person decides what it means.

Matching precedence

Match in a fixed order and stop at the first confident hit: a stored ChartMogul-to-HubSpot mapping first, then an ID property you set on the HubSpot company, then the customer's external ID, then email domain. A domain match alone, or two candidate companies, goes to the review queue before any write. Nothing is created in HubSpot from an ambiguous match.

Architecture: app, agent, and scheduled workflow

Architecture of the ChartMogul to HubSpot MRR alert build on Major: schedule trigger, ChartMogul connector, MRR alerts app, alert agent, match and policy decision, HubSpot connector and owner follow-up

Figure 1: A scheduled workflow pulls ChartMogul data into the app, the agent drafts context, and HubSpot is written only after the match and policy check.

The workflow: schedule, deterministic steps, approval

A daily schedule starts a run. The workflow pages through customers, reads subscription MRR, writes snapshots, computes deltas, applies the policy, calls the agent for new events, then runs match and policy checks, and finally writes to HubSpot. A human approval node sits in front of high-impact contractions and uncertain matches.

The agent: judgment only

The agent receives one event at a time, with the account's recent snapshots and the matched HubSpot company and deal. It returns a movement classification, a risk reading and a draft note. It has read access to the app and no direct HubSpot write access; the workflow does the writing.

The app: the screens and the tables

The app is the control surface for RevOps and the execution layer for the workflow. It holds state so nothing lives in a chat window. Its tables:

  • mrr_snapshots: customer UUID, snapshot date, MRR in cents, currency.
  • mrr_events: alert key, customer UUID, delta in cents, movement type, agent classification, status, final HubSpot deal ID, retry count, timestamps.
  • account_map: customer UUID, HubSpot company ID, match method, confidence, approved by.
  • alert_policy: thresholds, approval limit, owner routing rules.
  • review_queue: events or matches waiting for a person, with the reason.

Build it on Major, step by step

  1. Connect ChartMogul and HubSpot once. IT adds each as a connector in Major's central credential store, using the official connector where the catalog lists one and a custom API connector otherwise (base URL plus Basic auth for ChartMogul, OAuth or a private app token for HubSpot). Scope the HubSpot credential to deals and company reads and the deal write only. You should see both connectors listed as healthy, with no key visible to anyone building on top of them.
  2. Build the app. Describe the tables and screens in plain language and let Major generate them with a managed database. You should see a ledger screen with a status column, a review queue screen and a policy screen.
  3. Add the agent. Give it instructions to classify movements and draft notes, and point it at the app's event endpoints. You should see it return a classification and a draft for a sample event you create by hand.
  4. Set the workflow trigger. Add a daily schedule, then the steps in order: poll, snapshot, delta, policy, agent, match, approval, HubSpot write. You should see a run history with one row per execution and each step's output.
  5. Test in a sandbox. Point the workflow at a HubSpot test account or a few test companies, replay the same day twice, and break a match on purpose. You should see zero duplicate deals on the replay and the broken match sitting in the review queue.
  6. Roll out with permissions. Give RevOps edit access to the policy and queue, give owners read access to their own events, and keep connectors with IT. You should see only the intended people able to approve a write.

An example prompt for the app:

Build an app called MRR Alerts. It needs tables for MRR snapshots, MRR events with a unique alert key, an account map between ChartMogul customer UUIDs and HubSpot company IDs, an alert policy with a minimum delta, a percentage threshold and an approval limit, and a review queue. Add a ledger screen with filters for status and owner, and a review screen where RevOps can approve or reject a match.

An example prompt for the agent:

You classify one MRR movement at a time. Use the account's last six snapshots and the matched HubSpot deal context. Return the movement type, whether it is expansion, routine contraction or contraction risk, and a three-sentence note for the account owner. Never propose a deal stage change. If the match looks doubtful, say so and stop.

This is what a governed software factory produces: business teams ship the process, IT keeps the controls.

The idempotency key and replay behavior

The alert key combines customer UUID, snapshot date and movement type. Before any write, the app checks the ledger. If the key exists with a deal ID, the run updates nothing. If it exists without one, the run retries the write and increments the retry count. After the HubSpot write succeeds, the deal ID is stored against the key.

On the HubSpot side, store the alert key in a custom unique identifier property on the deal and look it up through batch read with idProperty before creating. HubSpot's docs do not describe an idempotency header on deal creation, so the ledger and the unique property are what prevent duplicates, not the API.

Governance and IT control

  • SSO and roles. Sign in through the company identity provider. RevOps edits policy, owners see their accounts, finance can read the ledger.
  • Scoped secrets. Credentials live in the central store and are used through the credential proxy. The agent never sees the API key, and the app code never contains it.
  • Managed database and audit logs. Snapshots and events sit in managed tables. Every poll, delta, agent output, approval and write is logged with an identity.
  • Versioned deploys. A policy or workflow change ships as a new version, which means you can roll back a bad threshold.
  • Approvals. Large contractions and uncertain matches need a named person.

When the customer base includes EU residents, contact details in these records are personal data. GDPR Article 28 covers what a processor must do on documented instructions, including security and authorized subprocessors. It is a reason to document who processes the data and to minimize it: the alert needs MRR deltas, company names and owner IDs, not full customer profiles. This build does not make you compliant by itself; your legal team owns that call.

Failure handling and edge cases

  • Rate limits. On a 429 or 503, pause, back off with jitter and resume from the last saved cursor. HubSpot's docs do not specify a Retry-After header, so the backoff is yours. Keep search calls below 5 per second.
  • Pagination. Customers page by cursor until has_more is false. A run that dies mid-pagination records its last cursor and resumes rather than starting over.
  • Partial syncs. Snapshots are written per customer, so a half-finished run leaves valid data behind. The control total flags the gap.
  • Control total mismatch. If the sum of per-customer deltas differs from the metrics endpoint's net movement for that day, the run raises a review item instead of alerting. Common causes are data still processing in ChartMogul or a subscription the snapshot missed.
  • Duplicate events. The alert key blocks them. A replay produces no new writes.
  • Missing or doubtful matches. The event goes to the review queue, and nothing is written to HubSpot.
Approval path for MRR movements: matched events within the approval limit write to HubSpot automatically, while unmatched accounts and high-impact contractions wait in the RevOps review queue

Figure 2: The approval path: what writes straight through and what a person reviews.

What the agent must never do alone

  • Change a deal stage, amount or close date.
  • Create a company or deal from an ambiguous match.
  • Approve its own review item.

If the model is unavailable, the workflow still polls, snapshots and queues events with a plain templated note, so alerts continue and the judgment step catches up later.

A worked example with numbers

For example, a RevOps team of three supports 400 paying accounts, with a daily run and the example policy above. Over a typical month, suppose about 60 movements pass the threshold: 35 expansions, 20 routine contractions and 5 large contractions. These volumes are illustrative, not a measured result.

On one morning, a customer named Northwind Logistics (a made-up account) drops from 2,400 to 1,800 dollars of MRR. The snapshot delta is 600 dollars in contraction, which is 25 percent of the account. The workflow builds the alert key, finds no existing ledger entry, and matches the customer UUID to a stored HubSpot company with high confidence.

The agent reads the last six snapshots and sees two seats removed after a team reorganization, with no failed payments. It classifies the event as contraction risk and drafts: "Northwind reduced MRR by 600 dollars (25 percent) after removing two seats. Usage and billing look normal. Worth a check-in before renewal." The 600 dollar delta is under the 1,000 dollar approval limit, so the workflow writes the note to the open deal and stores the deal ID. The next day's replay finds the key and does nothing.

A second customer, Fabrikam Labs, expands by 1,500 dollars, but its email domain matches two HubSpot companies. The match is ambiguous, so the event goes to the review queue. RevOps picks the right company in about a minute, approves, and the workflow writes the note.

Before and after, using round numbers: manually checking ChartMogul and copying movements into HubSpot takes roughly 10 minutes per movement, so 60 movements is about 10 hours a month. With the workflow, RevOps reviews only the ambiguous or large ones, say 10 events at 3 minutes each, which is 30 minutes. The saving follows from those assumptions, and your numbers will differ.

What to measure

Pick a handful of process metrics the RevOps manager already cares about, and review them weekly for the first month.

  • Signal-to-owner time. Hours between the ChartMogul movement and the HubSpot note.
  • Review queue rate. The share of events needing a person, and how fast they clear.
  • Match accuracy. Matches RevOps corrected, as a share of auto-matches.
  • Duplicate rate. Deals or notes created twice; the target is zero.
  • Owner follow-up. The share of alerts that led to a task, call or deal change.

Compare signal-to-owner time against your own baseline, and keep ChartMogul's reported MRR separate from the sales forecast in HubSpot, since they answer different questions. The review queue's rejection reasons show where matching or thresholds need tuning.

Frequently asked questions

How do you connect ChartMogul MRR movements to HubSpot deals?

Poll the ChartMogul API on a schedule, compute each customer's MRR change, and match the customer to a HubSpot company using a stable ID. Then create or update a deal with the movement context. Keep a ledger so repeated runs never write twice.

Which ChartMogul API endpoint returns MRR movements?

GET /v2/metrics/mrr_movements returns movement categories such as expansion and contraction per interval. It requires a start date, an end date and an interval, and reports MRR in cents. It returns totals, not per-customer rows, so customer-level detail needs subscription data.

How do you prevent duplicate HubSpot deals from repeated MRR alerts?

Give every event a persistent alert key, store it in the ledger and in a unique property on the deal, and search for it before creating anything. HubSpot's deals documentation does not describe an idempotency header, so your own ledger does this job.

Should an AI agent automatically change a deal stage when MRR contracts?

No. The agent should add context and a draft note, and a person should decide on any stage change. Policy can require approval for large contractions, since one contraction does not say whether the deal is at risk.

How often should ChartMogul MRR alerts run?

Choose a cadence from how quickly owners need the signal, how fresh ChartMogul's data is and your API allowance. Daily is a common starting point to test with, but there is no universal answer.

Before you go live

Copy this checklist into your rollout ticket and tick each item before the first scheduled run touches a real HubSpot account. Each item maps to a control described above, so nothing here is new work for the reader to invent.

  • [ ] ChartMogul and HubSpot connectors added by IT, with HubSpot scoped to deals and companies only
  • [ ] Threshold policy and approval limit agreed with the sales leader
  • [ ] Account map seeded and spot-checked for your top accounts
  • [ ] Replay test run in a sandbox with zero duplicate deals
  • [ ] Review queue owner named, with a response time agreed
  • [ ] Alerts on failed runs and on control total mismatches
  • [ ] Agent confirmed unable to change stages, amounts or close dates
  • [ ] Privacy review done if EU customer data is in scope

This guide is part of our AI agents for b2b saas series.

More use cases by tool: More HubSpot use cases.

More b2b saas AI automation use cases

Start building on Major

Connect ChartMogul and HubSpot once, build the app, and let the workflow run the same steps every morning while the agent handles only the judgment calls. Related reading: HubSpot deal-risk alerts and another automated SaaS workflow.

Related articles

About the author

Ritvij Gautam is Head of Growth at Major.

Last reviewed November 27, 2026 by Ritvij Gautam.

Frequently asked questions

How do you connect ChartMogul MRR movements to HubSpot deals?
Poll the ChartMogul API on a schedule, compute each customer's MRR change, and match the customer to a HubSpot company using a stable ID. Then create or update a deal with the movement context. Keep a ledger so repeated runs never write twice.
Which ChartMogul API endpoint returns MRR movements?
GET /v2/metrics/mrr_movements returns movement categories such as expansion and contraction per interval. It requires a start date, an end date and an interval, and reports MRR in cents. It returns totals, not per-customer rows, so customer-level detail needs subscription data.
How do you prevent duplicate HubSpot deals from repeated MRR alerts?
Give every event a persistent alert key, store it in the ledger and in a unique property on the deal, and search for it before creating anything. HubSpot's deals documentation does not describe an idempotency header, so your own ledger does this job.
Should an AI agent automatically change a deal stage when MRR contracts?
No. The agent should add context and a draft note, and a person should decide on any stage change. Policy can require approval for large contractions, since one contraction does not say whether the deal is at risk.
How often should ChartMogul MRR alerts run?
Choose a cadence from how quickly owners need the signal, how fresh ChartMogul's data is and your API allowance. Daily is a common starting point to test with, but there is no universal answer.