Reintentar pasos de fila de Smart Batch
Limpia y vuelve a encolar únicamente las secuencias (sequences) específicas de una sola fila (rowIndex) en un SmartBatch, dejando intactos los resultados almacenados de todos los demás pasos y todas las demás filas. Tanto rowIndex como sequences son requeridos.
El servidor rechaza la solicitud con 409 Conflict si el lote, la fila objetivo, la ejecución subyacente de FeatureRunner o el elemento de ejecución se encuentran actualmente en procesamiento (batch_is_processing, row_is_processing, run_is_processing, item_is_processing).
Endpoint
POST https://api.verifik.co/v2/smart-batches/{id}/retry-steps
Este endpoint también es accesible a través del proxy de Smart-Agent en https://ai.verifik.co/v2/smart-batches/{id}/retry-steps usando tu propio encabezado Authorization: Bearer <VERIFIK_JWT> por cliente. La ejecución compartida x402 está bloqueada con 403 Forbidden.
Encabezados
| Nombre | Valor | Descripción |
|---|---|---|
Content-Type | application/json | Formato de carga útil de la solicitud. |
Authorization | Bearer <VERIFIK_JWT> | JWT delimitado al cliente (authUser.clientId). |
Parámetros
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
id | string | Sí | ObjectId de SmartBatch. |
Cuerpo
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
rowIndex | integer | Sí | Índice en base 0 (>= 0) de la fila a reintentar parcialmente. |
sequences | integer[] | Sí | Números de secuencia de paso (>= 0, mínimo 1, máximo 200 elementos) a limpiar y volver a ejecutar en esa fila. |
Las claves desconocidas o campos requeridos faltantes son rechazados por la validación Joi con 409 MissingParameter.
Solicitud
- 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]
}'
Respuesta
- 200 OK
- 400
- 401
- 403
- 404 (Lote)
- 404 (Fila)
- 409 (En procesamiento)
- 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"
}
Notas
- Los
resultsyerrorsalmacenados se limpian solo para las secuenciassequencesespecificadas enrowIndex; los resultados de todas las demás secuencias de pasos permanecen intactos. - Los posibles motivos de
409 Conflictsonbatch_is_processing,row_is_processing,run_is_processingyitem_is_processing. - Pasar referencias de secuencia de pasos inválidas o vacías devuelve
400 BadRequest(retry_steps_invalid). - Para reintentar filas completas fallidas o parciales en todo el lote, usa Reintentar filas fallidas de Smart Batch.