Tracking Preferences: Reading

List Changes

Every preference change of your account, oldest first, with a cursor. Keep your CRM in sync without missing one.

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

Needs the privacy:read scope on your API key.

i

Keep next_cursor and send it on the next call. It always comes back, even when nothing changed.

i

Changes show up about 5 seconds after they happen, and the feed keeps the last 90 days.

Arguments

  • cursorstringoptional

    The next_cursor of the previous call. Without it you start at the beginning of the 90 days.

    e.g. "ZjowMDAwMDAwMDgzOjE3NjEyOTA0MTIwMzE6amFuZS5kb2VAZXhhbXBsZS5jb20"

  • limitnumberoptional

    Changes per call, from 1 to 1000. Defaults to 100.

    e.g. 100

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/privacy',
  {
    commands: [
      {
        command: "list_changes",
        args: {
          cursor: "ZjowMDAwMDAwMDgzOjE3NjEyOTA0MTIwMzE6amFuZS5kb2VAZXhhbXBsZS5jb20",
          limit: 100
        }
      }
    ]
  },
  { 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": "list_changes",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 6,
      "data": {
        "changes": [
          {
            "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"
          }
        ],
        "next_cursor": "ZjowMDAwMDAwMDgzOjE3NjEyOTA0MTIwMzE6amFuZS5kb2VAZXhhbXBsZS5jb20",
        "has_more": false
      }
    }
  ]
}

Response fields

  • changes

    The changes of this call, oldest first. Each one is the full state of the recipient after the change.

  • next_cursor

    Send it as cursor on the next call.

  • has_more

    true when more changes are already waiting: call again right away.

  • changes[].email

    The recipient address, in lowercase.

  • changes[].track_opens

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

  • changes[].track_clicks

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

  • changes[].source

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

  • changes[].updated_at

    When the change was made. ISO 8601, UTC.

Sync with your CRM

Store the cursor somewhere that survives a restart. On every tick, read until has_more is false and write each change to the contact in your CRM (Salesforce, HubSpot…).

Node.js

let cursor = await loadCursor(); // null the first time

async function sync() {
  let more = true;
  while (more) {
    const [r] = await call({ command: 'list_changes', args: cursor ? { cursor, limit: 500 } : { limit: 500 } });
    for (const c of r.data.changes) {
      if (c.source === 'api') continue; // you made this change yourself
      await crm.updateContact(c.email, { trackOpens: c.track_opens, trackClicks: c.track_clicks, consentAt: c.updated_at });
    }
    cursor = r.data.next_cursor;
    await saveCursor(cursor);
    more = r.data.has_more;
  }
}

setInterval(sync, 60_000);
i

Prefer push? The tracking_preferences_updated webhook sends each change made on the page the moment it happens. Use this command as the safety net.

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…

  • CMDINVALID_CURSOR

    The cursor is malformed or came from a different account. Start again without a cursor.

  • CMDINTERNAL

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