---
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/contacts/lists/create-list

連絡先：リスト

# リストの作成

リストを作成します。コードから参照できるよう独自のidを指定するか、サーバーに生成させます。

POST `https://g.sendcorex.com/v1/contacts` command: create_list

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

リストは送信用に連絡先をまとめるものです。連絡先自体はアカウントに属し、リストに追加してもコピーはされません。

## 引数

- `list_id` string 任意
独自のid：`a-z`、`0-9`、`_`、`-`で40文字まで。省略時は生成されます。既存のidでは`ALREADY_EXISTS`で失敗します。
例： `"customers"`
- `name` string 任意
表示名。
例： `"Customers"`
- `description` string 任意
リストと一緒に表示する自由テキスト。
- `source` string 任意
参考用の、連絡先の入手元。
例： `"checkout"`
- `custom` object 任意
独自のデータ（最大50キー）。
例： `{ "origin": "checkout", "year": 2026 }`

## クイックスタート

```
import axios from 'axios';

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

### レスポンスの項目

- `list_id`
送ったid、または生成されたid。
- `status`
`ready`。
- `stats`
カウンター（新しいリストではすべて`0`）。

## 次は：リストを埋める

Upsert Contactsで`list_id`を送ると直接リストにインポートでき、既存の連絡先にはAdd To Listsを使います。

## エラー

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にこのコマンドに必要なスコープがありません。リクエスト内のほかのコマンドは実行されます。
- CMD`INVALID_ARGS`
必須の引数がないか不正です：メールアドレス、項目の値、enumの選択肢、whereのキー、リストのid…
- CMD`ALREADY_EXISTS`
既存のlist_idでcreate_listが呼ばれました。
- CMD`INTERNAL`
サーバーエラー。詳細はサーバーのログにのみ記録されます。
