Retrieve a sub-account's stats
The sub-account's sending per UTC day: recipients, sent, delivered, bounced, complained, failed and suppressed, counted from its emails as they are now (a later bounce moves its day's numbers). Emails are kept 45 days, so earlier days are left out.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
subaccount*stringThe sub-account's id (sub_…) or your uid for it.
from?stringFirst day (UTC, YYYY-MM-DD); default 30 days before to.
dateto?stringLast day (UTC, YYYY-MM-DD), included; default today.
dateCoss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"The sub-account's stats.
application/json- response
- response
- …
object*"subaccount_stats""subaccount_stats"subaccount_id*stringfrom*stringdateto*stringdatedata*array<>One entry per day with sends, oldest first; recipients count by their current status.
import { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.email.subaccounts.stats("user_8812");{ "object": "subaccount_stats", "subaccount_id": "sub_01k7c8m4q2f3e9v6t5r1n0p8yz", "from": "2026-10-15", "to": "2026-10-15", "data": [ { "date": "2026-10-15", "recipients": 120, "sent": 118, "delivered": 115, "bounced": 2, "complained": 0, "failed": 0, "suppressed": 2 } ]}