Skip to main content

Annuler un Smart Batch

Annulez un SmartBatch (ainsi que toute exécution FeatureRunner associée). Le lot passe à status: "cancelled" et définit completedAt.

Les lots déjà dans un statut terminal ("completed", "failed" ou "cancelled") ne peuvent pas être annulés et renvoient 400 BadRequest (batch_already_terminal).

Point de terminaison​

POST https://api.verifik.co/v2/smart-batches/{id}/cancel

Ce point de terminaison est également accessible via le proxy Smart-Agent à l'adresse https://ai.verifik.co/v2/smart-batches/{id}/cancel 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​

NomValeurDescription
Content-Typeapplication/jsonFormat de la charge utile de la requête.
AuthorizationBearer <VERIFIK_JWT>JWT lié au client (authUser.clientId).

Paramètres​

NomTypeRequisDescription
idstringOuiObjectId SmartBatch à annuler.

Requête​

import axios from "axios";

const run = async () => {
const batchId = "6801a2b3c4d5e6f7a8b9c0d3";

const { data } = await axios.post(
`https://api.verifik.co/v2/smart-batches/${batchId}/cancel`,
{},
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);

console.log(data);
};

run();

Réponse​

{
"data": {
"_id": "6801a2b3c4d5e6f7a8b9c0d3",
"batchConfiguration": "6801a2b3c4d5e6f7a8b9c0d4",
"client": "507f1f77bcf86cd799439013",
"name": "Colombia Onboarding — November",
"status": "cancelled",
"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",
"completedAt": "2026-11-24T20:25:00.000Z",
"createdAt": "2026-11-24T20:00:00.000Z",
"updatedAt": "2026-11-24T20:25:00.000Z"
}
}

Notes​

  • Les lots annulés conservent tous les résultats de lignes collectés précédemment et peuvent être redémarrés ultérieurement via Démarrer un Smart Batch.
  • Si vous souhaitez interrompre temporairement le traitement et continuer plus tard sans redémarrer, utilisez Mettre en pause un Smart Batch.

Voir aussi​