{"openapi":"3.1.0","info":{"title":"MacLustr SMS Gateway","version":"1.1.1","description":"API privée d'envoi et de réception de SMS par un téléphone Android dédié. Chaque application dispose de sa clé et de ses scopes. Les statuts distinguent explicitement « remis au réseau » (`submitted`) de « livré » (`delivered`) ; `unknown` signale une issue ambiguë qui n'est jamais renvoyée automatiquement."},"servers":[{"url":"https://sms.spboucher.ai"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Clé API `mlsk_…` (Authorization: Bearer)."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}},"MessageStatus":{"type":"string","enum":["held","queued","dispatched","accepted","submitting","submitted","delivered","failed","expired","cancelled","unknown","received"]},"SendRequest":{"type":"object","required":["to","text"],"additionalProperties":false,"properties":{"to":{"type":"string","description":"Destinataire, E.164 (ex. +14185550123)."},"text":{"type":"string","maxLength":2000,"description":"10 segments SMS au maximum."},"device_id":{"type":["string","null"]},"sim_id":{"type":["string","null"]},"from":{"type":["string","null"],"description":"Numéro expéditeur souhaité (doit correspondre à une SIM)."},"ttl_seconds":{"type":["integer","null"],"minimum":60,"maximum":86400,"description":"Durée de validité avant expiration si l'appareil est indisponible (défaut 3600)."},"delivery_report":{"type":["boolean","null"],"default":true}}},"Message":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string","enum":["outbound","inbound"]},"status":{"$ref":"#/components/schemas/MessageStatus"},"to":{"type":["string","null"]},"from":{"type":["string","null"]},"text":{"type":["string","null"]},"text_purged":{"type":"boolean"},"device_id":{"type":["string","null"]},"sim_id":{"type":["string","null"]},"application_id":{"type":["string","null"]},"conversation_id":{"type":["string","null"]},"encoding":{"type":"string","enum":["gsm7","ucs2"]},"segments":{"type":"integer"},"characters":{"type":"integer"},"error":{"type":["object","null"],"properties":{"code":{"type":"string"},"detail":{"type":["string","null"]}}},"created_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"dispatched_at":{"type":["string","null"],"format":"date-time"},"accepted_at":{"type":["string","null"],"format":"date-time"},"submitted_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"finalized_at":{"type":["string","null"],"format":"date-time"},"received_at":{"type":["string","null"],"format":"date-time"}}},"MessageEvent":{"type":"object","properties":{"type":{"type":"string"},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"source":{"type":"string"},"detail":{"type":"object"},"at":{"type":["string","null"],"format":"date-time"}}},"Conversation":{"type":"object","properties":{"id":{"type":"string"},"sim_id":{"type":"string"},"device_id":{"type":"string"},"number":{"type":["string","null"]},"peer":{"type":"string"},"last_message_at":{"type":["string","null"],"format":"date-time"},"last_direction":{"type":"string"},"inbound_count":{"type":"integer"},"outbound_count":{"type":"integer"},"unread":{"type":"integer"}}},"Sim":{"type":"object","properties":{"id":{"type":"string"},"device_id":{"type":"string"},"subscription_id":{"type":"integer"},"slot_index":{"type":["integer","null"]},"carrier_name":{"type":"string"},"display_name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["physical","esim","unknown"]},"number":{"type":["string","null"]},"number_source":{"type":["string","null"],"enum":["manual","reported",null]},"state":{"type":"string"},"signal_level":{"type":["integer","null"]},"roaming":{"type":["boolean","null"]},"active":{"type":"boolean"},"send_enabled":{"type":"boolean"},"daily_limit":{"type":"integer"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Device":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"manufacturer":{"type":"string"},"model":{"type":"string"},"android_version":{"type":"string"},"app_version":{"type":"string"},"app_build":{"type":["integer","null"]},"revoked":{"type":"boolean"},"battery_temp_c":{"type":["number","null"]},"min_send_interval_ms":{"type":"integer"},"created_at":{"type":["string","null"],"format":"date-time"},"online":{"type":"boolean"},"enabled":{"type":"boolean"},"maintenance":{"type":"boolean"},"available":{"type":"boolean"},"last_seen_at":{"type":["string","null"],"format":"date-time"},"battery_pct":{"type":["integer","null"]},"charging":{"type":["boolean","null"]},"network":{"type":["string","null"]},"gateway_state":{"type":["string","null"]},"sims":{"type":"array","items":{"$ref":"#/components/schemas/Sim"}}}},"Number":{"type":"object","properties":{"number":{"type":"string"},"sim_id":{"type":"string"},"device_id":{"type":"string"},"carrier_name":{"type":"string"},"source":{"type":"string"},"label":{"type":"string"},"send_enabled":{"type":"boolean"},"active":{"type":"boolean"}}},"WebhookEventName":{"type":"string","enum":["sms.received","sms.submitted","sms.delivered","sms.failed","sms.unknown","device.online","device.offline","sim.unavailable"]},"WebhookRequest":{"type":"object","required":["url","events"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","description":"HTTPS, adresse publique."},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventName"},"minItems":1},"description":{"type":"string"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventName"}},"enabled":{"type":"boolean"},"failure_streak":{"type":"integer"},"created_at":{"type":["string","null"],"format":"date-time"},"secret":{"type":"string","description":"Secret de signature HMAC-SHA256 — présent uniquement dans la réponse de création."}}},"Queue":{"type":"object","properties":{"pending":{"type":"integer"},"in_flight":{"type":"integer"},"held":{"type":"integer"},"oldest_pending_at":{"type":["string","null"],"format":"date-time"},"items":{"type":"array","items":{"type":"object"}}}},"Usage":{"type":"object","properties":{"application_id":{"type":"string"},"quota":{"type":"object","properties":{"daily":{"type":"integer"},"used_today":{"type":"integer"},"rate_per_minute":{"type":"integer"}}},"from":{"type":"string"},"to":{"type":"string"},"totals":{"type":"object","additionalProperties":{"type":"integer"}},"days":{"type":"array","items":{"type":"object"}}}},"VerificationRequest":{"type":"object","required":["to"],"additionalProperties":false,"properties":{"to":{"type":"string"},"locale":{"type":["string","null"],"enum":["fr","en",null],"default":"fr"},"brand":{"type":["string","null"],"maxLength":30,"description":"Nom affiché dans le SMS (défaut : nom de l'application)."},"ttl_seconds":{"type":["integer","null"],"minimum":120,"maximum":900,"default":600},"code_length":{"type":["integer","null"],"minimum":6,"maximum":8,"default":6},"sim_id":{"type":["string","null"]},"from":{"type":["string","null"]}}},"Verification":{"type":"object","properties":{"id":{"type":"string"},"to":{"type":"string"},"status":{"type":"string","enum":["pending","approved","failed","expired","cancelled"]},"attempts":{"type":"integer"},"attempts_remaining":{"type":"integer"},"created_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"approved_at":{"type":["string","null"],"format":"date-time"},"message_id":{"type":["string","null"]},"message_status":{"type":["string","null"]},"valid":{"type":"boolean","description":"Présent dans la réponse de /check : true une seule fois, quand le code est correct."}}},"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded"]},"version":{"type":"string"},"time":{"type":"string","format":"date-time"}}}}},"paths":{"/v1/messages":{"post":{"summary":"Envoyer un SMS","security":[{"bearer":[]}],"x-required-scope":"messages:send","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":128},"description":"Recommandé. Une même clé avec le même corps renvoie le message déjà créé (200, en-tête `Idempotent-Replayed: true`) sans second envoi."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}}},"responses":{"200":{"description":"Rejeu idempotent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"201":{"description":"Message créé (`queued`, ou `held` si l'application exige une approbation humaine)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Requête invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`idempotency_conflict`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`invalid_phone_number`, `recipient_opted_out`, `text_too_long`, `sender_required`, `sim_disabled`…","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}},"503":{"description":"`kill_switch_active`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Historique des messages envoyés par l'application","security":[{"bearer":[]}],"x-required-scope":"messages:read","parameters":[{"name":"status","in":"query","schema":{"type":"string"},"description":"Un ou plusieurs statuts séparés par des virgules."},{"name":"to","in":"query","schema":{"type":"string"}},{"name":"device_id","in":"query","schema":{"type":"string"}},{"name":"sim_id","in":"query","schema":{"type":"string"}},{"name":"created_after","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"created_before","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Valeur `next_cursor` de la page précédente."}],"responses":{"200":{"description":"Page de messages","content":{"application/json":{"schema":{"type":"object","required":["data","has_more"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/messages/{id}":{"get":{"summary":"Statut d'un message envoyé, ou lecture d'un SMS reçu (scope inbox:read)","security":[{"bearer":[]}],"x-required-scope":"messages:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Message et journal de ses transitions","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Message"},{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/MessageEvent"}}}}]}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/messages/{id}/cancel":{"post":{"summary":"Annuler un message non transmis","security":[{"bearer":[]}],"x-required-scope":"messages:cancel","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Message annulé","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`not_cancellable` : déjà transmis à l'appareil","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/inbox":{"get":{"summary":"SMS reçus","security":[{"bearer":[]}],"x-required-scope":"inbox:read","parameters":[{"name":"from","in":"query","schema":{"type":"string"}},{"name":"sim_id","in":"query","schema":{"type":"string"}},{"name":"created_after","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Valeur `next_cursor` de la page précédente."}],"responses":{"200":{"description":"Page de SMS reçus","content":{"application/json":{"schema":{"type":"object","required":["data","has_more"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/conversations":{"get":{"summary":"Conversations","security":[{"bearer":[]}],"x-required-scope":"inbox:read","parameters":[{"name":"sim_id","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Valeur `next_cursor` de la page précédente."}],"responses":{"200":{"description":"Page de conversations","content":{"application/json":{"schema":{"type":"object","required":["data","has_more"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Conversation"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/conversations/{id}/messages":{"get":{"summary":"Messages d'une conversation","security":[{"bearer":[]}],"x-required-scope":"inbox:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Valeur `next_cursor` de la page précédente."}],"responses":{"200":{"description":"Page de messages","content":{"application/json":{"schema":{"type":"object","required":["data","has_more"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/devices":{"get":{"summary":"Appareils Android","security":[{"bearer":[]}],"x-required-scope":"devices:read","responses":{"200":{"description":"Appareils","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}}}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/devices/{id}":{"get":{"summary":"État d'un appareil","security":[{"bearer":[]}],"x-required-scope":"devices:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Appareil","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/devices/{id}/sims":{"get":{"summary":"SIM d'un appareil","security":[{"bearer":[]}],"x-required-scope":"devices:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"SIM","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Sim"}}}}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/numbers":{"get":{"summary":"Numéros configurés","security":[{"bearer":[]}],"x-required-scope":"numbers:read","responses":{"200":{"description":"Numéros","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Number"}}}}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/webhooks":{"post":{"summary":"Configurer un webhook","security":[{"bearer":[]}],"x-required-scope":"webhooks:manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRequest"}}}},"responses":{"201":{"description":"Webhook créé (le secret n'est renvoyé qu'ici)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"URL ou événements invalides","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}},"get":{"summary":"Lister les webhooks de l'application","security":[{"bearer":[]}],"x-required-scope":"webhooks:manage","responses":{"200":{"description":"Webhooks","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/webhooks/{id}":{"delete":{"summary":"Supprimer un webhook","security":[{"bearer":[]}],"x-required-scope":"webhooks:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Supprimé"},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/verifications":{"post":{"summary":"Envoyer un code de vérification par SMS","security":[{"bearer":[]}],"x-required-scope":"verify:manage","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":128},"description":"Recommandé : rejouer la requête renvoie la même vérification (200) sans second SMS."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationRequest"}}}},"responses":{"201":{"description":"Code envoyé (le code n'est jamais renvoyé par l'API)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Numéro invalide, désinscrit…","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/verifications/{id}/check":{"post":{"summary":"Vérifier le code saisi par l'utilisateur","security":[{"bearer":[]}],"x-required-scope":"verify:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}}}},"responses":{"200":{"description":"`valid: true` une seule fois ; 5 essais au plus","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/verifications/{id}":{"get":{"summary":"État d'une vérification","security":[{"bearer":[]}],"x-required-scope":"verify:manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Vérification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Introuvable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/usage":{"get":{"summary":"Consommation","security":[{"bearer":[]}],"x-required-scope":"usage:read","parameters":[{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Compteurs par jour et quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/queue":{"get":{"summary":"File d'attente de l'application","security":[{"bearer":[]}],"x-required-scope":"queue:read","responses":{"200":{"description":"File","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Queue"}}}},"401":{"description":"Clé API absente ou invalide","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Scope insuffisant ou opération refusée","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Limite de débit ou quota atteint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Secondes à attendre avant de réessayer."}}}}}},"/v1/health":{"get":{"summary":"Santé du service","security":[],"responses":{"200":{"description":"État","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}}}}