Scan multi (wizard)

Ces routes ne font pas partie de l’API REST Enterprise (Bearer). Elles sont réservées à l’application web : session utilisateur et workspace dans l’URL.

Authentification : cookie de session (utilisateur connecté), même périmètre que le scan simple.

  • POST /{workspace}/scan/chat-wizard/api/scan-multi-start — multipart : champ image (fichier). Crée le lot et enregistre la photo, réponse { batchId }. À appeler en premier pour avoir l’URL et le dashboard avant la détection des zones.
  • POST /{workspace}/scan/chat-wizard/api/scan-multi-detect-regions — multipart : soit champ image (fichier), soit champ batchId (image déjà stockée sur le lot). Réponse JSON : { regions: [ { x, y, width, height } ] } (coordonnées normalisées 0–1).
  • POST /{workspace}/scan/chat-wizard/api/scan-multi — multipart : champ zones (JSON string) obligatoire ; soit champ image, soit champ batchId. Réponse : batchId, contacts[], blocked[], duplicateZones[] (zones avec doublons potentiels : token + candidats ; confirmer via POST …/api/scan-card/confirm), limit { current, max, remaining }. POST …/api/scan-card — prévisualisation ; POST …/api/scan-card/confirm — persistance (resolution: stop | create_new | merge).
  • GET /{workspace}/scan/chat-wizard/api/batch-wizard-state/{batchId} — état du lot pour reprise (contacts, image, statut).

Le quota mensuel du workspace limite le nombre de contacts créés ; les zones au-delà apparaissent dans blocked avec la raison scan.limit_reached.