List metric customers with the Baremetrics API
Lists, for each day of a date range, the customers that make up a metric, with the MRR contribution of each one in cents and the current and previous plan. For example, the upgrades metric returns the customers who upgraded in the range.
- Identifier
- baremetrics_list_metric_customers
The request
POST https://connect.reportei.com/api/tools/baremetrics_list_metric_customers/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json
{
"customer_toolkit": "<connection UUID>",
"arguments": {
"metric": "active_trials",
"start_date": "<start_date>",
"end_date": "<end_date>"
}
}Your system sends your customer's connection id and the tool arguments. The headers are the same as the rest of the Connect API: your product's token and your customer's token.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| metric | string | Yes | Name of the metric. Only these metrics list customers.Values: active_trials, add_on_mrr, cancellations, canceled_trials, churned_customers, converted_trials, downgrades, new_customers, new_subscriptions, new_trials, plan_quantities, reactivations, upgrades, other_revenue |
| start_date | string | Yes | First day of the range, YYYY-MM-DD. |
| end_date | string | Yes | Last day of the range, YYYY-MM-DD. |
Supported connections
Your customer connects their Baremetrics account once, with one of the modes below. The same connection serves every tool of the toolkit.
API key
Your customer pastes the app's key on a Connect screen, or your system sends the key with POST /api/customer-toolkits, with no screen.
The response
On success, Connect preserves the app's response status and body. HTTP errors returned by the app use the {error, api_error} envelope; authentication or validation can fail before execution. The X-Toolkit-Execution-Id header identifies the recorded execution, available at GET /api/tools/executions/{uuid}.
Ready for AI agents
This tool's input is a JSON Schema, available at GET /api/tools/baremetrics_list_metric_customers. It becomes your agent's tool definition with no conversion.
Other Baremetrics tools
- List sourcesGETLists the sources of the account: each connected payment provider, such as Stripe, and the Baremetrics API itself. The id of a source is the source_id that plans, customers and subscriptions take.
- Get metrics summaryGETReturns all the metrics of the account for each day of a date range, such as mrr, arr, arpu, ltv, active_customers, new_customers and user_churn. Money values come in cents.
- Get metricGETReturns the value of one metric for each day of a date range, each with the value of compare_to days before and the percent change. Money values come in cents, so an mrr of 6024087 is 60,240.87.
- Get metric plan breakoutGETBreaks a metric down by plan for each day of a date range: each value comes with the plan it belongs to. Money values come in cents.
- List plansGETLists the plans of a source with name, oid, billing interval and price amounts in cents. The response has meta.pagination.has_more; pass page to read the next page.
- List customersGETLists the customers of a source with oid, email, LTV and current MRR in cents, current plans and whether they are active or canceled. The response has meta.pagination.has_more; pass page to read the next page.
- List subscriptionsGETLists the subscriptions of a source with customer, plan, quantity, discount and the start and cancellation dates as Unix timestamps. The response has meta.pagination.has_more; pass page to read the next page.
- List usersGETLists the users of the Baremetrics account with id, name, email and whether they are admins. The id is the user_id that Create annotation takes.
See Connect applied to your product.
Try it for 15 days with no card, or walk our team through your use case.
