API Documentation

Welcome to the EG WhatsApp API. This documentation will help you integrate WhatsApp messaging into your applications using our RESTful API.

Quick Start

  1. Create an account at wa.1-eg.com
  2. Get your API key from the dashboard
  3. Connect your WhatsApp device via QR code
  4. Start sending messages via the API

Authentication

Authenticated endpoints (/message/send, /otp/send, /otp/verify, /status/{instance_id}) require your API key, sent either as Authorization: Bearer YOUR_API_KEY, the X-API-Key header, or the api_key field. Your key starts with wa_. The webhook endpoint does not require a key.

Authorization: Bearer YOUR_API_KEY

Example: Authorization: Bearer wa_4fK9dQ2mX7pR3tB8cN5vL1hJ9sA6wZ0eY4xU2oG...

Base URL

https://wa.1-eg.com/api/v1

Rate Limits

EndpointLimitWindow
Send Message30 requestsPer minute
Send OTP10 requestsPer minute
Check Status60 requestsPer minute
Verify OTP30 requestsPer minute
POST

/message/send

Send a text message to a WhatsApp number.

Request Body

ParameterTypeRequiredDescription
instance_idstringNoThe connected WhatsApp instance ID (auto-selects the first connected device if omitted)
phonestringYesRecipient phone number with country code (alias: number)
messagestringYesMessage text content
typestringNoReserved: only text messages are currently supported

Example Request

POST https://wa.1-eg.com/api/v1/message/send
Authorization: Bearer wa_4fK9dQ2mX7pR3tB8cN5vL1hJ9sA6wZ0eY4xU2oG...
Content-Type: application/json

{
  "instance_id": "user_2_wa_60b8a91c",
  "phone": "+201012345678",
  "message": "Hello! This is a test message.",
  "type": "text"
}

Response

{
  "status": "success",
  "message": "Message sent successfully",
  "credits_remaining": 995
}
POST

/otp/send

Send a one-time password (OTP) to a WhatsApp number for verification.

Request Body

ParameterTypeRequiredDescription
instance_idstringNoThe connected WhatsApp instance ID (auto-selects the first connected device if omitted)
phonestringYesRecipient phone number (alias: number)
codestringNoCustom OTP code (auto-generated if omitted)
expires_inintegerNoExpiration time in seconds (default: 300, min: 60, max: 3600)

Response

{
  "status": "success",
  "message": "OTP sent successfully",
  "expires_in": 300
}
POST

/otp/verify

Verify a one-time password that was sent to the user.

Request Body

ParameterTypeRequiredDescription
otpstringYesThe OTP code received by the user
phonestringYesThe phone number the OTP was sent to (alias: number)

Response

{
  "status": "success",
  "message": "OTP verified successfully"
}
GET

/status/{instance_id}

Check the connection status of one of your WhatsApp instances. Requires your API key (like other endpoints); replace {instance_id} with your instance ID. If disconnected, the response is {"connected": false, "qr": "<base64 qr code>"}.

Response

{
  "connected": true
}

Code Examples

cURL

curl -X POST https://wa.1-eg.com/api/v1/message/send \
  -H "Authorization: Bearer wa_4fK9dQ2mX7pR3tB8cN5vL1hJ9sA6wZ0eY4xU2oG..." \
  -H "Content-Type: application/json" \
  -d '{"instance_id":"user_2_wa_60b8a91c","phone":"+201012345678","message":"Hello!","type":"text"}'

Node.js

const response = await axios.post('https://wa.1-eg.com/api/v1/message/send', {
  instance_id: 'user_2_wa_60b8a91c', phone: '+201012345678', message: 'Hello!', type: 'text'
}, { headers: { 'Authorization': 'Bearer wa_4fK9dQ2mX7pR3tB8cN5vL1hJ9sA6wZ0eY4xU2oG...' } });

Python

response = requests.post('https://wa.1-eg.com/api/v1/message/send',
    json={'instance_id': 'user_2_wa_60b8a91c', 'phone': '+201012345678', 'message': 'Hello!', 'type': 'text'},
    headers={'Authorization': 'Bearer wa_4fK9dQ2mX7pR3tB8cN5vL1hJ9sA6wZ0eY4xU2oG...'})

PHP

$ch = curl_init('https://wa.1-eg.com/api/v1/message/send');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer wa_4fK9dQ2mX7pR3tB8cN5vL1hJ9sA6wZ0eY4xU2oG...', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['instance_id'=>'user_2_wa_60b8a91c','phone'=>'+201012345678','message'=>'Hello!','type'=>'text']));

توثيق API

مرحباً بكم في واجهة برمجة تطبيقات EG WhatsApp. سيساعدك هذا التوثيق على دمج رسائل واتساب في تطبيقاتك.

البدء السريع

  1. أنشئ حساباً على wa.1-eg.com
  2. احصل على مفتاح API من لوحة التحكم
  3. اجهز جهاز واتساب عبر رمز QR
  4. ابدأ بإرسال الرسائل عبر الـ API

المصادقة

نقاط النهاية الموثّقة (/message/send، /otp/send، /otp/verify، /status/{instance_id}) تتطلب مفتاح API، يُرسل إما كرأس Authorization: Bearer YOUR_API_KEY أو هيدر X-API-Key أو في جسم الطلب api_key. مفتاحك يبدأ بـ wa_. نقطة webhook فقط لا تتطلب مفتاحاً.

Authorization: Bearer YOUR_API_KEY

مثال: Authorization: Bearer wa_4fK9dQ2mX7pR3tB8cN5vL1hJ9sA6wZ0eY4xU2oG...

الرابط الأساسي

https://wa.1-eg.com/api/v1

حدود الطلبات

نقطة النهايةالحدالنافذة
إرسال رسالة30 طلبلكل دقيقة
إرسال OTP10 طلباتلكل دقيقة
فحص الحالة60 طلبلكل دقيقة
التحقق من OTP30 طلبلكل دقيقة

/message/send

POST

إرسال رسالة نصية إلى رقم واتساب.

جسم الطلب

المعاملالنوعمطلوبالوصف
instance_idstringلامعرف جهاز واتساب المتصل (يُختار أول جهاز متصل تلقائياً عند حذفه)
phonestringنعمرقم هاتف المستلم مع رمز الدولة (الاسم البديل: number)
messagestringنعممحتوى الرسالة النصية
typestringلامحجوز: تُرسل الرسائل نصية فقط حالياً

طلب نموذجي

POST https://wa.1-eg.com/api/v1/message/send
Authorization: Bearer wa_4fK9dQ2mX7pR3tB8cN5vL1hJ9sA6wZ0eY4xU2oG...
{
  "instance_id": "user_2_wa_60b8a91c",
  "phone": "+201012345678",
  "message": "مرحباً! هذه رسالة تجريبية.",
  "type": "text"
}

الاستجابة

{
  "status": "success",
  "message": "Message sent successfully",
  "credits_remaining": 995
}

/otp/send

POST

إرسال كلمة مرور لمرة واحدة (OTP) إلى رقم واتساب للتحقق.

طلب نموذجي

POST https://wa.1-eg.com/api/v1/otp/send
{
  "instance_id": "user_2_wa_60b8a91c",
  "phone": "+201012345678"
}

الاستجابة

{
  "status": "success",
  "message": "OTP sent successfully",
  "expires_in": 300
}

/otp/verify

POST

التحقق من كلمة المرور لمرة واحدة.

طلب نموذجي

POST https://wa.1-eg.com/api/v1/otp/verify
{
  "otp": "482913",
  "phone": "+201012345678"
}

الاستجابة

{
  "status": "success",
  "message": "OTP verified successfully"
}