CFL

Learn how to use the ChartMogul Filtering Language (CFL) to filter data programmatically.

The ChartMogul Filtering Language (CFL) is a string-based syntax for filtering data.

CFL allows you to programmatically apply the same filters that you use in the ChartMogul interface. When you apply filters in the app, the resulting CFL string appears in your browser’s address bar.

All Metrics API endpoints accept an optional filters parameter that uses CFL to define filter criteria.

Syntax

CFL has the following format:

[filter]~[operator]~[value]~AND~[filter]~[operator]~[value]~AND~…

Key rules

Special case: plan filters

Plan and plan group filters have a unique behavior: when connected with the AND operator, they function as an OR condition. This behavior reflects how the filters work in the app.

Let’s take the following expression as an example:

plan~ANY~<PLAN_UUID>~AND~plan_group~ANY~<PLAN_GROUP_UUID>

Even though the filters are connected with the AND operator, a plan must match either the plan UUID OR the plan group UUID.

Operators

CFL uses the following operators:

Set operators

Comparison operators

Range operators

Containment operators

Identity operators

Review operators available for each filter.

Getting CFL from the app

The easiest way to construct a valid CFL string is to obtain it from the app:

  1. Navigate to Reports in ChartMogul.
  2. Apply your desired filters.
  3. Copy the filters parameter value from the browser address bar. Screenshot of the MRR chart with filters applied with the value of the filters parameter highlighted in the browser address bar

Using CFL in API requests

Use CFL as the value of the optional filters parameter when calling Metrics API endpoints. The parameter is only available for cURL calls.

Either use URL-encoded CFL copied from the address bar:

curl -X GET "https://api.chartmogul.com/v1/metrics/arr" \
  -u YOUR_API_KEY: \
  -d start-date=2025-01-01 \
  -d end-date=2025-03-31 \
  -d interval=month \
  -d filters=region~ANY~%27US%27%2C%27FR%27%2C%27DE%27~AND~mrr~GT~150

Or write CFL manually (requires double quotes around the key-value pair):

curl -X GET "https://api.chartmogul.com/v1/metrics/arr" \
  -u YOUR_API_KEY: \
  -d start-date=2025-01-01 \
  -d end-date=2025-03-31 \
  -d interval=month \
  -d "filters=region~ANY~'US','FR','DE'~AND~mrr~GT~150"

Available filters

The following table lists filters that can be used in CFL expressions (with their corresponding app names in parentheses), supported operators, and example values:

