> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypersender.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OTP API Introduction

> Send and validate one-time passcodes over WhatsApp and SMS with the Hypersender OTP API, plus passwordless WhatsApp OTP links.

Send one-time passwords (OTPs) and magic links to your users via WhatsApp or SMS. Simple as that.

## Quick Demo

> [!TIP]
>
> **Learn how to use Hypersender OTP API with Postman:** [Send OTP Guide](https://docs.hypersender.com/v2/api-reference/otp/how-to-send-an-otp-in-postman.md) | [Generate OTP Link Guide](https://docs.hypersender.com/v2/api-reference/otp/how-to-generate-a-whatsapp-otp-link-in-postman.md)

## How It Works

**1. Request Code**

Generate a verification code and send it to your user via **WhatsApp or SMS**.

You can customize the code length, character type (numbers, letters, or both), and expiration time. Works with WhatsApp chat IDs and phone numbers for SMS.

**2. Validate Code**

When your user enters the code, hit this endpoint to check if it's correct.

Works for both **WhatsApp and SMS**. We handle expiration checks and make sure each code only works once.

**3. Generate Link (WhatsApp only)**

Create a WhatsApp link with a prefilled verification message. Your backend receives the link and delivers it to the user; handle configured success or failure callbacks in your application.

> [!NOTE]
>
> This endpoint is **WhatsApp only**. The API reference does not define callback payload fields or a redirect parameter.

## Quick Setup

**Base URL:**

```
https://app.hypersender.com/api/otp/v2
```

**Auth:** Bearer token in the header

```bash theme={null}
Authorization: Bearer YOUR_API_TOKEN
```

**Endpoints:**

```
/{instance}/request-code
/{instance}/validate-code
/{instance}/generate-link
```

## Endpoints

> [card] [Request Code](https://docs.hypersender.com/v2/api-reference/otp/otp-service/request-otp-code.md)
>
> Send a verification code

> [card] [Validate Code](https://docs.hypersender.com/v2/api-reference/otp/otp-service/validate-otp-code.md)
>
> Verify user's code

> [card] [Generate Link](https://docs.hypersender.com/v2/api-reference/otp/otp-service/generate-a-whatsapp-otp-link.md)
>
> Send a magic link

For a complete server-side request, response, and integration flow, see [Generate WhatsApp OTP Link](https://docs.hypersender.com/v2/api-reference/otp/otp-service/generate-a-whatsapp-otp-link.md). Laravel users can follow the [Laravel SDK guide](https://docs.hypersender.com/v2/packages-and-sdks/laravel/otp/generate-whatsapp-otp-link-with-laravel.md) or [install the SDK](https://docs.hypersender.com/v2/packages-and-sdks/laravel/installation.md).

## Good to Know

* Codes expire automatically (you set the TTL)
* Each code works only once
* Rate limiting is built-in
* Works with both WhatsApp chat IDs and phone numbers for SMS

> [!WARNING]
>
> Keep your API keys secret. Don't put them in client-side code.

## Postman Collection

> [card] Download OTP Collection
>
> Get the Postman collection to test the endpoints.

[Open](https://docs.hypersender.com/v2/api-reference/otp/otp-collection.json)

## Next Steps

1. Grab your API token and instance UUID from the dashboard
2. Try sending a code with [Request Code](https://docs.hypersender.com/v2/api-reference/otp/otp-service/request-otp-code.md)
3. Validate it with [Validate Code](https://docs.hypersender.com/v2/api-reference/otp/otp-service/validate-otp-code.md)

That's it. You're ready to go.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.