أقوى واتس

API documentation

Send WhatsApp verification codes and notifications from your own numbers with a single HTTP request.

Quick start

  1. Create an account and verify it with the code.
  2. Link a WhatsApp number from “WhatsApp numbers” by scanning a QR code.
  3. Create an API key from “API keys” (shown once — keep it safe).
  4. Send your first message with one POST request (ready-made examples below).

Base URL: https://whats.aqwasoft.com/api/v1

Authentication

Every request carries your API key in the Authorization header. Never put the key in browser or app code — use it from your server only.

Authorization: Bearer aqw_live_xxxxxxxxxxxxxxxxxxxx

Alternative: the X-Api-Key header with the same value.

Send a message POST /api/v1/messages

The message is queued and the call returns immediately (202) with its id and status queued; it is sent within seconds.

FieldRequiredDescription
to✓Recipient in international format with the country code (with or without +).
body✓Message text up to 4096 characters (the field message is also accepted).
type—text (default) for notifications, or otp for verification codes — prioritized, and they expire if delayed.
use Illuminate\Support\Facades\Http;

$res = Http::withToken(env('AQWA_API_KEY'))
    ->acceptJson()
    ->post(env('AQWA_API_URL').'/messages', [
        'to'   => '9665XXXXXXXX',          // الرقم الدولي
        'body' => "رمز التحقق: {$code}",
        'type' => 'otp',                    // أو text للإشعارات
    ]);

if ($res->status() === 429) {
    $wait = $res->header('Retry-After'); // انتظر قبل المحاولة
}

$messageId = $res->json('data.id'); // msg_…

Response (202):

{
    "success": true,
    "data": {
        "id": "msg_01j9zq4k2r5t8y1u3i6o9p2a4s",
        "to": "9665XXXXXXXX",
        "type": "otp",
        "status": "queued",
        "error": null,
        "created_at": "2026-09-27T10:15:01+03:00",
        "sent_at": null,
        "delivered_at": null,
        "read_at": null,
        "expires_at": "2026-09-27T10:20:01+03:00"
    }
}

The legacy path POST /api/v1/send still works the same way.

Message status GET /api/v1/messages/{id}

Look it up by its msg_… id (you only see your own messages), or enable webhooks to receive changes automatically.

queued → processing → sent ✓ → delivered ✓✓ → read ✓✓

statusDescription
queuedQueued, will be sent within seconds.
processingBeing sent right now.
sentHanded to WhatsApp (✓).
deliveredReached the recipient’s phone (✓✓) — with delivered_at.
readRead by the recipient (blue ✓✓) — with read_at. Not reported if they turned off read receipts.
failedFailed — the reason is in error (e.g. not_on_whatsapp or no_connected_session).
expiredThe OTP expired before it could be sent, so it was not sent.
$res = Http::withToken(env('AQWA_API_KEY'))
    ->acceptJson()
    ->get(env('AQWA_API_URL').'/messages/'.$messageId);

$status = $res->json('data.status'); // queued | sent | failed | expired

Account check GET /api/v1/account

Check that the key is valid, the account is active and a number is connected — without sending any message. Ideal for a periodic health check in your system.

{
    "success": true,
    "data": {
        "account": {
            "type": "subscriber",
            "name": "متجر نخلة",
            "status": "active"
        },
        "key": {
            "name": "Production server",
            "prefix": "aqw_live_Ab12Cd",
            "last_used_at": "2026-09-27T10:15:01+03:00"
        },
        "numbers": {
            "connected": 1,
            "total": 1
        },
        "ready": true,
        "limits": {
            "requests_per_minute": 60,
            "otp_cooldown_seconds": 30,
            "…": "…"
        },
        "api_version": "v1"
    }
}

ready = false means no WhatsApp number is connected right now: messages will wait in the queue and may fail. Link a number from your panel.

Idempotency (Idempotency-Key)

If the connection drops before you get the response and you retry, the user may receive two codes. Send an Idempotency-Key header with a unique value per operation:

curl -X POST https://whats.aqwasoft.com/api/v1/messages \
  -H "Authorization: Bearer $AQWA_API_KEY" \
  -H "Idempotency-Key: order-1048-otp" \
  -H "Content-Type: application/json" \
  -d '{"to":"9665XXXXXXXX","body":"رمز التحقق: 482913","type":"otp"}'
  • The same request with the same key within 24 hours returns the first response (same message id) with Idempotent-Replayed: true — nothing is sent twice.
  • Same key with a different request → 422 idempotency_conflict. Two concurrent requests → 409 idempotency_in_progress.
  • Failed requests are not stored, so you can fix and retry them with the same key. The header is optional and recommended for OTP.

