API Guide
Yexa Pro API Docs
API for WhatsApp OTP verification and sending text messages — nothing more.
Overview
Yexa Pro API offers two capabilities: send and verify WhatsApp OTP (no token required), and send text messages from your account (Bearer token required).
1Create a Yexa Pro account and connect your WhatsApp number in the dashboard
2For OTP: call /otp/send then /otp/verify — no token needed
3For messages: log in to obtain a Bearer token
4Send a text message via POST /conversations/{id}/messages
Authentication
Required only for sending messages. OTP endpoints are public and need no token.
Required Header
Authorization: Bearer {your_api_token}
Content-Type: application/jsonObtain your token by logging in with your Yexa Pro account:
cURL example
curl -X POST https://api.yexa.pro/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@yexa.pro","password":"your_password"}'WhatsApp OTP
Public — No tokenSend a 6-digit verification code via WhatsApp, then verify it. No Bearer token required — only a phone number in E.164 or local format (e.g. 0501234567).
OTP setup
1No API token needed — endpoints are public
2Uses the yexa_otp template approved by Meta (managed by the platform)
3Code validity: 10 minutes · Resend cooldown: 60 seconds
Verification flow
1Send phone → POST /auth/whatsapp/otp/send
↓
2User receives 6-digit code on WhatsApp
↓
3Verify code → POST /auth/whatsapp/otp/verify
Send OTP example
curl -X POST https://api.yexa.pro/api/auth/whatsapp/otp/send \
-H "Content-Type: application/json" \
-d '{"phone":"966501234567"}'Verify OTP example
curl -X POST https://api.yexa.pro/api/auth/whatsapp/otp/verify \
-H "Content-Type: application/json" \
-d '{"phone":"966501234567","code":"042891"}'Send Messages
Requires a Bearer token. The conversation ID is available in your dashboard.
Send text message example
curl -X POST https://api.yexa.pro/api/conversations/1/messages \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type":"text","content":"مرحباً! سنساعدك الآن."}'