{"openapi":"3.0.3","info":{"title":"WaziBot API","version":"1.0.0","description":"API REST WaziBot pour envoyer des messages WhatsApp sur l'API officielle de Meta. R\u00e9serv\u00e9e aux plans Pro et Agence. Authentification par token Bearer."},"servers":[{"url":"https:\/\/wazibot.com\/api\/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Token \u00e9mis depuis votre tableau de bord (page API)."}}},"paths":{"\/send\/text":{"post":{"summary":"Envoyer un message texte","description":"Texte libre \u2014 n\u00e9cessite une fen\u00eatre de 24h ouverte (le contact vous a \u00e9crit r\u00e9cemment). Sinon 422.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["to","body"],"properties":{"to":{"type":"string","example":"221771234567","description":"Num\u00e9ro du destinataire (format international, sans +)"},"body":{"type":"string","maxLength":4096,"example":"Bonjour, votre commande est pr\u00eate."}}}}}},"responses":{"201":{"description":"Message accept\u00e9","content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"wamid.XXXX"},"to":{"type":"string","example":"+221771234567"},"status":{"type":"string","example":"sent"}}}}}},"422":{"description":"Fen\u00eatre de 24h ferm\u00e9e \u2014 utilisez \/send\/template","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"window_closed"},"message":{"type":"string"}}}}}},"429":{"description":"Limite d'envoi atteinte (quota\/horaire)"},"401":{"description":"Token manquant, invalide ou r\u00e9voqu\u00e9"},"403":{"description":"Plan sans acc\u00e8s API (r\u00e9serv\u00e9 Pro\/Agence)"}}}},"\/send\/template":{"post":{"summary":"Envoyer un template approuv\u00e9","description":"Autoris\u00e9 hors fen\u00eatre 24h. Le template doit \u00eatre approuv\u00e9 par Meta.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["to","template"],"properties":{"to":{"type":"string","example":"221771234567","description":"Num\u00e9ro du destinataire (format international, sans +)"},"template":{"type":"string","example":"confirmation_commande"},"language":{"type":"string","example":"fr","default":"fr"},"components":{"type":"array","items":{"type":"object"},"description":"Composants Meta (body\/header\/buttons) avec param\u00e8tres"}}}}}},"responses":{"201":{"description":"Message accept\u00e9","content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"wamid.XXXX"},"to":{"type":"string","example":"+221771234567"},"status":{"type":"string","example":"sent"}}}}}},"422":{"description":"Fen\u00eatre de 24h ferm\u00e9e \u2014 utilisez \/send\/template","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"window_closed"},"message":{"type":"string"}}}}}},"429":{"description":"Limite d'envoi atteinte (quota\/horaire)"},"401":{"description":"Token manquant, invalide ou r\u00e9voqu\u00e9"},"403":{"description":"Plan sans acc\u00e8s API (r\u00e9serv\u00e9 Pro\/Agence)"}}}},"\/send\/image":{"post":{"summary":"Envoyer une image","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["to","link"],"properties":{"to":{"type":"string","example":"221771234567","description":"Num\u00e9ro du destinataire (format international, sans +)"},"link":{"type":"string","format":"uri","example":"https:\/\/exemple.com\/image.jpg"},"caption":{"type":"string"}}}}}},"responses":{"201":{"description":"Message accept\u00e9","content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"wamid.XXXX"},"to":{"type":"string","example":"+221771234567"},"status":{"type":"string","example":"sent"}}}}}},"422":{"description":"Fen\u00eatre de 24h ferm\u00e9e \u2014 utilisez \/send\/template","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"window_closed"},"message":{"type":"string"}}}}}},"429":{"description":"Limite d'envoi atteinte (quota\/horaire)"},"401":{"description":"Token manquant, invalide ou r\u00e9voqu\u00e9"},"403":{"description":"Plan sans acc\u00e8s API (r\u00e9serv\u00e9 Pro\/Agence)"}}}},"\/send\/document":{"post":{"summary":"Envoyer un document","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["to","link"],"properties":{"to":{"type":"string","example":"221771234567","description":"Num\u00e9ro du destinataire (format international, sans +)"},"link":{"type":"string","format":"uri","example":"https:\/\/exemple.com\/facture.pdf"},"filename":{"type":"string","example":"facture.pdf"},"caption":{"type":"string"}}}}}},"responses":{"201":{"description":"Message accept\u00e9","content":{"application\/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"wamid.XXXX"},"to":{"type":"string","example":"+221771234567"},"status":{"type":"string","example":"sent"}}}}}},"422":{"description":"Fen\u00eatre de 24h ferm\u00e9e \u2014 utilisez \/send\/template","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"window_closed"},"message":{"type":"string"}}}}}},"429":{"description":"Limite d'envoi atteinte (quota\/horaire)"},"401":{"description":"Token manquant, invalide ou r\u00e9voqu\u00e9"},"403":{"description":"Plan sans acc\u00e8s API (r\u00e9serv\u00e9 Pro\/Agence)"}}}},"\/otp\/send":{"post":{"summary":"Envoyer un code de v\u00e9rification (OTP)","description":"Envoie un code de v\u00e9rification par WhatsApp depuis le num\u00e9ro du tenant, via un template d'authentification approuv\u00e9 par Meta.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["to"],"properties":{"to":{"type":"string","example":"221771234567","description":"Num\u00e9ro du destinataire (format international, sans +)"},"template":{"type":"string","example":"otp_verification","default":"otp_verification","description":"Nom du template d'authentification approuv\u00e9"},"language":{"type":"string","example":"fr","default":"fr"}}}}}},"responses":{"201":{"description":"Code envoy\u00e9","content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"string","example":"+221771234567"},"status":{"type":"string","example":"sent"},"expires_in":{"type":"integer","example":300,"description":"Dur\u00e9e de validit\u00e9 du code, en secondes"}}}}}},"422":{"description":"Template introuvable ou non approuv\u00e9","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"template_not_found"},"message":{"type":"string"}}}}}},"429":{"description":"Limite d'envoi OTP atteinte","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"otp_rate_limited"},"message":{"type":"string"}}}}}},"502":{"description":"Erreur de l'API WhatsApp","content":{"application\/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"whatsapp_api_error"},"message":{"type":"string"}}}}}},"401":{"description":"Token manquant, invalide ou r\u00e9voqu\u00e9"},"403":{"description":"Plan sans acc\u00e8s API (r\u00e9serv\u00e9 Pro\/Agence)"}}}},"\/otp\/verify":{"post":{"summary":"V\u00e9rifier un code OTP","description":"Valide le code de v\u00e9rification pr\u00e9c\u00e9demment envoy\u00e9 via \/otp\/send.","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["to","code"],"properties":{"to":{"type":"string","example":"221771234567","description":"Num\u00e9ro du destinataire (format international, sans +)"},"code":{"type":"string","example":"123456"}}}}}},"responses":{"200":{"description":"Code valide","content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"string","example":"+221771234567"},"verified":{"type":"boolean","example":true}}}}}},"422":{"description":"Code invalide ou expir\u00e9","content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"string","example":"+221771234567"},"verified":{"type":"boolean","example":false},"error":{"type":"string","example":"invalid_or_expired"}}}}}},"429":{"description":"Trop de tentatives","content":{"application\/json":{"schema":{"type":"object","properties":{"to":{"type":"string","example":"+221771234567"},"verified":{"type":"boolean","example":false},"error":{"type":"string","example":"too_many_attempts"}}}}}},"401":{"description":"Token manquant, invalide ou r\u00e9voqu\u00e9"},"403":{"description":"Plan sans acc\u00e8s API (r\u00e9serv\u00e9 Pro\/Agence)"}}}},"\/status":{"get":{"summary":"\u00c9tat du num\u00e9ro","responses":{"200":{"description":"Statut","content":{"application\/json":{"schema":{"type":"object","properties":{"number":{"type":"string"},"status":{"type":"string","example":"connected"},"quality_rating":{"type":"string","example":"green"},"messaging_tier":{"type":"string","example":"TIER_1K"},"plan":{"type":"string","example":"Pro"}}}}}}}}},"\/webhook":{"post":{"summary":"Configurer l'URL de r\u00e9ception","description":"Les messages entrants du num\u00e9ro sont relay\u00e9s \u00e0 cette URL, sign\u00e9s HMAC SHA-256 avec le secret (en-t\u00eate X-WaziBot-Signature).","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","example":"https:\/\/votre-site.com\/webhook"},"secret":{"type":"string","description":"Secret de signature HMAC (facultatif)"}}}}}},"responses":{"200":{"description":"Webhook configur\u00e9"}}}}}}