Skip to main content

Smart Batch を作成する

既存の BatchConfiguration にリンクされた SmartBatch を作成します。表示用の name と、rows に少なくとも 1 行の入力行を指定します。バッチを作成すると入力行が status: "draft" で永続化され、実行が開始されるまでカタログステップの実行やクレジット消費は行われません。

rows の各エントリは、ラップされたオブジェクト({ rowIndex?, inputData })またはフラットなオブジェクト({ rowIndex?, ...inputFields })のいずれかを受け付け、バリデーション層が { rowIndex, inputData } に正規化します。作成時には status、results、errors を含めないでください。

エンドポイント​

POST https://api.verifik.co/v2/smart-batches

このエンドポイントは、クライアント単位の Authorization: Bearer <VERIFIK_JWT> を使用することで Smart-Agent プロキシ(https://ai.verifik.co/v2/smart-batches)経由でもアクセスできます。共有 x402 実行は 403 Forbidden でブロックされます。

ヘッダー​

名前値説明
Content-Typeapplication/jsonリクエストペイロード形式。
AuthorizationBearer <VERIFIK_JWT>クライアントスコープの JWT(authUser.clientId)。

リクエストボディ​

名前型必須説明
batchConfigurationstringはいワークフローステップを定義する BatchConfiguration の ObjectId。
namestringはいバッチの表示名。最大 150 文字。
executorstringいいえ実行モード: "queue"、"featureRunner"、または "browser"。batchConfiguration から導出される場合は "queue" または "browser" に正規化されます。
sourcestringいいえ呼び出し元プロダクト識別子: "smart_batch"(既定)または "smart_fleet"。
rowsobject[]はい少なくとも 1 行を含む配列(min 1)。ラップ形式 { rowIndex?, inputData } またはフラット形式 { rowIndex?, ...inputFields } を受け付けます。作成時に status、results、errors を送信しないでください。

不明なキーや許可されていない行プロパティ(status、results、errors)は Joi バリデーションにより 409 MissingParameter で拒否されます。

リクエスト​

import axios from "axios";

const run = async () => {
const { data } = await axios.post(
"https://api.verifik.co/v2/smart-batches",
{
batchConfiguration: "6801a2b3c4d5e6f7a8b9c0d4",
name: "Colombia Onboarding — November",
source: "smart_batch",
rows: [
{
rowIndex: 0,
inputData: {
documentType: "CC",
documentNumber: "1032386359",
},
},
{
documentType: "CC",
documentNumber: "1007463534",
},
],
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);

console.log(data);
};

run();

レスポンス​

{
"data": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Onboarding — November",
"status": "draft",
"executor": "browser",
"source": "smart_batch",
"headlessRun": false,
"creditsSpent": 0,
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"status": "pending",
"results": {},
"errors": [],
"creditsSpent": 0,
"attemptCount": 0,
"attempts": []
},
{
"rowIndex": 1,
"inputData": {
"documentType": "CC",
"documentNumber": "1007463534"
},
"status": "pending",
"results": {},
"errors": [],
"creditsSpent": 0,
"attemptCount": 0,
"attempts": []
}
],
"totalRows": 2,
"completedRows": 0,
"failedRows": 0,
"partialRows": 0,
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:00:00.000Z"
}
}

補足​

  • バッチ作成時に rows 内に status、results、errors を絶対に渡さないでください。新しく作成された行は常に pending ステータスで開始します。
  • executor を省略した場合、batchConfiguration.executor から解決され、"queue" または "browser" に正規化されます。
  • 作成後は、Smart Batch のコストを見積もるを呼び出してクレジット請求額を事前確認し、Smart Batch を開始するで処理を開始してください。
  • 依存関係バリデーションや任意の即時実行を伴う CSV、XLSX、または JSONL の一括インポートには、ファイルから Smart Batch を作成するをご利用ください。

関連​