---
title: "Send WhatsApp OTP V2"
method: POST
path: "/v2/whatsapp/otp/send"
tags: ["WhatsApp OTP"]
---

# Send WhatsApp OTP V2

`POST /v2/whatsapp/otp/send`

## Request

- Base URL: `https://api.verihubs.com`
- URL: `https://api.verihubs.com/v2/whatsapp/otp/send`
- Auth: none declared. Required headers: `App-ID`, `API-Key`

This method helps you to generate and send Whatsapp message containing one-time password to destination number<br>

**API Update Notice:** This V2 endpoint is the recommended version, replacing the previous V1 endpoint. We recommend migrating to V2 immediately for a better experience.<br>

Benefits of V2:
- Decreased processing time for API requests and responses
- Improved features: Blocking Request, Spam Check, and Blocked Numbers
- Increased RPS (from 30 RPS to 50 RPS)
- Better developer environment to support future developments
- Improved logging and monitoring
- Improved dependencies and service stability<br>

A rate limit of 50 RPS is applied to WhatsApp services. Verihubs also applies rate limits divided into several categories based on product. For more details, see [Rate Limit](https://docs.verihubs.com/docs/rate-limit).

#### Callback Description
When you want to use callback_url payload you only need to put for example 
```
your-callback-url.com/callback
```
Example callback that we'll send
```
your-callback-url.com/callback?session_id=d0f5fb5c-2d50-4d3f-aea7-20018ab15806&status=1
```

Payload       | Description          |
-----------|:---------------------|
session_id    | ID of the specific message            | 
status        | Latest status of the request          |

#### Callback Status Description

Status       | Description          | Condition |
-----------|:---------------------|:-------------------------- |
0        | Requested       | OTP has been requested. This status will be charged. |
1        | Sent            | OTP has been sent to Whatsapp server. This status will be charged. |
2        | Delivered       | OTP has been delivered to destination number. This status will be charged. |
3        | Read            | OTP has been read by user. This status will be charged. |
4        | Verified        | OTP has been verified by user. This status will be charged. |
5        | Unverified      | OTP has reached time limit. This status will be charged. |
6        | Failed          | Whatsapp cannot send OTP to destination number. |
7        | Request Error   | Verihubs cannot reach WhatsApp |
8        | Rejected   | Request rejected due to Too Many Requests |
9        | Blocked   | Destination Number has been blocked by Verihubs's system |
10       | Tier Limit Exceeded   | Exceeding channel tier limit |

## Headers

- `App-ID` string, required
- `API-Key` string, required

## Request body

- SendWhatsappOtp
  - `msisdn` string, required: Destination Phone Number. You need to include international prefix number.
  - `otp` string: Optional. Code generated by client.
  - `challenge` string: This value is a category. You can verify OTP based on the same challenge.
  - `time_limit` string: Optional. Expiration time for verify OTP in seconds.
  - `lang_code` string, required: Language code to send in a different language. Use this optional payload to switch template easily if you have multiple language template with the same name. (need to be approved first by Facebook)
  - `template_name` string: Optional. Name of the template that will be use (need to be approved first by Facebook) If you're going to use a template with different language than your original template on the setting, you must include 'lang_code' payload too.
  - `otp_length` string: Optional. Length of the OTP, do not send alongside self generated OTP code payload (payload otp)
  - `callback_url` string: Optional. This URL will be called by the server when the desired event will occur.

## Response `201`

Successful Request

- ResponseSendWhatsappOTP
  - `message` string, required: Message
  - `otp` string, required: Code received by destination number
  - `msisdn` string, required: destination number with international prefix country code
  - `session_id` string, required: Generated ID which associated with verification request
  - `try_count` integer, required: Shows count of send OTP attempts to destination number in the span of 10 minutes

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `409`: Conflict
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/verihubs/apis/whatsapp-api-documentation.md) - [All operations](https://skmtc.dev/verihubs/apis/whatsapp-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/verihubs/apis/whatsapp-api-documentation/revisions/7c709c17b600?raw)
