設定ごとのバッチ統計を取得する
認証済みクライアントアカウント上で、特定の BatchConfiguration に属するすべての SmartBatch レコード全体の集計実行統計を取得します。レスポンスでは、バッチ数、行完了合計、および "draft"、"pending"、"processing"、"completed"、"failed"、"cancelled" ごとのステータス内訳が返されます。
設定の統計情報を読み取ってもチェックは実行されず、クレジットも消費されません。
エンドポイント
GET https://api.verifik.co/v2/smart-batches/stats/{configId}
このエンドポイントは、クライアント単位の Authorization: Bearer <VERIFIK_JWT> を使用することで Smart-Agent プロキシ(https://ai.verifik.co/v2/smart-batches/stats/{configId})経由でもアクセスできます。共有 x402 実行は 403 Forbidden でブロックされます。
ヘッダー
| 名前 | 値 | 説明 |
|---|---|---|
Content-Type | application/json | リクエストペイロード形式。 |
Authorization | Bearer <VERIFIK_JWT> | クライアントスコープの JWT(authUser.clientId)。 |
パラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
configId | string | はい | バッチ統計を集計する BatchConfiguration の ObjectId。 |
リクエスト
- Node.js
- PHP
- Python
- Go
- cURL
import axios from "axios";
const run = async () => {
const configId = "6801a2b3c4d5e6f7a8b9c0d4";
const { data } = await axios.get(`https://api.verifik.co/v2/smart-batches/stats/${configId}`, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});
console.log(data);
};
run();
<?php
$configId = "6801a2b3c4d5e6f7a8b9c0d4";
$ch = curl_init("https://api.verifik.co/v2/smart-batches/stats/" . $configId);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT"),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os
import requests
config_id = "6801a2b3c4d5e6f7a8b9c0d4"
url = f"https://api.verifik.co/v2/smart-batches/stats/{config_id}"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
response = requests.get(url, headers=headers)
print(response.json())
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
configID := "6801a2b3c4d5e6f7a8b9c0d4"
req, _ := http.NewRequest("GET", "https://api.verifik.co/v2/smart-batches/stats/"+configID, nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_JWT"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
curl -X GET "https://api.verifik.co/v2/smart-batches/stats/6801a2b3c4d5e6f7a8b9c0d4" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT"
レスポンス
- 200 OK
- 401
- 403
- 409
- 422
{
"data": {
"totalBatches": 4,
"totalRows": 120,
"completedRows": 95,
"failedRows": 5,
"partialRows": 4,
"pendingRows": 16,
"statusBreakdown": {
"draft": 0,
"pending": 1,
"processing": 1,
"completed": 2,
"failed": 0,
"cancelled": 0
}
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "\"configId\" is required",
"code": "MissingParameter"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
補足
- 統計情報は認証済みクライアント(JWT 上の
clientId)にスコープされます。 pendingRowsはtotalRows - completedRows - failedRows - partialRowsとして計算されます。- この設定に属する個別のバッチを確認するには、Smart Batch 一覧に
batchConfigurationを指定してください。