Filter Description Operators Values
active_quantity (Paid subscription quantity) Number of seats/licenses of paid subscriptions BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
active_subscriptions (# of active subscriptions) Number of active subscriptions BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
average_order_value (Average order value) Average amount spent on non-subscription payments BETWEEN Two comma-separated integers or floats, e.g., 0,10.14
LT, LTE, EQ, NOT_EQ, GTE, GT An integer or float, e.g., 10.14
churned_on (Churned) When the customer cancelled their last remaining subscription BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
churning_at (Cancellation scheduled for) Date of a scheduled cancellation BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
contacts_count (# of Contacts) Number of contacts the customer has BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
contracted_on (MRR contracted) When the customer’s MRR last decreased BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
currency (Currency) Customer’s billing currency ALL, ANY, NONE Comma-separated, single-quoted ISO 4217 currency codes, e.g., 'EUR','USD'
customer_lifetime (Didn’t cancel within N days of purchase) Number of days the customer remained active from their initial purchase before canceling (or current number of days if still active) BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
customer (Customer) Specific customer or customers ALL, ANY, NONE Comma-separated customer UUIDs, e.g., cus_aaa85a1e-719a-11ef-9288-f327e3cbde1d,cus_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
customer_since (Customer since) When the individual or company became a customer BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
customer_status (Customer status) Status of the customer: new_lead, working_lead, qualified_lead, unqualified_lead, active, past_due or cancelled ANY, NONE Comma-separated, single-quoted strings, e.g., 'past_due','cancelled'
data_source (Source) The source the customer is associated with ALL, ANY, NONE Comma-separated data source UUIDs, e.g., ds_aaa85a1e-719a-11ef-9288-f327e3cbde1d,ds_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
due_at (Due at) When the customer’s next payment is due BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
expanded_on (MRR expanded) When the customer’s MRR last increased BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
free_trial_started_at (Free trial started at) When the customer started their free trial BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
has_discount (Has discount) Whether the customer currently has a discount EQ TRUE or FALSE
has_open_task (Has open task) Whether the customer has an open task EQ TRUE or FALSE
has_opportunity (Has opportunity) Whether the customer has an associated opportunity EQ TRUE or FALSE
last_active_at (Last active at) Most recent date when a contact was active BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
last_communication_at (Last communication at) Date of most recent communication with the customer’s contacts BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
last_email_received_from_customer_at (Last email received from customer at) Most recent date when the customer’s contacts sent an email BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
last_email_sent_to_customer_at (Last email sent to customer at) Most recent date when an email was sent to the customer’s contacts BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
last_payment (Last payment) When the customer made their last payment BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
lead_created_at (Lead created at) When the individual or company became a lead BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
mrr_at_time_of_purchase (MRR at time of purchase) Customer’s MRR when they initially subscribed BETWEEN Two comma-separated integers or floats, e.g., 0,10.14
LT, LTE, EQ, NOT_EQ, GTE, GT An integer or float, e.g., 10.14
mrr_before_churn (MRR (Current, or at time of cancellation)) Customer’s current MRR or their MRR at the time of their most recent cancellation BETWEEN Two comma-separated integers or floats, e.g., 0,10.14
LT, LTE, EQ, NOT_EQ, GTE, GT An integer or float, e.g., 10.14
mrr (MRR (Current)) Customer’s current MRR BETWEEN Two comma-separated integers or floats, e.g., 0,10.14
LT, LTE, EQ, NOT_EQ, GTE, GT An integer or float, e.g., 10.14
net_payments (Net payments) Net payments (successful payments less refunds) BETWEEN Two comma-separated integers or floats, e.g., 0,10.14
LT, LTE, EQ, NOT_EQ, GTE, GT An integer or float, e.g., 10.14
next_payment (Next payment) When the customer is expected to make their next payment BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
owner (Owner) Primary salesperson responsible for the customer ANY, NONE, IS, IS_NOT NULL or comma-separated integers representing owners, e.g., 0,118,999,88199,9119,725
paid_subscriber_since (Paid subscriber since) When the customer became a paid subscriber for the first time BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
plan_at_purchase (Plan (at time of purchase)) Customer’s plan when they made their first purchase ANY, NONE Comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_at_subscription_start (Plan (at time of subscription)) Customer’s plan when they initially subscribed IS_NOT, ALL, ANY, NONE NULL or comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_at_trial_start (Plan (during trial)) Customer’s plan when they started their trial IS_NOT, ALL, ANY, NONE NULL or comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_group_at_purchase (Plan (at time of purchase)) The plan group associated with the customer’s plan when they made their first purchase ANY, NONE Comma-separated plan group UUIDs, e.g., plg_aaa85a1e-719a-11ef-9288-f327e3cbde1d,plg_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_group_at_subscription_start (Plan (at time of subscription)) The plan group associated with the customer’s plan when they initially subscribed ALL, ANY, NONE Comma-separated plan group UUIDs, e.g., plg_aaa85a1e-719a-11ef-9288-f327e3cbde1d,plg_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_group_at_trial_start (Plan (during trial)) The plan group associated with the customer’s plan when they started their trial ALL, ANY, NONE Comma-separated plan group UUIDs, e.g., plg_aaa85a1e-719a-11ef-9288-f327e3cbde1d,plg_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_group (Plan) The plan group associated with the customer’s current plan ALL, ANY, NONE Comma-separated plan group UUIDs, e.g., plg_aaa85a1e-719a-11ef-9288-f327e3cbde1d,plg_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_group_sub_set (Plan (including all items in subscription set)) The plan group associated with the customer’s current plan or any other plan in the same subscription set (such as a base plan with add-ons) ALL, ANY, NONE Comma-separated plan group UUIDs, e.g., plg_aaa85a1e-719a-11ef-9288-f327e3cbde1d,plg_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan (Plan) Customer’s current plan ALL, ANY, NONE Comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_sub_set (Plan (including all items in subscription set)) Customer’s current plan including any other plans in the same subscription set (such as a base plan with add-ons) ALL, ANY, NONE Comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
reactivated_on (Reactivated) When the customer reactivated a previously cancelled subscription BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
region (Region) Customer’s region based on their address ANY, NONE, IS, IS_NOT NULL or comma-separated, single-quoted strings, e.g., 'US','FR'
renewal_at (Renewal date) When the customer’s subscription is scheduled to renew BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
subscriber_since (Subscriber since) When the customer first became a subscriber BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06 or NULL
successful_payment_count (Number of successful payments) Number of successful payments the customer has made BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
tags (Tags) Customer tags ALL, ANY, NONE, IS, IS_NOT NULL or comma-separated, single-quoted strings, e.g., 'managed_account','churn_risk'
trial_to_conversion_in_days (Trial-to-conversion in days) Number of days between trial start and the start of a paid or free subscription BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
trial_to_paid_in_days (Trial-to-paid in days) Number of days between trial start and the start of a paid subscription BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
website (Website) URL of the customer’s website ANY, NONE NULL or comma-separated, single-quoted strings, e.g., 'https://myriapodlabs.com','https://jellytech.com'
EQ, NOT_EQ, CONTAINS, NOT_CONTAINS, IS, IS_NOT NULL or a single-quoted string, e.g., 'https://myriapodlabs.com'
custom.attribute_name Custom boolean attribute EQ, IS_NULL_OR_EQ TRUE or FALSE
Custom date attribute BETWEEN Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01
LT, LTE, EQ, GTE, GT, IS, IS_NOT An ISO 8601 date, e.g., 2025-12-06
Custom float attribute BETWEEN Two comma-separated floats, e.g., 0.01,9.99
LT, LTE, EQ, NOT_EQ, GTE, GT A float, e.g., 10.14
Custom integer attribute BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
Custom string attribute EQ, NOT_EQ, CONTAINS, NOT_CONTAINS, IS, IS_NOT NULL or a single-quoted string, e.g., 'medtech'
Custom string array attribute ANY, NONE NULL or comma-separated, single-quoted strings, e.g., 'medtech','fintech'