---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/ja/api-reference/privacy/reading/get-many

トラッキング設定：読み取り

# Get Many

1つのコマンドで最大100人の受信者の設定を取得します。送信の直前に使い、受信者ごとにtrack_opensとtrack_clicksを決めてください。

POST `https://g.sendcorex.com/v1/privacy` command: get_many

API keyに`privacy:read`スコープが必要です。

返るのは設定を持つ受信者だけです。回答に含まれないアドレスは何も選んでいません。

## 引数

- `emails` string[] 必須
1〜100件の受信者アドレス。重複や無効なアドレスは無視されます。
例： `["jane.doe@example.com", "marc.dupont@example.fr", "new.person@example.com"]`

## クイックスタート

```
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);
```

## レスポンス

```
{
  "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"
          }
        ]
      }
    }
  ]
}
```

### レスポンスの項目

- `preferences`
設定を持つ受信者ごとに1件。
- `preferences[].email`
受信者のアドレス（小文字）。
- `preferences[].track_opens`
`true`は開封のトラッキングを許可、`false`は拒否、`null`は未選択。
- `preferences[].track_clicks`
`true`はクリックのトラッキングを許可、`false`は拒否、`null`は未選択。
- `preferences[].source`
変更した人：`page`（トラッキング設定のページで受信者が）、`api`（あなたがSet Preferencesで）、`dashboard`。
- `preferences[].updated_at`
変更した日時。ISO 8601、UTC。

## 送信前

まとめて読み取り、各受信者が許可するトラッキングで送信します。設定のない受信者には既定の設定が適用されます。

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,
  });
}
```

拒否を守るためにこれを行う必要はありません：`"unsubscribe": true`なら、トラッキングをオフにした受信者がトラッキングされることはありません。これは、受信者が許可するまでトラッキングをオフにしておく必要があるオプトインのルール向けです。

## 回答

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"
    }
  ]
}
```

## エラー

HTTPレベルのエラーは`type`、`code`、`message`を返します。CMDと表示されたエラーは、HTTP 200でコマンドの結果内に返ります。

- 401`INVALID_API_KEY`
API keyが存在しないか、取り消されたか、ダッシュボードで無効化されています。
- 429`RATE_LIMITED`
同じIP + API keyで毎秒15リクエストまたは同時15件を超えました。Retry-Afterの秒数だけ待ってください。
- CMD`MISSING_SCOPE`
API keyにこのコマンドのscopeがありません（読み取りは`privacy:read`、変更は`privacy:write`）。
- CMD`INVALID_ARGS`
引数が無効です：`email`がないか形式が不正、`emails`が100件を超える、`true`/`false`でない`track_opens`、範囲外のlimit…
- CMD`INTERNAL`
サーバーエラー。詳細はサーバーのログにのみ記録されます。
