Mettre en pause un Smart Batch
Mettez en pause un SmartBatch actif (ainsi que toute exécution FeatureRunner associée) sans perdre les résultats déjà enregistrés pour les lignes terminées. Les workers cessent de prendre en charge les lignes restantes jusqu'à ce que vous repreniez le lot.
Les lots en file d'attente ou navigateur doivent être au statut "processing" ou "pending" (400 batch_not_pausable sinon). Les lots adossés à une exécution FeatureRunner requièrent que l'exécution soit au statut "queued" ou "processing" (400 run_not_pausable sinon). La mise en pause ne consomme pas de crédits.
Point de terminaison
POST https://api.verifik.co/v2/smart-batches/{id}/pause
Ce point de terminaison est également accessible via le proxy Smart-Agent à l'adresse https://ai.verifik.co/v2/smart-batches/{id}/pause 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 à mettre en pause. |
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}/pause`,
{},
{
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 . "/pause");
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, "{}");
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}/pause"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
response = requests.post(url, json={}, headers=headers)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
batchID := "6801a2b3c4d5e6f7a8b9c0d3"
req, _ := http.NewRequest("POST", "https://api.verifik.co/v2/smart-batches/"+batchID+"/pause", bytes.NewReader([]byte("{}")))
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/pause" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT"
Réponse
- 200 OK
- 400
- 401
- 403
- 404
- 409
- 422
{
"data": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Onboarding — November",
"status": "paused",
"executor": "queue",
"source": "smart_batch",
"headlessRun": false,
"creditsSpent": 0.4,
"rows": [],
"totalRows": 25,
"completedRows": 10,
"failedRows": 0,
"partialRows": 0,
"startedAt": "2026-11-24T20:10:00.000Z",
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:14:00.000Z"
}
}
{
"message": "batch_not_pausable",
"code": "BadRequest"
}
{
"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"
}
Notes
- Pour mettre en pause un lot par programmation, utilisez toujours ce point de terminaison plutôt que
PUT /v2/smart-batches/{id}(qui n'accepte pas"paused"). - Un lot adossé à
FeatureRunnerrenvoie400 BadRequestavecrun_not_pausablesi son exécution n'est pas au statut"queued"ou"processing". - Poursuivez l'exécution plus tard via Reprendre un Smart Batch, ou interrompez-la définitivement avec Annuler un Smart Batch.