OTP API for AI Agents
Everything your AI agent needs to send and verify OTPs — get up and running in minutes.
EngageLab OTP API lets your AI agent send and verify one-time passwords via a unified multi-channel API: SMS, WhatsApp, Email, and Voice. Programmatically, without any human interaction required.
Prerequisite: Create an API Key and Template
Two one-time setup steps are required before your agent can send OTPs — both must be completed by a human in the EngageLab console.
1. Create an API Key
Sign up for an EngageLab account and create an API key in the OTP console. This gives you a dev_key and dev_secret, which your agent uses to authenticate all API requests.
2. Create and approve a Template
Every OTP message is sent using a pre-approved template. Create a template in the console, configure your sending channels (SMS, WhatsApp, Email, or Voice), code length, and validity period. Templates go through a review process before they can be used. Once approved, pass the Template ID to your agent as a parameter.
Agent Skills — How do I install EngageLab OTP Agent Skills?
Agent Skills give Cursor, Claude Code, and Windsurf the knowledge to handle OTPs automatically: sending codes, verifying them, processing webhooks.
One command to install, then just ask your agent:
# Skill for sending OTPs
npx skills add https://github.com/DevEngageLab/engagelab-skills/tree/main/engagelab-otp/skills/engagelab-otp-send
# Skill for verifying OTPs
npx skills add https://github.com/DevEngageLab/engagelab-skills/tree/main/engagelab-otp/skills/engagelab-otp-verify
# Skill for configuring and handling webhooks/callbacks
npx skills add https://github.com/DevEngageLab/engagelab-skills/tree/main/engagelab-otp/skills/engagelab-otp-webhook
View more details on how to use EngageLab OTP skills with your AI agents: → Agent Skills
Docs for Agents — What formats can my agent read?
Give your agent direct access to the full API Reference. Each page covers a single endpoint with complete request parameters, response formats, and error codes — everything an agent needs to call the EngageLab OTP API without additional context:
Quick Start — Send and Verify Your First OTP
Copy the code examples below into Cursor or Claude Code to set up OTP integration automatically:
Node.js
const { OTPClient } = require('engagelab-otp');
const otp = new OTPClient(
process.env.ENGAGELAB_DEV_KEY,
process.env.ENGAGELAB_DEV_SECRET
);
// Platform-generated OTP — the simplest way
const { message_id } = await otp.send('+6591234567', 'your-template-id', {}, 'en');
const { verified } = await otp.verify(message_id, userTypedCode);
Python
import os
from engagelab_otp import OTPClient
otp = OTPClient(
os.environ["ENGAGELAB_DEV_KEY"],
os.environ["ENGAGELAB_DEV_SECRET"],
)
# Platform-generated OTP — the simplest way
result = otp.send("+6591234567", "your-template-id", {"name": "Alice"}, language="en")
check = otp.verify(result["message_id"], user_typed_code)
if check["verified"]:
print("Success!")
EngageLab provides two primary endpoints for OTP workflows:
| Action | Endpoint | Use Case |
|---|---|---|
| Send OTP | POST /v1/messages |
Generate and deliver a verification code to a user. |
| Verify OTP | POST /v1/verifications |
Verify the code submitted by the user. |
Steps your agent will follow
- Detect project language from config files (
package.json,requirements.txt, etc.) - Install SDK —
npm install engagelab-otporpip install engagelab-otp - Implement Authentication — HTTP Basic Auth using
base64(dev_key:dev_secret) - Implement Webhooks — For production, set up callback endpoints to track delivery status
For complete error codes, refer to the API Reference for each endpoint (e.g. Send OTP errors).
New to EngageLab OTP? Follow the step-by-step console setup guide to register, create a template, and get your API key before running the code above.
Official SDKs — Node.js & Python
EngageLab is a global OTP API provider offering official SDKs for Node.js and Python to help you integrate OTP delivery, verification, and webhook callbacks with zero dependencies.
View installation instructions and examples for Node.js and Python SDKs: → SDKs
FAQs
How does an AI agent send OTP without human interaction?
EngageLab OTP API is fully programmatic, your agent calls /v1/messages to send and /v1/verifications to verify.
No UI, no manual steps required.
What happens when an OTP expires and the agent retries?
Calling the send API again with the same recipient issues a new code and returns a new message_id. The expired code is automatically invalidated. → Send OTP errors · Verify OTP errors
How do I track OTP delivery and verification status in real time?
EngageLab OTP supports webhook callbacks — configure a callback URL in the console and the system will push event data to your endpoint when key events occur, such as message delivered, OTP verified, or low balance alerts. No polling required. → See Callback Configuration
How do I send OTP with Cursor or Windsurf?
EngageLab OTP Agent Skills give Cursor, Windsurf, and Claude Code the context they need to send and verify OTPs without leaving your editor. Install the skill with one command:
npx skills add https://github.com/DevEngageLab/engagelab-skills/tree/main/engagelab-otp/skills/engagelab-otp-send
Once installed, your agent can call the EngageLab OTP API (POST /v1/messages) to send a one-time password via SMS, WhatsApp, Email, or Voice — and verify it with POST /v1/verifications. No manual API setup required.










