Skip to main content

Smart Batch の進捗を取得する

rows 配列全体を転送することなく、SmartBatch の軽量な進捗サマリーを取得します。レスポンスには行カウンター(totalRows、completedRows、failedRows、partialRows、pendingRows)、実行タイムスタンプ、creditsSpent、および(FeatureRunner 実行に支えられている場合は)ネストされた run と台帳の spend 詳細が含まれます。

サーバー側の FeatureRunner 実行では、batchConfiguration.notification.webhookUrl が設定されている場合、完了時に smart_batch_batch_completed Webhook イベント(runId と creditsSpent を含む)も送信されます。このエンドポイントをポーリングしてもクレジットは消費されません。

エンドポイント​

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

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

ヘッダー​

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

パラメータ​

名前型必須説明
idstringはいポーリング対象の SmartBatch ObjectId。

リクエスト​

import axios from "axios";

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

const { data } = await axios.get(`https://api.verifik.co/v2/smart-batches/${batchId}/progress`, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});

console.log(data);
};

run();

レスポンス​

{
"data": {
"batchId": "6801a2b3c4d5e6f7a8b9c0d3",
"status": "processing",
"serverSide": true,
"totalRows": 25,
"completedRows": 12,
"failedRows": 1,
"partialRows": 2,
"pendingRows": 10,
"startedAt": "2026-11-24T20:10:00.000Z",
"creditsSpent": 1.6,
"run": {
"id": "6801a2b3c4d5e6f7a8b9c0e1",
"status": "processing",
"mergeStrategy": "sequential",
"totalItems": 25,
"completedItems": 12,
"failedItems": 1,
"partialItems": 2,
"startedAt": "2026-11-24T20:10:00.500Z",
"completedAt": null
},
"spend": {
"credits": 1.6,
"calls": 28,
"billableCalls": 24
}
}
}

補足​

  • バッチに関連する FeatureRunner 実行がある場合に run と spend が含まれます(参照先の実行レコードが返されない場合、run は null になります)。
  • サーバー側の FeatureRunner 実行では、batchConfiguration.notification.webhookUrl が設定されている場合、終了時に smart_batch_batch_completed Webhook イベント(runId と creditsSpent 付き)を送信します。Smart Reports Webhookを参照してください。
  • バッチが終了ステータスに達したら、Smart Batch を取得するを使用して行レベルの results と errors を確認してください。

関連​