Récupérer un Smart Batch
Récupérez un seul document SmartBatch par identifiant pour le client authentifié. Avant de renvoyer la charge utile, le serveur fusionne les sorties smartbatchrows stockées en externe dans rows[].results et exécute healIncompleteRows() pour rouvrir les lignes marquées completed auxquelles il manque des étapes de configuration activées.
Si le lot n'existe pas ou appartient à un autre compte client, le point de terminaison renvoie 200 avec { "data": null }. La lecture d'un lot n'exécute aucune vérification et ne consomme pas de crédits.
Point de terminaison
GET https://api.verifik.co/v2/smart-batches/{id}
Ce point de terminaison est également accessible via le proxy Smart-Agent à l'adresse https://ai.verifik.co/v2/smart-batches/{id} 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 de chemin
| Nom | Type | Requis | Description |
|---|---|---|---|
id | string | Oui | ObjectId SmartBatch. |
Paramètres de requête
| Nom | Type | Requis | Description |
|---|---|---|---|
select | string | Non | Expression de projection de champs (par exemple "-rows" pour exclure les charges utiles des lignes). |
columns | string | Non | Sous-ensemble de champs à inclure sur le document renvoyé. |
populates[] | string[] | Non | Documents associés à renseigner : "batchConfiguration" et/ou "client". |
Requête
- 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}`, {
params: {
"populates[]": ["batchConfiguration", "client"],
},
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});
console.log(data);
};
run();
<?php
$batchId = "6801a2b3c4d5e6f7a8b9c0d3";
$query = "populates%5B%5D=batchConfiguration&populates%5B%5D=client";
$ch = curl_init("https://api.verifik.co/v2/smart-batches/" . $batchId . "?" . $query);
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}"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
params = [
("populates[]", "batchConfiguration"),
("populates[]", "client"),
]
response = requests.get(url, params=params, headers=headers)
print(response.json())
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
)
func main() {
batchID := "6801a2b3c4d5e6f7a8b9c0d3"
params := url.Values{}
params.Add("populates[]", "batchConfiguration")
params.Add("populates[]", "client")
req, _ := http.NewRequest("GET", "https://api.verifik.co/v2/smart-batches/"+batchID+"?"+params.Encode(), 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?populates%5B%5D=batchConfiguration&populates%5B%5D=client" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT"
Réponse
- 200 OK
- 200 OK (Introuvable)
- 401
- 403
- 409
- 422
{
"data": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"batchConfiguration": {
"_id": "6801a2b3c4d5e6f7a8b9c0d4",
"name": "Colombia Identity Check"
},
"client": {
"_id": "507f1f77bcf86cd799439013"
},
"name": "Colombia Onboarding — November",
"status": "completed",
"executor": "browser",
"source": "smart_batch",
"headlessRun": false,
"creditsSpent": 0.04,
"rows": [
{
"rowIndex": 0,
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"status": "completed",
"results": {
"1": {
"fullName": "JANE DOE",
"documentNumber": "1032386359"
}
},
"errors": [],
"creditsSpent": 0.04,
"attemptCount": 1,
"processedAt": "2026-11-24T20:01:00.000Z"
}
],
"totalRows": 1,
"completedRows": 1,
"failedRows": 0,
"partialRows": 0,
"startedAt": "2026-11-24T20:00:00.000Z",
"completedAt": "2026-11-24T20:01:00.000Z",
"createdAt": "2026-11-24T19:58:00.000Z",
"updatedAt": "2026-11-24T20:01:00.000Z"
}
}
{
"data": null
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "\"id\" is required",
"code": "MissingParameter"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
Notes
- Les résultats d'étapes externes
smartbatchrowssont automatiquement fusionnés dansrows[].resultslors de la lecture du lot. healIncompleteRows()inspecte chaque lignecompletedpar rapport aux étapes activées debatchConfigurationet remet enpendingtoute ligne à laquelle il manque la sortie d'une étape ou une erreur enregistrée.- Pour un suivi fréquent du statut, privilégiez Obtenir la progression d'un Smart Batch afin d'éviter de transférer à répétition les charges utiles complètes des lignes.