Skip to content

API & MCP

Drive the whole product from code, or hand it to an agent

Analytics tools that treat the API as an afterthought make you re-implement their metric definitions in your own code. That is how two numbers for MRR end up in the same company.

What is API & MCP?

Bastle exposes a REST API covering metrics, customers, subscriptions, charges, refunds, segments, attributes, annotations, goals and cancellation reasons; signed outbound webhooks with automatic retries; an import endpoint for billing systems without a native connector; and an MCP server that gives AI agents the same capabilities as typed tools. The API is the product, not a reporting side-door bolted on afterwards.

REST

The whole surface, not a reporting slice

Read every metric as a daily series, with the customers and plans that drove each movement, and cohort retention as structured cells. Write plans, customers, subscriptions, charges and refunds. Manage segments, custom attributes, annotations, goals and cancellation reasons. Anything the interface can do, code can do.

  • Metric series, per-metric customer and plan breakouts, and cohort grids
  • Full read and write on plans, customers, subscriptions, charges and refunds
  • Segments with an ad-hoc search endpoint, plus attributes, annotations and goals
bastle.co/demo/settings/api
Open

This is the real product running on sample data. Click to use it.

Webhooks

Events pushed to you, signed and retried

Register endpoints and subscribe to the events you care about, with wildcard patterns for whole families. Deliveries are signed so you can verify they came from Bastle, and failures retry on a backing-off schedule over roughly half a day before giving up, with every attempt recorded. Polling for changes on a timer is not a design; it is what you do when the vendor did not ship webhooks.

  • Customer, subscription, charge, refund, trial, dunning and import events
  • Signed envelopes, automatic retries with exponential backoff, delivery log
  • Wildcard subscriptions, so subscription.* is a single registration

Churn definition

Editable
Delinquency window
21 days
Trials counted
Never
Refunds
Deducted in period
Downgrades
Contraction, not churn

Change any rule and every historical figure recalculates against it.

MCP

Tools an agent can actually use

The MCP server exposes subscription analytics as typed, described tools so an agent in your editor, terminal or workflow can query revenue directly. Deliberately narrow tools with clear descriptions are what make agent loops reliable — a single do-everything endpoint produces confident nonsense.

  • Metric summaries, single-metric queries, metric explanations and anomaly detection
  • Customer search and cohort retention as first-class tools
  • Write tools for annotations, goals and data import, scoped by API key

Why did MRR drop last month?

MRR fell $4,180 (−3.1%) in March. Almost all of it is contraction, not cancellations: 31 Scale customers downgraded to Growth after the annual renewal window opened.

47 customers3 plansMRR movement ledger

Import

Bring in a billing system we do not natively support

Native connectors cover the common providers, but not every business bills through one. Push plans, customers and subscriptions to the import endpoint with their original start and cancellation dates, and the history backfills into the same metrics as native sources. Plan changes carry a business timestamp, so a correction lands in the period it belongs to.

  • Backfill full history by supplying start and cancellation dates
  • Upgrades, downgrades and cancellations as events with backdatable business time
  • Imported sources appear alongside native ones in the same dashboards

MRR

+5.2%

$162,400

Net revenue churn

−0.3pp

2.1%

Active customers

+38

1,284

ARPU

+1.4%

$126.48

Machine-readable

Built to be read by something other than a human

An OpenAPI specification describes every endpoint, and an llms.txt file describes the product in the form an AI assistant can consume — properly filled in, rather than present and empty. If your team's first move is to point a coding agent at the docs, that path is meant to work.

  • OpenAPI specification served from the API itself
  • A genuinely populated llms.txt, not a placeholder
  • Bearer-token authentication with read and write scopes

12-month MRR forecast

3 scenarios

Conservative
$214k
Base
$268k
Aggressive
$310k

Capabilities

What API & MCP includes

All of it sits in the same workspace. Bastle is free while in beta, so nothing on this list is an add-on, an upgrade or a separate subscription.

One definition of every metric

The API returns figures from the same engine as the dashboards, so your internal tooling cannot drift into a second version of MRR.

Sandbox-friendly

The public demo dataset is reachable through the same endpoints, so you can build against a realistic shape before connecting real billing data.

Integer cents, everywhere

Money is integer cents in every request and response, with zero-decimal currencies handled correctly. No float rounding surprises.

Command line included

A CLI wraps the same API for scripting and one-off queries without writing an HTTP client first.

Related

Where this connects

API & MCP reads the same normalised billing history as the rest of Bastle, so a change in one place shows up in the others without an export.

Keep going: see everything Bastle does, look up the maths behind any number in the metric glossary, or run a figure through the free calculators.

Practical questions are usually answered by the connector list, an honest comparison with the alternatives, or the same product framed for founders and for finance teams.

Frequently asked questions

Does Bastle send outbound webhooks?

Yes, and this is a genuine differentiator: several established competitors offer no outbound webhooks at all, leaving polling as the only option. Bastle delivers signed event envelopes to endpoints you register, covering customer, subscription, charge, refund, trial, dunning and import events, retrying on a backoff schedule when your endpoint is unavailable and recording every attempt.

What is the MCP server and do I need it?

MCP is the standard protocol for exposing tools to AI agents. Bastle's server presents subscription analytics as typed tools so an agent can answer revenue questions without a browser or a scraper. You do not need it — the REST API and the interface stand alone — but if your team already works with coding agents it means revenue data is one connection away rather than an integration project.

Is the API included or a paid tier?

Included. Bastle is free while in beta and that covers the REST API, webhooks, the MCP server and the CLI. There is no separate developer plan and no endpoint reserved for a higher tier, which is deliberate: an API you have to upgrade to reach gets designed around rather than built on.

Can I push data from a billing system Bastle does not support?

Yes, through the import endpoint. Create the plans, customers and subscriptions with their real start and cancellation dates and the history backfills into your metrics exactly like a native source. Subsequent plan changes and cancellations are sent as events with a business timestamp, which can be backdated so a late correction is recorded in the period it actually happened.

How is the API authenticated?

With a bearer token generated in workspace settings, scoped to read or write. Keys belong to a workspace, so a key can never reach another tenant's data, and they can be revoked individually without disturbing other integrations.

Are there rate limits?

There are limits, published in the API documentation and reported on every response so your client can back off rather than guess. They are set to accommodate real integration work — dashboards, syncs and agent loops — rather than to push you towards a higher plan, since there is no higher plan.

See your own numbers in about two minutes.

Connect Stripe and Bastle backfills your full history. Free while in beta — no card, no sales call.