List stats — GET /v1/marketing/lists/{id}/stats

Returns one list's numbers for charting: subscribers by status, source and consent basis, and over a range of days, what happened each day, the net growth, the confirmation rate and the unsubscribe rate.

GET /v1/marketing/lists/{id}/stats

Addresshttps://api.hanzo.ai/v1/marketing/lists/{id}/stats
MethodGET
Operationget_marketing_lists_by_id_stats
AuthAuthorization: Bearer $HANZO_API_KEY

Returns one list's numbers for charting: subscribers by status, source and consent basis, and over a range of days, what happened each day, the net growth, the confirmation rate and the unsubscribe rate. Every number is read from kept counts, never by reading the list.

Request

3 fields.

FieldInTypeRequiredDescription
idpathstringyesID is the list, by id or slug, from the path.
fromquerystring—From is the first day, YYYY-MM-DD (UTC); 30 days before To by default.
toquerystring—To is the last day, YYYY-MM-DD (UTC); today by default.

Response

StatusBodyMeaning
200marketing.ListStatsok
defaultproblem-detailsrefused

200 body — 20 fields.

FieldInTypeAlwaysDescription
basesbodyobject—Bases are the subscribers by the consent basis recorded for them, now.
bases.*bodyinteger (int64)—
confirmationRatebodynumber (double)—ConfirmationRate is the share of the range's requests confirmed in it, between 0 and 1; 0 with none requested.
countsbodyobject—Counts are the subscribers by status, now.
counts.*bodyinteger (int64)—
daysbodymarketing.Day[]—Days are the range, one entry a day, every day present.
days[].bouncedbodyinteger (int64)—Bounced counts addresses the provider bounced.
days[].cleanedbodyinteger (int64)—Cleaned counts addresses removed as unmailable.
days[].complainedbodyinteger (int64)—Complained counts addresses that reported a mail as spam.
days[].confirmedbodyinteger (int64)—Confirmed counts subscriptions confirmed by their address's owner.
days[].daybodystring—Day is the date, YYYY-MM-DD (UTC).
days[].importedbodyinteger (int64)—Imported counts rows imports added.
days[].requestedbodyinteger (int64)—Requested counts subscriptions asked for and waiting to be confirmed.
days[].subscribedbodyinteger (int64)—Subscribed counts subscriptions that began without a confirmation (single opt-in, the API, the preference page).
days[].unsubscribedbodyinteger (int64)—Unsubscribed counts subscribers who left.
growthbodyinteger (int64)—Growth is the range's net change: subscribed, confirmed and imported, less unsubscribed, bounced, complained and cleaned.
listbodystring—List is the list's id.
sourcesbodyobject—Sources are the subscribers by where they came from, now.
sources.*bodyinteger (int64)—
unsubscribeRatebodynumber (double)—UnsubscribeRate is the range's unsubscribes over the subscribers there were to lose (subscribed now plus those who left in the range), between 0 and 1.

Failure carries the platform error shape — see Errors.

Examples

hanzo marketing lists stats <id>
import { Configuration, MarketingApi } from 'hanzoai';

const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMarketingListsByIdStats({ id: 'id' });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketingApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketingApi(client).get_marketing_lists_by_id_stats(id='id')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MarketingAPI.GetMarketingListsByIdStats(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, marketing_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = marketing_api::get_marketing_lists_by_id_stats(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketingApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new MarketingApi(client).getMarketingListsByIdStats();

The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →

curl https://api.hanzo.ai/v1/marketing/lists/<id>/stats \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches marketing through the marketing tool, which names its 82 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_marketing_audiences"
         }
       }
     }'

Marketing API · All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.