AI agents: this site is available as Markdown at /llms.txt. Each page has a Markdown version at its URL with a .md suffix, and the full API is described in /api/v3/openapi.json.

OTP

Generate and validate One-Time Passwords (OTPs) using Flutterwave’s APIs.

Last updated 13 September 2026

Introduction

With Flutterwave's API, you can generate OTPs for authenticating customers within your application. We support three delivery channels:

  1. Email
  2. WhatsApp
  3. SMS (Short Message Service).

Prices can be found below:

ChannelPrice
EmailNGN 1
SMSNGN 4
WhatsappNGN 15
Wallet Funding

You need to have funds in your NGN balance to use this feature. If you don't, you can fund your NGN balance using any of your other currencies. Learn more about wallet funding here.

Creating an OTP

Creating an OTP requires you to send a well-formatted request to our create-otp endpoint. Your request payload should contain the following parameters:

  1. length: The length of the OTP string to be generated.
  2. customer: Your Customer's information like their name, email and phone number.
  3. sender: The name of the sender.
  4. medium: Supported delivery channels for the OTP i.e. via email, SMS or WhatsApp.
  5. expiry: The expiry time of the OTP in minutes.

Sample Request

Javascript

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
curl --location 'https://api.flutterwave.com/v3/otps' \
--header 'Authorization: Bearer FLWSECK_TEST-SANDBOXDEMOKEY-X' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
   "length":4,
   "customer":{
      "name":"Test User",
      "email":"[email protected]",
      "phone":"2347123456789"
   },
   "sender":"Example Inc",
   "send":true,
   "medium":[
      "email",
      "sms",
      "whatsapp"
   ],
   "expiry":1
}'

Validating an OTP string

After you generate an OTP string for your user, you need to validate it in your application. This validation helps you confirm the user's identity and access to the mobile number or email provided to you.

Before you validate your OTP, first retrieve the reference (data.reference) returned in the OTP creation response. Pass this reference as a path variable in the validate endpoint and send your OTP as the request body.

Curl

Javascript

1
2
3
4
5
6
7
curl --location 'https://api.flutterwave.com/v3/otps/:reference/validate' \
--header 'Authorization: Bearer FLWSECK_TEST-SANDBOXDEMOKEY-X' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
    "otp":123456
}'


FL.AI

Answers from the Flutterwave docs

Hi, I’m FL.AI

Ask anything about Flutterwave’s APIs, guides and coverage.

FL.AI can make mistakes. Check important details in the docs.

2026 © Flutterwave

SupportStatus
Get API Keys