> ## 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 with Laravel

> Send OTP codes and magic links via Hypersender using Laravel.

Use the Hypersender OTP service from Laravel to send verification codes or passwordless links over WhatsApp (and SMS for codes), then validate user submissions securely using the packaged SDK methods.

## What you can do

* **Request OTP codes**: Generate a one-time code and deliver it over WhatsApp.
* **Validate codes**: Check user-entered codes against the active OTP.
* **Generate magic links**: Create WhatsApp links that complete verification without typing.

## Prerequisites

* Laravel app with the Hypersender Laravel package installed ([Installation](/v2/packages-and-sdks/laravel/installation)).
* Hypersender **API token** and **Instance UUID** from the dashboard.
* Laravel HTTP client available (`Illuminate\\Support\\Facades\\Http`).

## Base URL and auth

```bash theme={null}
Base URL: https://app.hypersender.com/api/otp/v2
Auth: Authorization: Bearer YOUR_API_TOKEN
Instance: X-Instance-UUID: YOUR_INSTANCE_UUID
```

## Quick start (request and validate)

```php theme={null}
use Hypersender\Hypersender;

// 1) Send a code
$request = Hypersender::otp()->requestCode([
    'chatId' => '20123456789@c.us', // WhatsApp chat ID
    'length' => 6,
    'useLetter' => false,
    'useNumber' => true,
    'name' => 'YourApp',
    'expires' => 300,
]);

// 2) Validate it later
$validation = Hypersender::otp()->validateCode([
    'chatId' => $request['chat_id'] ?? '20123456789@c.us',
    'code' => $request['code'] ?? '123456',
]);
```

<Warning>
  Keep tokens and OTP codes out of logs. Use HTTPS for all calls.
</Warning>

## Next steps

* [Request OTP Code](/v2/packages-and-sdks/laravel/otp/request-code)
* [Validate OTP Code](/v2/packages-and-sdks/laravel/otp/validate-code)
* [Generate OTP Link](/v2/packages-and-sdks/laravel/otp/generate-link)
