Smart Batch 行のステップを再試行する
SmartBatch の単一行(rowIndex)上で指定された sequences のみをクリアして再キュー登録し、それ以外のすべてのステップの保存済み出力および他のすべての行はそのまま保持します。rowIndex と sequences はどちらも必須です。
バッチ、対象行、配下の FeatureRunner 実行、または実行アイテムが現在処理中の場合、サーバーは 409 Conflict(batch_is_processing、row_is_processing、run_is_processing、item_is_processing)でリクエストを拒否します。
エンドポイント
POST https://api.verifik.co/v2/smart-batches/{id}/retry-steps
このエンドポイントは、クライアント単位の Authorization: Bearer <VERIFIK_JWT> を使用することで Smart-Agent プロキシ(https://ai.verifik.co/v2/smart-batches/{id}/retry-steps)経由でもアクセスできます。共有 x402 実行は 403 Forbidden でブロックされます。
ヘッダー
| 名前 | 値 | 説明 |
|---|---|---|
Content-Type | application/json | リクエストペイロード形式。 |
Authorization | Bearer <VERIFIK_JWT> | クライアントスコープの JWT(authUser.clientId)。 |
パラメータ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
id | string | はい | SmartBatch の ObjectId。 |
リクエストボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
rowIndex | integer | はい | 部分的に再試行する行の 0 始まりインデックス(>= 0)。 |
sequences | integer[] | はい | 該当行上でクリアして再実行するステップ順序番号(>= 0、最小 1 件、最大 200 件)。 |
不明なボディキーまたは必須フィールドの不足は Joi バリデーションにより 409 MissingParameter で拒否されます。
リクエスト
- Node.js
- PHP
- Python
- Go
- cURL
import axios from "axios";
const run = async () => {
const batchId = "6801a2b3c4d5e6f7a8b9c0d3";
const { data } = await axios.post(
`https://api.verifik.co/v2/smart-batches/${batchId}/retry-steps`,
{
rowIndex: 2,
sequences: [2, 3],
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);
console.log(data);
};
run();
<?php
$batchId = "6801a2b3c4d5e6f7a8b9c0d3";
$payload = [
"rowIndex" => 2,
"sequences" => [2, 3],
];
$ch = curl_init("https://api.verifik.co/v2/smart-batches/" . $batchId . "/retry-steps");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT"),
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os
import requests
batch_id = "6801a2b3c4d5e6f7a8b9c0d3"
url = f"https://api.verifik.co/v2/smart-batches/{batch_id}/retry-steps"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
payload = {
"rowIndex": 2,
"sequences": [2, 3],
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
batchID := "6801a2b3c4d5e6f7a8b9c0d3"
body, _ := json.Marshal(map[string]interface{}{
"rowIndex": 2,
"sequences": []int{2, 3},
})
req, _ := http.NewRequest("POST", "https://api.verifik.co/v2/smart-batches/"+batchID+"/retry-steps", bytes.NewReader(body))
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 POST "https://api.verifik.co/v2/smart-batches/6801a2b3c4d5e6f7a8b9c0d3/retry-steps" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"rowIndex": 2,
"sequences": [2, 3]
}'
レスポンス
- 200 OK
- 400
- 401
- 403
- 404 (バッチ)
- 404 (行)
- 409 (処理中)
- 409 (MissingParameter)
- 422
{
"data": {
"batch": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Onboarding — November",
"status": "processing",
"executor": "featureRunner",
"source": "smart_batch",
"headlessRun": true,
"creditsSpent": 0.4,
"totalRows": 10,
"completedRows": 9,
"failedRows": 0,
"partialRows": 0,
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:22:00.000Z"
},
"retried": 2
}
}
{
"message": "retry_steps_invalid",
"code": "BadRequest"
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "batch_not_found",
"code": "NotFound"
}
{
"message": "row_not_found",
"code": "NotFound"
}
{
"message": "batch_is_processing",
"code": "Conflict"
}
{
"message": "\"sequences\" must contain at least 1 items",
"code": "MissingParameter"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
補足
- 保存済みの
resultsとerrorsはrowIndex上で指定されたsequencesのみがクリアされ、他のすべてのステップ順序の結果はそのまま保持されます。 - 発生しうる
409 Conflictの理由はbatch_is_processing、row_is_processing、run_is_processing、およびitem_is_processingです。 - 無効または空のステップ順序参照を渡すと
400 BadRequest(retry_steps_invalid)が返されます。 - バッチ全体の失敗行や一部成功行を丸ごと再試行するには、失敗した Smart Batch 行を再試行するを使用してください。