Webhooks

Enable them in your panel (Developers → Webhooks): we POST to your URL on every status change of your messages, with the same message data as the API.

EventsDescription
message.sentHanded to WhatsApp.
message.deliveredReached the recipient’s phone.
message.readRead by the recipient.
message.failedFailed (reason in data.error).
message.expiredThe OTP expired before it could be sent.

Example “delivered” notification:

POST https://your-system.com/webhooks/aqwa
X-Aqwa-Event: message.delivered
X-Aqwa-Delivery: evt_01j9zq4m8h2k7x3v5b6n1c0d9e
X-Aqwa-Signature: t=1790493304,v1=5f2b…

{
    "id": "evt_01j9zq4m8h2k7x3v5b6n1c0d9e",
    "event": "message.delivered",
    "created_at": "2026-09-27T10:15:04+03:00",
    "data": {
        "id": "msg_01j9zq4k2r5t8y1u3i6o9p2a4s",
        "to": "9665XXXXXXXX",
        "type": "otp",
        "status": "delivered",
        "error": null,
        "created_at": "2026-09-27T10:15:01+03:00",
        "sent_at": "2026-09-27T10:15:02+03:00",
        "delivered_at": "2026-09-27T10:15:04+03:00",
        "read_at": null,
        "expires_at": "2026-09-27T10:20:01+03:00"
    }
}

Verifying the signature

X-Aqwa-Signature is t=<time>,v1=<signature>, where the signature = HMAC-SHA256 of “t.raw body” with the signing secret from your panel. Compare with a constant-time function and reject times older than 5 minutes:

// Laravel — routes/api.php
Route::post('/webhooks/aqwa', function (Request $request) {
    $body = $request->getContent();
    $header = (string) $request->header('X-Aqwa-Signature'); // t=...,v1=...
    preg_match('/^t=(\d+),v1=([a-f0-9]{64})$/', $header, $m) || abort(400);

    $expected = hash_hmac('sha256', $m[1].'.'.$body, env('AQWA_WEBHOOK_SECRET'));
    abort_unless(hash_equals($expected, $m[2]) && abs(time() - (int) $m[1]) < 300, 400);

    $event = $request->json('event');      // message.delivered ...
    $message = $request->json('data');     // id, to, status, delivered_at ...
    // حدّث حالة الرسالة في نظامك هنا (تجاهل event id المكرر)

    return response()->noContent();        // 2xx = تم الاستلام
});

Return any 2xx within 10 seconds. Otherwise we retry after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours. An event may arrive more than once — deduplicate by its id.

Rate limits

The platform’s current limits (they protect your number and your recipients from bans). When exceeded: 429 with Retry-After.

  • 60 requests per minute per key.
  • At least 30 seconds between two OTPs to the same number.
  • At most 10 OTPs to the same number within 5 minutes.
  • At most 50 OTPs to the same number per day.
  • An OTP is not sent if it stays queued longer than 5 minutes (status expired).
  • At most 20 regular messages to the same number per hour.

Errors

Every error has the same shape, and error.code is stable so you can handle it in code (the message is for humans and follows Accept-Language):

HTTP/1.1 429 Too Many Requests
Retry-After: 42
X-Request-Id: req_01j9zq4m8h2k7x3v5b6n1c0d9e

{
    "success": false,
    "error": {
        "code": "rate_limited",
        "limit": "otp_cooldown",
        "message": "\u2026",
        "retry_after": 42
    },
    "request_id": "req_01j9zq4m8h2k7x3v5b6n1c0d9e"
}
error.codeHTTP codeDescription
missing_api_key401No key was sent.
invalid_api_key401The key is wrong or revoked.
account_inactive403The account is suspended or not activated.
not_found404Unknown path, or the message does not exist (or is not yours).
idempotency_in_progress409Another request with the same Idempotency-Key is in progress.
validation_error422A field is missing or invalid — details in error.fields.
idempotency_conflict422The Idempotency-Key was used for a different request.
rate_limited429A limit was hit — error.limit names it; wait retry_after seconds.
server_error500Unexpected error — retry, and send us the request_id if it persists.

Versioning & support

All paths live under /api/v1 and will not change in a way that breaks your integration; incompatible changes come in /api/v2. Every response carries X-Request-Id — include it when you contact us.

OpenAPI file (openapi.json) — Import it into Postman or Insomnia to try every request right away.