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
- Create an account at wa.1-eg.com
- Get your API key from the dashboard
- Connect your WhatsApp device via QR code
- 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
| Endpoint | Limit | Window |
|---|---|---|
| Send Message | 30 requests | Per minute |
| Send OTP | 10 requests | Per minute |
| Check Status | 60 requests | Per minute |
| Verify OTP | 30 requests | Per minute |
/message/send
Send a text message to a WhatsApp number.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
instance_id | string | No | The connected WhatsApp instance ID (auto-selects the first connected device if omitted) |
phone | string | Yes | Recipient phone number with country code (alias: number) |
message | string | Yes | Message text content |
type | string | No | Reserved: 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
}/otp/send
Send a one-time password (OTP) to a WhatsApp number for verification.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
instance_id | string | No | The connected WhatsApp instance ID (auto-selects the first connected device if omitted) |
phone | string | Yes | Recipient phone number (alias: number) |
code | string | No | Custom OTP code (auto-generated if omitted) |
expires_in | integer | No | Expiration time in seconds (default: 300, min: 60, max: 3600) |
Response
{
"status": "success",
"message": "OTP sent successfully",
"expires_in": 300
}/otp/verify
Verify a one-time password that was sent to the user.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
otp | string | Yes | The OTP code received by the user |
phone | string | Yes | The phone number the OTP was sent to (alias: number) |
Response
{
"status": "success",
"message": "OTP verified successfully"
}/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']));