Obtener estadísticas de lotes de configuración
Recupera estadísticas agregadas de ejecución en todos los registros SmartBatch que pertenecen a una BatchConfiguration específica en la cuenta de cliente autenticada. La respuesta devuelve conteos de lotes, totales de finalización de filas y un desglose por estado entre "draft", "pending", "processing", "completed", "failed" y "cancelled".
Consultar las estadísticas de configuración no ejecuta comprobaciones y no consume créditos.
Endpoint
GET https://api.verifik.co/v2/smart-batches/stats/{configId}
Este endpoint también es accesible a través del proxy de Smart-Agent en https://ai.verifik.co/v2/smart-batches/stats/{configId} 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 |
|---|---|---|---|
configId | string | Sí | ObjectId de BatchConfiguration para agregar estadísticas de lotes. |
Solicitud
- 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"
Respuesta
- 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"
}
Notas
- Las estadísticas están delimitadas al cliente autenticado (
clientIden tu JWT). pendingRowsse calcula comototalRows - completedRows - failedRows - partialRows.- Para inspeccionar lotes individuales pertenecientes a esta configuración, pasa
batchConfigurationa Listar Smart Batches.