Available Credits: 0

API Credentials

Use these credentials to authenticate your API requests

Important: Keep your API key secure. Never share it publicly or commit it to version control. Use environment variables to store sensitive credentials.

Quick Start Guide

1. Authentication

All API requests require authentication using your API key in the request header:

X-API-Key: your-api-key-here
2. Making Your First Request

Send a WhatsApp message using the simple send endpoint:

curl -X POST window.location.origin/api/sessions/send-simple \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -d '{
    "phoneNumber": "2348012345678",
    "message": "Hello from Wappi API!"
  }'
const axios = require('axios');

const API_ENDPOINT = 'window.location.origin';
const API_KEY = 'your-api-key';

async function sendWhatsAppMessage() {
  try {
    const response = await axios.post(
      `${API_ENDPOINT}/api/sessions/send-simple`,
      {
        phoneNumber: '2348012345678',
        message: 'Hello from Wappi API!'
      },
      {
        headers: {
          'Content-Type': 'application/json',
          'X-API-Key': API_KEY
        }
      }
    );

    console.log('Message sent:', response.data);
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
  }
}

sendWhatsAppMessage();
import requests
import json

API_ENDPOINT = 'window.location.origin'
API_KEY = 'your-api-key'

def send_whatsapp_message():
    url = f"{API_ENDPOINT}/api/sessions/send-simple"

    headers = {
        'Content-Type': 'application/json',
        'X-API-Key': API_KEY
    }

    payload = {
        'phoneNumber': '2348012345678',
        'message': 'Hello from Wappi API!'
    }

    try:
        response = requests.post(url, headers=headers, json=payload)
        response.raise_for_status()

        print('Message sent:', response.json())
    except requests.exceptions.RequestException as error:
        print('Error:', error)

send_whatsapp_message()
<?php

$apiEndpoint = 'window.location.origin';
$apiKey = 'your-api-key';

$data = [
    'phoneNumber' => '2348012345678',
    'message' => 'Hello from Wappi API!'
];

$ch = curl_init($apiEndpoint . '/api/sessions/send-simple');

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'X-API-Key: ' . $apiKey
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

if ($httpCode === 200) {
    echo "Message sent: " . $response;
} else {
    echo "Error: " . $response;
}

?>

Available Endpoints

Complete list of API endpoints available in your plan

Session Management
POST /api/sessions/create
Create a new WhatsApp session and generate QR code for scanning
GET /api/sessions
Get all WhatsApp sessions with their status and details
GET /api/sessions/:sessionId
Get specific session details including QR code and connection status
DELETE /api/sessions/:sessionId
Disconnect and delete a WhatsApp session
Message Sending
POST /api/sessions/send-simple
Send a WhatsApp message using the first connected session (recommended for quick start)
POST /api/sessions/:sessionId/send
Send a WhatsApp message via a specific session
GET /api/sessions/:sessionId/messages
Get message history for a specific session with pagination
WhatsApp Link & QR Code
POST /api/messages/send
Generate a WhatsApp click-to-chat link with pre-filled message
POST /api/messages/qrcode
Generate a QR code for WhatsApp message (PNG or SVG format)
GET /api/messages/history
Get message history with pagination support
GET /api/messages/stats
Get usage statistics (total messages, QR codes generated, etc.)

Rate Limits & Usage

Current Plan: Free Tier

• 100 messages per day

• 1 WhatsApp device connection

• Rate limit: 10 requests per minute

• Webhook support: Not available

Upgrade to a paid plan for higher limits and advanced features:

Upgrade Plan

Response Format

All API responses follow this standard format:

Success Response (200 OK)
{
  "success": true,
  "data": {
    "messageId": "msg_123456",
    "sessionId": "session_abc",
    "phoneNumber": "+2348012345678",
    "message": "Hello from Wappi API!",
    "sentVia": "+2349087654321"
  }
}
Error Response (4xx/5xx)
{
  "success": false,
  "error": "No active WhatsApp session found",
  "hint": "Contact administrator to access admin panel at /admin.html for session management"
}

Best Practices

1. Secure Your API Key

Never expose your API key in client-side code. Always make API calls from your backend server.

2. Handle Errors Gracefully

Always check the response status and handle errors appropriately. Implement retry logic with exponential backoff.

3. Respect Rate Limits

Monitor your usage and implement request throttling to avoid hitting rate limits.

4. Phone Number Format

Always use international format with country code (e.g., +2348012345678). Include the + symbol.

5. Session Management

Keep your WhatsApp session connected. If disconnected, you'll need to scan the QR code again to reconnect.