連絡先:カスタム項目
項目の一覧
アカウントのすべてのカスタム項目と、その型・選択肢(キー順)。
POST
https://g.sendcorex.com/v1/contactscommand: list_fieldsAPI keyにcontact:readスコープが必要です。
引数
このエンドポイントに引数はありません。
クイックスタート
import axios from 'axios';
const response = await axios.post(
'https://g.sendcorex.com/v1/contacts',
{
commands: [
{
command: "list_fields"
}
]
},
{ 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": "list_fields",
"id": "0",
"type": "SUCCESS",
"took_ms": 14,
"data": {
"fields": [
{
"key": "age",
"name": "Age",
"type": "number",
"options": null,
"created_at": "2026-10-01T10:00:00.000Z",
"updated_at": "2026-10-01T10:00:00.000Z"
},
{
"key": "plan",
"name": "Plan",
"type": "enum",
"options": [
"free",
"pro",
"business"
],
"created_at": "2026-10-01T10:00:00.000Z",
"updated_at": "2026-10-01T10:00:00.000Z"
}
],
"limit": 100
}
}
]
}レスポンスの項目
fields[].keyfields、where、sort(fields.<key>)で使うキー。fields[].name表示名。
fields[].typetext、number、date、bool、enum、multi_enum。fields[].optionsenumとmulti_enum項目の許可される値。limitアカウントで持てる項目数(100)。
エラー
HTTPレベルのエラーはtype、code、messageを返します。CMDと表示されたエラーは、HTTP 200でコマンドの結果内に返ります。
- 401
INVALID_API_KEYAPI keyが存在しないか、取り消されたか、ダッシュボードで無効化されています。
- 429
RATE_LIMITED同じIP + API keyで毎秒15リクエストまたは同時15件を超えました。Retry-Afterの秒数だけ待ってください。
- CMD
MISSING_SCOPEAPI keyにこのコマンドに必要なスコープがありません。リクエスト内のほかのコマンドは実行されます。
- CMD
INTERNALサーバーエラー。詳細はサーバーのログにのみ記録されます。