Counters: Routes
Run Commands
The single entry point for your account counters. Send 1 to 20 commands in one request and get one result per command.
https://g.sendcorex.com/v1/countersSame envelope as Logs and Contacts. Ask for the totals, this month and the last 30 days in one request.
Errors are reported per command. A command that fails does not stop the others, and the HTTP status stays 200.
Body parameters
commandsobject[]required1 to 20 commands, executed in order. The whole body can have up to 1 MB.
commands[].commandstringrequiredget_totals,get_month,get_months,get_dailyorget_hourly.commands[].argsobjectoptionalThe command arguments.
commands[].idstringoptionalYour own identifier for the result. Defaults to the index (
"0","1"…).
Quick start
import axios from 'axios';
const response = await axios.post(
'https://g.sendcorex.com/v1/counters',
{
commands: [
{
command: "get_totals",
id: "all"
},
{
command: "get_month",
id: "now"
}
]
},
{ headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);
for (const result of response.data.results) {
if (result.type !== 'SUCCESS') console.error(result.id, result.code, result.message);
else console.log(result.id, result.data);
}Response
{
"type": "SUCCESS",
"results": [
{
"command": "get_totals",
"id": "all",
"type": "SUCCESS",
"took_ms": 3,
"data": {
"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
}
}
},
{
"command": "get_month",
"id": "now",
"type": "SUCCESS",
"took_ms": 2,
"data": {
"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
}
}
]
}Response fields
typeAlways
SUCCESSwhen the request itself was accepted.results[].command / id / typeWhich command, your id (or the index), and
SUCCESSorERROR.results[].dataThe command output. Only present when
typeisSUCCESS.results[].code / messageThe error. Only present when
typeisERROR.
Authentication
Use the API key you create in the dashboard, under Developers → API Keys, with the counters:read scope.
AuthorizationSend
Authorization: <api key>orAuthorization: Bearer <api key>.counters:readThe only scope this route needs. It is read-only.
Mailbox tokensThe webmail token does not work here. It is rejected with
WRONG_CREDENTIAL_TYPE.
What is counted
Every emailAPI, SMTP relay and campaigns, all together. Each email counts once, when it gets its final result.
LiveThe counters move a few seconds after each delivery result. There is no daily batch.
Hours and months in UTCget_hourlyandget_month(s)use UTC.get_dailybuilds the days in the timezone you ask for.
Rate limits and cache
15 requests / secondPer IP + API key. Over that you get HTTP 429 with
Retry-After.Read cache: 1.5 sThe same command with the same args within 1.5 seconds returns the same result.
Errors
HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.
- 400
INVALID_JSONThe body is not {"commands":[...]} or is larger than 1 MB.
- 400
INVALID_ARGSThe request has no commands or more than 20.
- 401
MISSING_AUTH_HEADERNo Authorization header was sent.
- 401
INVALID_API_KEYThe API key does not exist, was revoked or was disabled in the dashboard.
- 401
API_KEY_EXPIREDThe API key passed the expiration date set in the dashboard.
- 401
WRONG_CREDENTIAL_TYPEA mailbox token was sent. The Counters API needs a dashboard API key.
- 403
IP_NOT_ALLOWEDThe request came from an IP that is not in the allowed IPs of the key.
- 403
ACCOUNT_BLOCKEDThe account is blocked.
- 403
MISSING_SCOPEThe key does not have `counters:read`, so no command can run.
- 429
RATE_LIMITEDMore than 15 requests/s or 15 in flight for the same IP + API key. Wait the number of seconds in Retry-After.
- 503
AUTH_UNAVAILABLEAuthentication is temporarily unavailable. Try again.
- CMD
UNKNOWN_COMMANDThe command name does not exist.
- CMD
INTERNALServer error. The detail is only written to the server log.