Tracking Preferences: Reading

Get Many

The preferences of up to 100 recipients in one command. Use it right before a send to decide track_opens and track_clicks per recipient.

POSThttps://g.sendcorex.com/v1/privacycommand: get_many
i

Needs the privacy:read scope on your API key.

i

Only recipients that have a preference come back. An address missing from the answer never chose anything.

Arguments

  • emailsstring[]required

    1 to 100 recipient addresses. Duplicates and invalid addresses are ignored.

    e.g. ["jane.doe@example.com", "marc.dupont@example.fr", "new.person@example.com"]

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/privacy',
  {
    commands: [
      {
        command: "get_many",
        args: {
          emails: [
            "jane.doe@example.com",
            "marc.dupont@example.fr",
            "new.person@example.com"
          ]
        }
      }
    ]
  },
  { 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_many",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 6,
      "data": {
        "preferences": [
          {
            "email": "jane.doe@example.com",
            "track_opens": false,
            "track_clicks": true,
            "source": "page",
            "updated_at": "2026-10-24T07:20:12.031Z"
          },
          {
            "email": "marc.dupont@example.fr",
            "track_opens": false,
            "track_clicks": false,
            "source": "api",
            "updated_at": "2026-10-24T07:41:55.508Z"
          }
        ]
      }
    }
  ]
}

Response fields

  • preferences

    One entry per recipient that has a preference.

  • preferences[].email

    The recipient address, in lowercase.

  • preferences[].track_opens

    true the recipient allows open tracking, false they refused it, null they never chose.

  • preferences[].track_clicks

    true the recipient allows click tracking, false they refused it, null they never chose.

  • preferences[].source

    Who made the change: page (the recipient, on the tracking preferences page), api (you, with Set Preferences) or dashboard.

  • preferences[].updated_at

    When the change was made. ISO 8601, UTC.

Before sending

Read the batch, then send each recipient with the tracking they allow. Recipients without a preference follow your default.

Node.js

const [r] = await call({ command: 'get_many', args: { emails: batch.map((x) => x.email) } });
const prefs = new Map(r.data.preferences.map((p) => [p.email, p]));

for (const x of batch) {
  const p = prefs.get(x.email.toLowerCase());
  await send({
    to: x.email,
    unsubscribe: true,
    track_opens: p?.track_opens === true,   // opt-in: only when allowed
    track_clicks: p?.track_clicks === true,
  });
}
i

You do not have to do this to respect a refusal: with "unsubscribe": true, a recipient who turned tracking off is never tracked. This is for opt-in rules, where tracking must stay off until the recipient allows it.

The answer

data

{
  "preferences": [
    {
      "email": "jane.doe@example.com",
      "track_opens": false,
      "track_clicks": true,
      "source": "page",
      "updated_at": "2026-10-24T07:20:12.031Z"
    },
    {
      "email": "marc.dupont@example.fr",
      "track_opens": false,
      "track_clicks": false,
      "source": "api",
      "updated_at": "2026-10-24T07:41:55.508Z"
    }
  ]
}

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 the scope of this command (`privacy:read` to read, `privacy:write` to change).

  • CMDINVALID_ARGS

    An argument is invalid: missing or malformed `email`, more than 100 `emails`, `track_opens` that is not `true`/`false`, limit out of range…

  • CMDINTERNAL

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