Retrieve a sub-account's stats

GET
/v1/subaccounts/{subaccount}/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.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.

Path Parameters

subaccount*string

The sub-account's id (sub_…) or your uid for it.

Query Parameters

from?string

First day (UTC, YYYY-MM-DD); default 30 days before to.

Formatdate
to?string

Last day (UTC, YYYY-MM-DD), included; default today.

Formatdate

Header Parameters

Coss-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.

Value in"2026-10-10"

Response Body

The sub-account's stats.

application/json
  1. response
object*"subaccount_stats"
Value in"subaccount_stats"
subaccount_id*string
from*string
Formatdate
to*string
Formatdate
data*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    }  ]}