Documentation Index
Fetch the complete documentation index at: https://adcp-docs-ja.pier1.co.jp/llms.txt
Use this file to discover all available pages before exploring further.
認証済みエージェントがこのベンダーエージェントで操作できるすべてのアカウントを返します。既存アカウントの探索、保留中アカウントのステータス変更確認、プロトコル操作で使用する account_id 値の取得に使用します。
list_accounts はすべてのベンダープロトコルで機能する — メディアバイエージェント、シグナルエージェント、ガバナンスエージェント、クリエイティブエージェントはすべてこの同じタスクを通じてアカウントを返します。
応答時間: 約1秒。
リクエストスキーマ: /schemas/v3/account/list-accounts-request.json
レスポンススキーマ: /schemas/v3/account/list-accounts-response.json
クイックスタート
このエージェントが操作できるすべてのアカウントを一覧表示します。
import { testAgent } from "@adcp/client/testing";
import { ListAccountsResponseSchema } from "@adcp/client";
const result = await testAgent.listAccounts({});
if (!result.success) {
throw new Error(`Request failed: ${result.error}`);
}
const validated = ListAccountsResponseSchema.parse(result.data);
if ("errors" in validated && validated.errors) {
throw new Error(`Operation failed: ${JSON.stringify(validated.errors)}`);
}
for (const account of validated.accounts) {
console.log(`${account.account_id}: ${account.name} (${account.status})`);
}
リクエストパラメーター
すべてのパラメーターはオプション。空のリクエストはすべてのアカウントを返します。
| パラメーター | 型 | 必須 | 説明 |
|---|
status | string | No | アカウントステータスでフィルタ: active、pending_approval、rejected、payment_required、suspended、closed。 |
sandbox | boolean | No | true の場合、サンドボックスアカウントのみ返します。false または省略時は本番アカウントのみ返します。主に明示的アカウント(require_operator_auth: true)で使用し、プラットフォーム上の既存テストアカウントを参照します。 |
pagination | object | No | 大規模アカウントセット用のページネーションカーソル。 |
レスポンス
| フィールド | 説明 |
|---|
accounts | アカウントオブジェクトの配列(下記参照) |
errors | リクエストが失敗した場合のエラー配列 |
pagination | さらに結果がある場合の次ページのページネーションカーソル |
各アカウントには以下が含まれます:
| フィールド | 説明 |
|---|
account_id | ベンダーエージェントの識別子。プロトコルタスクに渡す: create_media_buy、get_signals、activate_signal、report_usage などの操作。status: "rejected" の場合は省略されることがあります。 |
name | アカウントのベンダーエージェント表示名 |
brand | ブランド参照オブジェクト: domain(ブランドレジストリのハウスドメイン)とオプションの brand_id(ハウス内のサブブランド) |
operator | オペレータードメイン。常に存在 — ブランドが直接運営する場合、operator はブランドのドメインと同一。 |
status | 現在のアカウント状態: active、pending_approval、rejected、payment_required、suspended、closed |
billing | 有効な請求モデル: operator または agent |
account_scope | セラーがアカウントをスコープした方法: operator、brand、operator_brand、agent。アカウントスコープ を参照。 |
payment_terms | このアカウントで合意した支払い条件: net_15、net_30、net_45、net_60、net_90、prepay。アカウントがアクティブな場合、すべての請求書に対して拘束力を持ちます。 |
setup | status: "pending_approval" の場合に存在。セットアップ完了の url と必要な内容を説明する message を含みます。 |
一般的なシナリオ
アカウントがアクティブになるまでポーリング
sync_accounts が pending_approval を返した後、アカウントが準備できるまでポーリングします。
import { testAgent } from "@adcp/client/testing";
import { ListAccountsResponseSchema } from "@adcp/client";
async function waitForAccount(targetAccountId, maxAttempts = 20) {
for (let i = 0; i < maxAttempts; i++) {
const result = await testAgent.listAccounts({ status: "active" });
if (!result.success) {
throw new Error(`Request failed: ${result.error}`);
}
const validated = ListAccountsResponseSchema.parse(result.data);
if ("errors" in validated && validated.errors) {
throw new Error(`Operation failed: ${JSON.stringify(validated.errors)}`);
}
if ("accounts" in validated) {
const account = validated.accounts.find(a => a.account_id === targetAccountId);
if (account) {
console.log(`Account active: ${account.account_id}`);
return account;
}
}
// 再ポーリングまで30秒待機
await new Promise(resolve => setTimeout(resolve, 30_000));
}
throw new Error(`Account ${targetAccountId} did not become active`);
}
アクティブなアカウントのみフィルタ
import { testAgent } from "@adcp/client/testing";
import { ListAccountsResponseSchema } from "@adcp/client";
const result = await testAgent.listAccounts({ status: "active" });
if (!result.success) {
throw new Error(`Request failed: ${result.error}`);
}
const validated = ListAccountsResponseSchema.parse(result.data);
if ("accounts" in validated) {
for (const account of validated.accounts) {
console.log(`${account.account_id}: ${account.name} — billing: ${account.billing}`);
}
}
エラーハンドリング
| エラーコード | 説明 | 解決策 |
|---|
ACCOUNT_NOT_FOUND | このエージェントのアカウントが見つからない | まず sync_accounts を実行して購買関係を確立する |
次のステップ