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.

POSThttps://g.sendcorex.com/v1/sender

Stessa 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[]obbligatorio

    Da 1 a 20 comandi, eseguiti in ordine. L'intero body può arrivare a 1 MB.

  • commands[].commandstringobbligatorio

    list_senders, get_sender, create_sender, update_sender, update_sender_description o delete_sender.

  • commands[].argsobjectfacoltativo

    Gli argomenti del comando. Qualsiasi valore può essere un $ref al risultato di un comando precedente.

  • commands[].idstringfacoltativo

    Il 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

  • type

    Sempre SUCCESS quando la richiesta stessa è stata accettata.

  • results[].command

    Il comando che ha prodotto questo risultato.

  • results[].id

    L'id che hai inviato, o l'indice del comando.

  • results[].type

    SUCCESS o ERROR.

  • results[].took_ms

    Tempo impiegato dal comando nel server.

  • results[].data

    L'output del comando. Presente solo quando type è SUCCESS.

  • results[].code / message

    L'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.

  • Authorization

    Invia Authorization: <api key> o Authorization: Bearer <api key>.

  • sender:read

    list_senders e get_sender.

  • sender:create

    create_sender.

  • sender:update

    update_sender e update_sender_description.

  • sender:delete

    delete_sender.

  • Token delle caselle

    Il token della webmail qui non funziona. Viene rifiutato con WRONG_CREDENTIAL_TYPE.

  • IP consentiti

    Se 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 / secondo

    Per IP + API key. Oltre, HTTP 429 con un header Retry-After.

  • 15 in corso

    Al massimo 15 richieste elaborate contemporaneamente, per IP + API key.

  • Per comando, per account

    create_sender e update_sender 10/min · update_sender_description 20/min · delete_sender 30/min. Oltre, quel comando risponde RATE_LIMITED.

  • Nessuna cache

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

  • 400INVALID_JSON

    Il body non è {"commands":[...]} o supera 1 MB.

  • 400INVALID_ARGS

    La richiesta non ha comandi o ne ha più di 20.

  • 401MISSING_AUTH_HEADER

    Non è stato inviato nessun header Authorization.

  • 401INVALID_API_KEY

    La API key non esiste, è stata revocata o disattivata nella dashboard.

  • 401API_KEY_EXPIRED

    La API key ha superato la data di scadenza impostata nella dashboard.

  • 401WRONG_CREDENTIAL_TYPE

    È stato inviato un token di casella. La Senders API richiede una API key della dashboard.

  • 403IP_NOT_ALLOWED

    La richiesta proviene da un IP che non è tra gli IP consentiti della chiave.

  • 403ACCOUNT_BLOCKED

    L'account è bloccato.

  • 403MISSING_SCOPE

    La chiave non ha alcuno scope `sender:*`, quindi nessun comando può essere eseguito.

  • 429RATE_LIMITED

    Più di 15 richieste/s o 15 in corso per la stessa IP + API key. Attendi i secondi indicati in Retry-After.

  • 503AUTH_UNAVAILABLE

    L'autenticazione è temporaneamente non disponibile. Riprova.

  • CMDUNKNOWN_COMMAND

    Il nome del comando non esiste.

  • CMDINTERNAL

    Errore del server. Il dettaglio viene scritto solo nel log del server.