Mittenti: rotte
Run Commands
L'unico punto di ingresso per i mittenti. Invia da 1 a 20 comandi in una richiesta e ricevi un risultato per comando.
https://g.sendcorex.com/v1/senderStessa struttura di Domains, Contacts e Logs. Le pagine sotto questa documentano ogni comando.
Gli errori sono riportati per comando. Un comando che fallisce non blocca gli altri e lo stato HTTP resta 200.
Parametri del body
commandsobject[]obbligatorioDa 1 a 20 comandi, eseguiti in ordine. L'intero body può arrivare a 1 MB.
commands[].commandstringobbligatoriolist_senders,get_sender,create_sender,update_sender,update_sender_descriptionodelete_sender.commands[].argsobjectfacoltativoGli argomenti del comando. Qualsiasi valore può essere un
$refal risultato di un comando precedente.commands[].idstringfacoltativoIl tuo identificatore per il risultato. Predefinito l'indice (
"0","1"…). Obbligatorio se vuoi usare$ref.
Avvio rapido
import axios from 'axios';
const response = await axios.post(
'https://g.sendcorex.com/v1/sender',
{
commands: [
{
command: "list_senders",
id: "all"
},
{
command: "get_sender",
id: "one",
args: {
sender_id: "K7Q2M9XR4TB8WD1ZC6NF3HJP"
}
}
]
},
{ 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);
}Risposta
{
"type": "SUCCESS",
"results": [
{
"command": "list_senders",
"id": "all",
"type": "SUCCESS",
"took_ms": 5,
"data": {
"senders": [
{
"sender_id": "K7Q2M9XR4TB8WD1ZC6NF3HJP",
"email": "hello@acme.com",
"username": "hello",
"domain": "acme.com",
"from_name": "Acme",
"reply_to": "support@acme.com",
"description": "Product updates",
"avatar_color": "#2F6FDB",
"warmup_enabled": false,
"reputation": {
"delivered": 18420,
"bounced": 131,
"spam": 6,
"received_messages": 2210,
"total_emails": 18557,
"has_minimum_volume": true,
"delivery_rate": 99,
"bounce_rate": 1,
"spam_rate": 0,
"engagement_rate": 12,
"score": 100,
"status": "Excellent"
},
"created_at": "2026-09-02T14:40:12.530Z",
"updated_at": "2026-10-20T08:15:33.004Z"
}
]
}
},
{
"command": "get_sender",
"id": "one",
"type": "SUCCESS",
"took_ms": 2,
"data": {
"sender_id": "K7Q2M9XR4TB8WD1ZC6NF3HJP",
"email": "hello@acme.com",
"username": "hello",
"domain": "acme.com",
"from_name": "Acme",
"reply_to": "support@acme.com",
"description": "Product updates",
"avatar_color": "#2F6FDB",
"warmup_enabled": false,
"reputation": {
"delivered": 18420,
"bounced": 131,
"spam": 6,
"received_messages": 2210,
"total_emails": 18557,
"has_minimum_volume": true,
"delivery_rate": 99,
"bounce_rate": 1,
"spam_rate": 0,
"engagement_rate": 12,
"score": 100,
"status": "Excellent"
},
"created_at": "2026-09-02T14:40:12.530Z",
"updated_at": "2026-10-20T08:15:33.004Z"
}
}
]
}Campi della risposta
typeSempre
SUCCESSquando la richiesta stessa è stata accettata.results[].commandIl comando che ha prodotto questo risultato.
results[].idL'
idche hai inviato, o l'indice del comando.results[].typeSUCCESSoERROR.results[].took_msTempo impiegato dal comando nel server.
results[].dataL'output del comando. Presente solo quando
typeèSUCCESS.results[].code / messageL'errore. Presente solo quando
typeèERROR.
Autenticazione
Usa la API key che crei nella dashboard, in Developers → API Keys, con gli scope richiesti dai comandi.
AuthorizationInvia
Authorization: <api key>oAuthorization: Bearer <api key>.sender:readlist_senderseget_sender.sender:createcreate_sender.sender:updateupdate_sendereupdate_sender_description.sender:deletedelete_sender.Token delle caselleIl token della webmail qui non funziona. Viene rifiutato con
WRONG_CREDENTIAL_TYPE.IP consentitiSe la chiave ha una allowlist di IP, le richieste da altri IP ricevono
403 IP_NOT_ALLOWED.
Concatenare con $ref
Crea un mittente e passa il suo id al comando successivo nella stessa richiesta.
create_sender → update_sender_description
{
"commands": [
{
"command": "create_sender",
"id": "new",
"args": {
"username": "news",
"from_name": "Acme News",
"reply_to": "news@acme.com",
"domain": "acme.com"
}
},
{
"command": "update_sender_description",
"args": {
"sender_id": {
"$ref": "new",
"path": "sender_id"
},
"description": "Monthly newsletter"
}
}
]
}Rate limit
15 richieste / secondoPer IP + API key. Oltre, HTTP 429 con un header
Retry-After.15 in corsoAl massimo 15 richieste elaborate contemporaneamente, per IP + API key.
Per comando, per accountcreate_sendereupdate_sender10/min ·update_sender_description20/min ·delete_sender30/min. Oltre, quel comando rispondeRATE_LIMITED.Nessuna cacheOgni chiamata legge il database. Ciò che ricevi è sempre aggiornato.
Errori
Gli errori a livello HTTP restituiscono type, code e message. Gli errori marcati CMD tornano dentro il risultato del comando, con HTTP 200.
- 400
INVALID_JSONIl body non è {"commands":[...]} o supera 1 MB.
- 400
INVALID_ARGSLa richiesta non ha comandi o ne ha più di 20.
- 401
MISSING_AUTH_HEADERNon è stato inviato nessun header Authorization.
- 401
INVALID_API_KEYLa API key non esiste, è stata revocata o disattivata nella dashboard.
- 401
API_KEY_EXPIREDLa API key ha superato la data di scadenza impostata nella dashboard.
- 401
WRONG_CREDENTIAL_TYPEÈ stato inviato un token di casella. La Senders API richiede una API key della dashboard.
- 403
IP_NOT_ALLOWEDLa richiesta proviene da un IP che non è tra gli IP consentiti della chiave.
- 403
ACCOUNT_BLOCKEDL'account è bloccato.
- 403
MISSING_SCOPELa chiave non ha alcuno scope `sender:*`, quindi nessun comando può essere eseguito.
- 429
RATE_LIMITEDPiù di 15 richieste/s o 15 in corso per la stessa IP + API key. Attendi i secondi indicati in Retry-After.
- 503
AUTH_UNAVAILABLEL'autenticazione è temporaneamente non disponibile. Riprova.
- CMD
UNKNOWN_COMMANDIl nome del comando non esiste.
- CMD
INTERNALErrore del server. Il dettaglio viene scritto solo nel log del server.