Skip to main content

Smart Batch を更新する

認証済みクライアントが所有する既存の SmartBatch のフィールドを更新します。name、status、executor の更新、または rows の置き換えが可能です。rows が指定された場合、サーバーは totalRows、completedRows、failedRows、partialRows を再計算し、外部の行スナップショットを同期します。

バッチを "paused" に遷移させるには専用のSmart Batch を一時停止するエンドポイントを使用してください。executor の変更は、バッチが現在 "draft"、"pending"、または "cancelled" ステータスの場合にのみ有効になります。

エンドポイント​

PUT https://api.verifik.co/v2/smart-batches/{id}

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

ヘッダー​

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

パラメータ​

名前型必須説明
idstringはい更新する SmartBatch の ObjectId。

リクエストボディ​

名前型必須説明
namestringいいえ更新後のバッチ表示名。最大 150 文字。
statusstringいいえ許可値: "draft"、"pending"、"processing"、"completed"、"failed"、または "cancelled"。"paused" には POST /v2/smart-batches/{id}/pause を使用してください。
executorstringいいえ許可値: "queue"、"featureRunner"、または "browser"。現在のバッチステータスが "draft"、"pending"、または "cancelled" の場合にのみ有効になります。
rowsobject[]いいえ置き換え用の行リスト。ラップ形式には rowIndex と inputData が必須で、任意で status、results、errors、processedAt を受け付けます。フラットな行は自動的に正規化されます。

不明なボディキーは Joi バリデーションにより 409 MissingParameter で拒否されます。

リクエスト​

import axios from "axios";

const run = async () => {
const batchId = "6801a2b3c4d5e6f7a8b9c0d3";

const { data } = await axios.put(
`https://api.verifik.co/v2/smart-batches/${batchId}`,
{
name: "Colombia Onboarding — Updated",
executor: "queue",
rows: [
{
rowIndex: 0,
inputData: {
documentType: "CC",
documentNumber: "1032386359",
},
status: "pending",
},
],
},
{
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 — Updated",
"status": "draft",
"executor": "queue",
"source": "smart_batch",
"headlessRun": false,
"creditsSpent": 0,
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"status": "pending",
"results": {},
"errors": []
}
],
"totalRows": 1,
"completedRows": 0,
"failedRows": 0,
"partialRows": 0,
"createdAt": "2026-11-24T19:58:00.000Z",
"updatedAt": "2026-11-24T20:06:00.000Z"
}
}

補足​

  • "paused" は PUT /v2/smart-batches/{id} では受け付けられません。代わりにSmart Batch を一時停止するを呼び出してください。
  • executor の更新は、バッチが現在 "draft"、"pending"、または "cancelled" ステータスでない限り無視されます。
  • 既存の行を置き換えることなく既存バッチに新しい行を追加するには、Smart Batch に行を追加するを使用してください。

関連​