Skip to main content
POST
Generate OTP link
Call this endpoint from your server to create a WhatsApp OTP link for passwordless login. Deliver the returned data.whatsapp_link to the user through your app, email, or SMS. When the user opens the link, WhatsApp opens with a prefilled verification message for them to send. Your application handles the result through the success or failure callbacks you configure. This is a WhatsApp-only flow. For a code that the user enters in your app, use Request OTP Code instead.
You need an active Hypersender account, an API token, and an instance UUID. Create an account, then see the OTP API overview for the other OTP flows.

Integration flow

  1. Your backend sends an authenticated request with the recipient’s WhatsApp chatId.
  2. The API returns a unique code, expiry, status, and whatsapp_link.
  3. Your application delivers data.whatsapp_link to the recipient.
  4. The recipient opens the link and sends the prefilled message in WhatsApp.
  5. Your application handles the configured success or failure callback and continues its own flow.
The API specification does not define a callback payload, signature, or redirect parameter. Do not grant access based only on a browser redirect or an undocumented callback field. Confirm callback behavior with your account and validate the event before completing a sensitive action.

Request

Send the request from your backend. Keep the bearer token out of browser code and public repositories. POST https://app.hypersender.com/api/otp/v2/{instance}/generate-link
chatId is the recipient’s WhatsApp chat ID. expires is the requested lifetime in seconds. name and message customize the verification messages. The callback URLs are optional; use publicly reachable HTTPS URLs.

Response

On success, the response includes the OTP request details. The generated link is at data.whatsapp_link:

PHP example

This example uses Laravel’s HTTP client. It checks the HTTP response and the documented response envelope before returning the generated WhatsApp link to the caller.
Store credentials in server-side environment variables and expose them through Laravel config. The example shows link generation only; connect its result to your own delivery channel and callback handling.

Errors and security

  • If the request fails, handle the HTTP error and do not deliver a link or treat the user as verified. The published API schema does not list endpoint-specific error codes or response bodies.
  • Use HTTPS callback URLs and keep the API token server-side.
  • Apply request limits in your application and avoid logging OTP codes or generated links.
  • The API specification does not document callback signing or a callback payload. Verify the callback contract for your account before using it to authorize access.

Next steps

OTP API overview

Compare the code and link flows.

Generate an OTP link with Laravel

Use the Hypersender Laravel SDK.

Laravel SDK installation

Install and configure the package.

Try it in Postman

Follow the interactive walkthrough.

Create your Hypersender account

Get an API token and instance UUID to generate your first OTP link.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

instance
string
required

Hypersender instance UUID

Body

application/json
chatId
string
required

WhatsApp chat ID of the recipient (e.g. [email protected])

expires
integer

TTL in seconds

name
string
message
object
callback
object

Response

200 - application/json

Link created

success
boolean
message
string
data
object
Last modified on November 7, 2026