E-mails ontvangen: contacten en doelgroep

Check Recipients

Geeft aan welke ontvangers zich voor deze mailbox hebben afgemeld. Alleen-lezen.

POSThttps://g.sendcorex.com/v1command: check_recipients

Argumenten

  • emailsstring[]verplicht

    1 tot 100 adressen.

Snel starten

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "check_recipients",
        args: {
          emails: [
            "ana@empresa.com",
            "joao@empresa.com"
          ]
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);

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": "check_recipients",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "recipients": [
          {
            "email": "ana@empresa.com",
            "subscribed": true,
            "unsubscribed_at": null
          },
          {
            "email": "joao@empresa.com",
            "subscribed": false,
            "unsubscribed_at": "2026-11-02T14:10:00Z"
          }
        ]
      }
    }
  ]
}

Responsevelden

  • recipients[]

    email, subscribed en unsubscribed_at.

Fouten

Fouten op HTTP-niveau geven type, code en message terug. Fouten met CMD komen terug in het resultaat van de opdracht, met HTTP 200.

  • 401TOKEN_EXPIRED

    De access token is verlopen. Roep Refresh Token aan en herhaal het request.

  • 401INVALID_TOKEN

    De token is ongeldig, onbekend of ingetrokken.

  • 429RATE_LIMITED

    Meer dan 15 requests/s of 15 tegelijk voor hetzelfde IP + mailbox. Wacht het aantal seconden uit Retry-After.

  • CMDINVALID_ARGS

    Een verplicht argument ontbreekt of is ongeldig.

  • CMDINTERNAL

    Serverfout. Het detail wordt alleen in het serverlog geschreven.