連絡先:リスト

リストの更新

リストの名前、説明、入手元、カスタムデータを変更します。送った部分だけが変わります。

POSThttps://g.sendcorex.com/v1/contactscommand: update_list

API keyにcontact:updateスコープが必要です。

引数

  • list_idstring必須

    変更するリスト。id自体は変更できません。

    例: "customers"

  • namestring任意

    新しい名前。nullで消去します。

  • descriptionstring任意

    新しい説明。nullで消去します。

  • sourcestring任意

    新しい入手元。nullで消去します。

  • customobject任意

    現在のカスタムデータに統合されます。nullで送ったキーは削除されます。

    例: { "year": null, "owner": "sales" }

クイックスタート

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/contacts',
  {
    commands: [
      {
        command: "update_list",
        args: {
          list_id: "customers",
          name: "Customers (VIP)",
          custom: {
            year: null,
            owner: "sales"
          }
        }
      }
    ]
  },
  { 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": "update_list",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 14,
      "data": {
        "list_id": "customers",
        "name": "Customers (VIP)",
        "description": "Everyone who bought at least once",
        "source": "checkout",
        "status": "ready",
        "custom": {
          "origin": "checkout",
          "owner": "sales"
        },
        "created_at": "2026-10-01T10:00:00.000Z",
        "updated_at": "2026-10-12T15:22:41.000Z",
        "stats": {
          "total": 1834,
          "ok": 1790,
          "opened": 912,
          "clicked": 233
        }
      }
    }
  ]
}

レスポンスの項目

  • (list)

    変更後のリスト(stats付き)。

エラー

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

  • 401INVALID_API_KEY

    API keyが存在しないか、取り消されたか、ダッシュボードで無効化されています。

  • 429RATE_LIMITED

    同じIP + API keyで毎秒15リクエストまたは同時15件を超えました。Retry-Afterの秒数だけ待ってください。

  • CMDMISSING_SCOPE

    API keyにこのコマンドに必要なスコープがありません。リクエスト内のほかのコマンドは実行されます。

  • CMDINVALID_ARGS

    必須の引数がないか不正です:メールアドレス、項目の値、enumの選択肢、whereのキー、リストのid…

  • CMDNOT_FOUND

    連絡先、リスト、項目、またはセグメントが存在しません。

  • CMDINTERNAL

    サーバーエラー。詳細はサーバーのログにのみ記録されます。