Référence

OTP

Génération et vérification de codes à usage unique envoyés par WhatsApp. Personnalisez le libellé avec `brandName` (marque de votre app) ou le nom de votre organisation ReachFlow ; modèle par défaut : `Votre code de vérification {{brand}} : {{code}}`. Webhooks otp.sent / otp.verified configurables dans le dashboard.

Base URL : https://sandbox-api.reachflow.me/api/v1

POST/api/v1/otp/send

Envoyer un OTP

Génère un code et l’envoie au numéro indiqué. `brandName` surcharge le nom affiché ; sinon le nom de l’organisation du tenant est utilisé.

Scope requis : otp:send

Attributs requis

NomTypeDescription
providerId*string (uuid)Provider expéditeur.
phoneNumber*stringDestinataire.
codeLengthinteger4–8 chiffres (défaut 6).
expiresInintegerTTL en secondes (60–600, défaut 300).
brandNamestringNom affiché dans le message (64 car. max). Sinon nom de l’organisation ReachFlow.
templatestringModèle avec {{brand}} et {{code}} (optionnel).

Requête

curl --request POST \
  "https://sandbox-api.reachflow.me/api/v1/otp/send" \
  --header "X-API-Key: rfl_live_VOTRE_CLE" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json"
  --data '{ "providerId": "a3f1b2c4-1234-4abc-9def-000011112222", "phoneNumber": "22996123456", "brandName": "Mon App", "codeLength": 6, "expiresIn": 300 }'

Réponse

JSON
{
  "otpId": "c4d5e6f7-8901-42ab-cdef-333344445555",
  "messageId": "d5e6f7a8-9012-43ab-cdef-444455556666",
  "expiresAt": "2026-05-30T10:50:00.000Z"
}

Le code n’est jamais dans la réponse JSON.

Placeholders template : {{brand}}, {{code}}.

POST/api/v1/otp/verify

Vérifier un OTP

Valide le code saisi par l’utilisateur final.

Scope requis : otp:verify

Attributs requis

NomTypeDescription
otpId*string (uuid)ID retourné par /otp/send.
code*stringCode saisi (4–8 car.).

Requête

curl --request POST \
  "https://sandbox-api.reachflow.me/api/v1/otp/verify" \
  --header "X-API-Key: rfl_live_VOTRE_CLE" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json"
  --data '{ "otpId": "c4d5e6f7-8901-42ab-cdef-333344445555", "code": "482910" }'

Réponse

JSON
{
  "valid": true
}