diff --git a/lib/plausible_web/plugs/authorize_stats_api.ex b/lib/plausible_web/plugs/authorize_stats_api.ex index c09919187..b45c41de9 100644 --- a/lib/plausible_web/plugs/authorize_stats_api.ex +++ b/lib/plausible_web/plugs/authorize_stats_api.ex @@ -45,7 +45,7 @@ defmodule PlausibleWeb.AuthorizeStatsApiPlug do {:error, :upgrade_required} -> H.payment_required( conn, - "#{Plausible.Billing.Feature.StatsAPI.display_name()} is part of the Plausible Business plan. To get access to this feature, please upgrade your account." + "The account that owns this API key does not have access to Stats API. Please make sure you're using the API key of a subscriber account and that the subscription plan includes Stats API" ) {:error, :site_locked} -> diff --git a/test/plausible_web/controllers/api/external_stats_controller/auth_test.exs b/test/plausible_web/controllers/api/external_stats_controller/auth_test.exs index 0a8837310..e8ca4804d 100644 --- a/test/plausible_web/controllers/api/external_stats_controller/auth_test.exs +++ b/test/plausible_web/controllers/api/external_stats_controller/auth_test.exs @@ -163,7 +163,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.AuthTest do |> get("/api/v1/stats/aggregate", %{"site_id" => site.domain, "metrics" => "pageviews"}) |> assert_error( 402, - "Stats API is part of the Plausible Business plan. To get access to this feature, please upgrade your account." + "The account that owns this API key does not have access to Stats API." ) end