Obter progresso do Smart Batch
Busque um resumo leve de progresso para um SmartBatch sem transferir todo o array rows. A resposta inclui contadores de linhas (totalRows, completedRows, failedRows, partialRows, pendingRows), timestamps de execução, creditsSpent e — quando apoiado por uma execução FeatureRunner — detalhes aninhados de run e do razão spend.
Execuções FeatureRunner no servidor também emitem um evento de webhook smart_batch_batch_completed (incluindo runId e creditsSpent) após a conclusão quando batchConfiguration.notification.webhookUrl está configurado. Consultar este endpoint não consome créditos.
Endpoint
GET https://api.verifik.co/v2/smart-batches/{id}/progress
Este endpoint também é acessível pelo proxy do Smart-Agent em https://ai.verifik.co/v2/smart-batches/{id}/progress usando seu próprio Authorization: Bearer <VERIFIK_JWT> por cliente. A execução compartilhada via x402 é bloqueada com 403 Forbidden.
Cabeçalhos
| Nome | Valor | Descrição |
|---|---|---|
Content-Type | application/json | Formato do payload da requisição. |
Authorization | Bearer <VERIFIK_JWT> | JWT com escopo de cliente (authUser.clientId). |
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string | Sim | ObjectId do SmartBatch a consultar. |
Requisição
- Node.js
- PHP
- Python
- Go
- cURL
import axios from "axios";
const run = async () => {
const batchId = "6801a2b3c4d5e6f7a8b9c0d3";
const { data } = await axios.get(`https://api.verifik.co/v2/smart-batches/${batchId}/progress`, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});
console.log(data);
};
run();
<?php
$batchId = "6801a2b3c4d5e6f7a8b9c0d3";
$ch = curl_init("https://api.verifik.co/v2/smart-batches/" . $batchId . "/progress");
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
batch_id = "6801a2b3c4d5e6f7a8b9c0d3"
url = f"https://api.verifik.co/v2/smart-batches/{batch_id}/progress"
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() {
batchID := "6801a2b3c4d5e6f7a8b9c0d3"
req, _ := http.NewRequest("GET", "https://api.verifik.co/v2/smart-batches/"+batchID+"/progress", 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/6801a2b3c4d5e6f7a8b9c0d3/progress" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT"
Resposta
- 200 OK (Com FeatureRunner)
- 200 OK (Sem execução)
- 401
- 403
- 404
- 409
- 422
{
"data": {
"batchId": "6801a2b3c4d5e6f7a8b9c0d3",
"status": "processing",
"serverSide": true,
"totalRows": 25,
"completedRows": 12,
"failedRows": 1,
"partialRows": 2,
"pendingRows": 10,
"startedAt": "2026-11-24T20:10:00.000Z",
"creditsSpent": 1.6,
"run": {
"id": "6801a2b3c4d5e6f7a8b9c0e1",
"status": "processing",
"mergeStrategy": "sequential",
"totalItems": 25,
"completedItems": 12,
"failedItems": 1,
"partialItems": 2,
"startedAt": "2026-11-24T20:10:00.500Z",
"completedAt": null
},
"spend": {
"credits": 1.6,
"calls": 28,
"billableCalls": 24
}
}
}
{
"data": {
"batchId": "6801a2b3c4d5e6f7a8b9c0d3",
"status": "completed",
"serverSide": true,
"totalRows": 10,
"completedRows": 10,
"failedRows": 0,
"partialRows": 0,
"pendingRows": 0,
"startedAt": "2026-11-24T20:10:00.000Z",
"completedAt": "2026-11-24T20:12:30.000Z",
"creditsSpent": 0.4
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "batch_not_found",
"code": "NotFound"
}
{
"message": "\"id\" is required",
"code": "MissingParameter"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
Notas
runespendsão incluídos quando o lote possui uma execuçãoFeatureRunnerassociada (runénullse o registro de execução referenciado não for retornado).- Execuções
FeatureRunnerno servidor emitem o evento de webhooksmart_batch_batch_completed(comrunIdecreditsSpent) quando finalizadas sebatchConfiguration.notification.webhookUrlestiver definido. Veja Webhooks do Smart Reports. - Assim que o lote atingir um status terminal, use Obter um Smart Batch para inspecionar
resultseerrorspor linha.