Relancer les lignes en échec d'un Smart Batch
Remettez en file d'attente les lignes au statut "failed" ou "partial" sur un SmartBatch sans affecter les lignes déjà terminées. Passez facultativement rowIndexes pour ne relancer qu'un sous-ensemble spécifique de lignes ; omettez rowIndexes pour relancer toutes les lignes "failed" et "partial" du lot.
La requête échoue avec 409 Conflict (batch_is_processing) si le lot est actuellement au statut "processing". Une réponse avec retried: 0 indique qu'aucune ligne en échec ou partielle éligible ne correspondait.
Point de terminaison
POST https://api.verifik.co/v2/smart-batches/{id}/retry-failed
Ce point de terminaison est également accessible via le proxy Smart-Agent à l'adresse https://ai.verifik.co/v2/smart-batches/{id}/retry-failed avec votre propre en-tête Authorization: Bearer <VERIFIK_JWT>. L'exécution partagée x402 est bloquée avec 403 Forbidden.
En-têtes
| Nom | Valeur | Description |
|---|---|---|
Content-Type | application/json | Format de la charge utile de la requête. |
Authorization | Bearer <VERIFIK_JWT> | JWT lié au client (authUser.clientId). |
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
id | string | Oui | ObjectId SmartBatch. |
Corps de la requête
| Nom | Type | Requis | Description |
|---|---|---|---|
rowIndexes | integer[] | Non | Index de lignes spécifiques basés sur 0 (>= 0, 10000 éléments maximum) à relancer. Omettez pour relancer toutes les lignes "failed" et "partial". |
Les clés de corps inconnues sont rejetées par la validation Joi avec 409 MissingParameter.
Requête
- 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-failed`,
{
rowIndexes: [2, 5],
},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);
console.log(data);
};
run();
<?php
$batchId = "6801a2b3c4d5e6f7a8b9c0d3";
$payload = [
"rowIndexes" => [2, 5],
];
$ch = curl_init("https://api.verifik.co/v2/smart-batches/" . $batchId . "/retry-failed");
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-failed"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
payload = {
"rowIndexes": [2, 5],
}
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{}{
"rowIndexes": []int{2, 5},
})
req, _ := http.NewRequest("POST", "https://api.verifik.co/v2/smart-batches/"+batchID+"/retry-failed", 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-failed" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT" \
-d '{
"rowIndexes": [2, 5]
}'
Réponse
- 200 OK
- 401
- 403
- 404
- 409 (Lot en cours de traitement)
- 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": 8,
"failedRows": 0,
"partialRows": 0,
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:20:00.000Z"
},
"retried": 2
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "batch_not_found",
"code": "NotFound"
}
{
"message": "batch_is_processing",
"code": "Conflict"
}
{
"message": "\"rowIndexes[0]\" must be greater than or equal to 0",
"code": "MissingParameter"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
Notes
- Envoyez
{}(ou omettezrowIndexes) pour relancer en une seule fois toutes les lignes"failed"et"partial". - Lorsque
rowIndexesest fourni, les lignes au statut"completed"ou"pending"sont ignorées même si leur index figure dans le tableau. - Pour ne réexécuter que certaines séquences d'étapes sur une seule ligne tout en préservant les résultats des autres étapes, utilisez Relancer les étapes d'une ligne de Smart Batch.