Counters: Reading

Get Months

Month by month, plus the total of the period. Only months with sends are listed.

POSThttps://g.sendcorex.com/v1/counterscommand: get_months
i

Needs the counters:read scope on your API key.

Arguments

  • fromstringoptional

    First month, YYYY-MM, inclusive. Without it, from the first month with sends.

    e.g. "2026-01"

  • tostringoptional

    Last month, YYYY-MM, inclusive. Without it, up to now.

    e.g. "2026-10"

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/counters',
  {
    commands: [
      {
        command: "get_months",
        args: {
          from: "2026-01",
          to: "2026-10"
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);

Response

{
  "type": "SUCCESS",
  "results": [
    {
      "command": "get_months",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 18,
      "data": {
        "months": [
          {
            "month": "2026-09",
            "delivered": 48210,
            "bounced": 612,
            "blocked": 88,
            "complaints": 9,
            "rate_limited": 140,
            "total": 49050,
            "delivered_rate": 98.29,
            "bounce_rate": 1.25,
            "blocked_rate": 0.18,
            "complaint_rate": 0.02,
            "rate_limited_rate": 0.29
          },
          {
            "month": "2026-10",
            "delivered": 48210,
            "bounced": 612,
            "blocked": 88,
            "complaints": 9,
            "rate_limited": 140,
            "total": 49050,
            "delivered_rate": 98.29,
            "bounce_rate": 1.25,
            "blocked_rate": 0.18,
            "complaint_rate": 0.02,
            "rate_limited_rate": 0.29
          }
        ],
        "totals": {
          "delivered": 48210,
          "bounced": 612,
          "blocked": 88,
          "complaints": 9,
          "rate_limited": 140,
          "total": 49050,
          "delivered_rate": 98.29,
          "bounce_rate": 1.25,
          "blocked_rate": 0.18,
          "complaint_rate": 0.02,
          "rate_limited_rate": 0.29
        }
      }
    }
  ]
}

Response fields

  • months

    One entry per month with sends, oldest first. Each has month (YYYY-MM) and the counters.

  • totals

    The counters summed over the period, with the rates recalculated.

  • delivered

    Emails the recipient server accepted.

  • bounced

    Emails that did not get through: rejected by the recipient server, expired in the queue, or stopped before sending. The reason of each one is in Bounces & Complaints.

  • blocked

    Emails the recipient server refused as spam, by policy or reputation at delivery time. The address is fine: the problem was the send (list quality, volume, authentication, content).

  • complaints

    Recipients who reported your email as spam after receiving it: feedback loops (Outlook, Yahoo…) and abuse reports. Not part of total, since those emails were already counted as delivered.

  • rate_limited

    Emails the recipient server kept deferring until the retries ran out.

  • total

    delivered + bounced + blocked + rate_limited: every email that got a result.

  • delivered_rate / bounce_rate / blocked_rate / complaint_rate / rate_limited_rate

    Each counter as a percentage of total, with 2 decimals. 0 when total is 0.

Errors

HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.

  • 401INVALID_API_KEY

    The API key does not exist, was revoked or was disabled in the dashboard.

  • 429RATE_LIMITED

    More than 15 requests/s or 15 in flight for the same IP + API key. Wait the number of seconds in Retry-After.

  • CMDMISSING_SCOPE

    The API key does not have `counters:read`.

  • CMDINVALID_ARGS

    An argument is invalid: a month that is not YYYY-MM, a day that is not YYYY-MM-DD, an unknown timezone, from later than to, a range that is too long…

  • CMDINTERNAL

    Server error. The detail is only written to the server log.