PHPackages                             waapi/waapi-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. waapi/waapi-php-sdk

ActiveLibrary[API Development](/categories/api)

waapi/waapi-php-sdk
===================

The official EAZE WhatsApp PHP SDK

v1.0.1(2y ago)59.6k↓39.1%31MITPHPPHP ^7.2|^8.0

Since Aug 22Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/WaAPIapp/waapi-php-sdk)[ Packagist](https://packagist.org/packages/waapi/waapi-php-sdk)[ RSS](/packages/waapi-waapi-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (3)Used By (1)

WaAPI PHP Package
=================

[](#waapi-php-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0e5dd5835e066f8b9932fb350996754b5589ad034b2ed0bc240ec17f0c7ed9fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77616170692f77616170692d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/waapi/waapi-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/40a1b557a3f25d3c170063eb76320badb34888eefe9f9be38e4fb11457c47935/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77616170692f77616170692d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/waapi/waapi-php-sdk)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

Introduction
------------

[](#introduction)

PHP package to easily interact with [waapi.app](https://waapi.app).

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require waapi/waapi-php-sdk
```

Usage
-----

[](#usage)

### Initial Setup

[](#initial-setup)

```
use WaAPI\WaAPISdk\WaAPISdk;

$apiToken = 'xxxxxxxxxxxxxxxxxxxxxx';
$sdk = new WaAPISdk($apiToken);
```

### Check if WhatsApp API is available

[](#check-if-whatsapp-api-is-available)

```
$isAvailable = $sdk->isApiAvailable();
```

### Create a new instance

[](#create-a-new-instance)

```
// Create a basic instance
$instance = $sdk->createInstance();
$instanceId = $instance->id;

// Create an instance with a name and webhook
$instance = $sdk->createInstance(
    name: 'My Instance',
    webhookUrl: 'https://my.url.com/webhook/handler',
    webhookEvents: ['message', 'ready', 'qr']
);
```

### Get an existing instance

[](#get-an-existing-instance)

```
$instanceId = 10; //you need to know your instance id at this point
$instance = $sdk->getInstance($instanceId);
```

### Update an existing instance

[](#update-an-existing-instance)

```
$instanceId = 10; //you need to know your instance id at this point

//if a subscribed event occurs, this url will be requested with the event data
//can also be null if you do not want to receive webhooks
$webhookUrl = '';
$subscribedEvents = ['', '']; //can also be null or an empty array

$sdk->updateInstance($instanceId, $webhookUrl, $subscribedEvents);

// You can also update the instance name
$sdk->updateInstance($instanceId, name: 'New Name');

//if you have an instance object, you can also use the following method
$instance = $sdk->getInstance($instanceId);
$instance->update($webhookUrl, $subscribedEvents);
```

### Delete an existing instance

[](#delete-an-existing-instance)

```
$instanceId = 10; //you need to know your instance id at this point
$sdk->deleteInstance($instanceId);

//if you have an instance object, you can also use the following method to delete this instance
$instance = $sdk->getInstance($instanceId);
$instance->delete();
```

### Get the QR-Code

[](#get-the-qr-code)

After creating a new instance, you need to connect your WhatsApp phone number with this instance. With the following code, you are able to receive the current QR-Code.

```
$instanceId = 10; //you need to know your instance id at this point
$response = $sdk->getInstanceClientQrCode($instanceId);

//if you have an instance object, you can also use the convenience method
$instance = $sdk->getInstance($instanceId);
$response = $instance->clientQrCode();

// The QR code as a base64 image string (data:image/png;base64,…).
// Set this string in the src attribute of a  html tag.
$qrCode = $response->qrCode;
```

### Get the instance status

[](#get-the-instance-status)

An instance always has a status.

StatusDescriptionbootingThe node is starting the instance. The status will change to `loading_screen` soon.loading\_screenThe instance is starting WhatsApp Web. The status will change to `qr` or `ready` soon.qrThe instance needs to be connected with a WhatsApp phone number. You can fetch the QR code now.authenticatedThe connection via the QR code was successful. The status will change to `ready` soon.auth\_failureThe connection via the QR code failed or WhatsApp Web is down.readyThe instance is ready to use. You are able to execute actions and send messages.disconnectedDisconnected from WhatsApp Web```
$instanceId = 10; //you need to know your instance id at this point
$response = $sdk->getInstanceClientStatus($instanceId);

//if you have an instance object, you can also use the convenience method
$instance = $sdk->getInstance($instanceId);
$response = $instance->clientStatus();

$instanceStatus = $response->instanceStatus;
```

### Get information about an existing instance

[](#get-information-about-an-existing-instance)

```
$instanceId = 10; //you need to know your instance id at this point
$response = $sdk->getInstanceClientInfo($instanceId);

//if you have an instance object, you can also use the convenience method
$instance = $sdk->getInstance($instanceId);
$response = $instance->clientInfo();

//your public name of your WhatsApp profile (your name)
$displayName = $response->displayName;

//the connected WhatsApp phone number (your phone number)
$phoneNumber = $response->formattedNumber;

//profile image url of the connected WhatsApp phone number (your profile picture)
$profileUrl = $response->profilePicUrl;

//a unique identifier for your WhatsApp account / profile / phone number
$whatsAppId = $response->contactId;
```

### Execute actions

[](#execute-actions)

Once your instance is in `ready` state, you can execute WhatsApp actions:

```
$instanceId = 10;

// Send a text message
$result = $sdk->executeInstanceAction($instanceId, 'send-message', [
    'chatId' => '491234567890@c.us',
    'message' => 'Hello from waapi!',
]);

// Send media
$result = $sdk->executeInstanceAction($instanceId, 'send-media', [
    'chatId' => '491234567890@c.us',
    'mediaUrl' => 'https://example.com/image.png',
    'mediaCaption' => 'Check this out!',
]);

// Using the instance object
$instance = $sdk->getInstance($instanceId);
$result = $instance->executeClientAction('send-message', [
    'chatId' => '491234567890@c.us',
    'message' => 'Hello!',
]);
```

Common actions: `send-message`, `send-media`, `send-location`, `send-vcard`, `get-chats`, `get-contacts`, `get-contact-by-id`, `is-registered-user`, `get-number-id`, `send-seen`, `logout`, `reboot`.

For a full list of available actions and their parameters, see the [API documentation](https://waapi.readme.io).

### Webhook events

[](#webhook-events)

When configuring webhooks, use the `WebhookEvent` class for available event constants:

```
use WaAPI\WaAPISdk\Resources\WebhookEvent;

$sdk->createInstance(
    name: 'My Instance',
    webhookUrl: 'https://my.url.com/webhook',
    webhookEvents: [
        WebhookEvent::MESSAGE,
        WebhookEvent::READY,
        WebhookEvent::QR,
        WebhookEvent::DISCONNECTED,
    ]
);

// Subscribe to all events
$sdk->createInstance(
    name: 'My Instance',
    webhookUrl: 'https://my.url.com/webhook',
    webhookEvents: WebhookEvent::ALL
);
```

EventDescription`message`Fired when you receive a message`message_create`New message created (sent and received)`message_edit`A message was edited`message_ack`Message was read or received`message_reaction`Reaction sent, received, updated or removed`message_revoke_everyone`Message deleted for everyone`message_revoke_me`Message deleted for you only`media_uploaded`Media file uploaded successfully`qr`New QR code available`authenticated`Connection successfully established`auth_failure`Authentication failed`ready`Instance is ready to use`disconnected`Instance was disconnected`loading_screen`Instance is loading data`change_state`Connection status changed`group_join`Someone joined or was added to a group`group_leave`Someone left or was removed from a group`group_update`Group information was updated`call`Incoming call (cannot be handled by API)`vote_update`Poll vote was updated or removedLicense
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance59

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

2

Last Release

985d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/458c331a816d8fc9210f5d90e0850cbb3fc816b57dd786ea373d2e521a5652bd?d=identicon)[WaAPIapp](/maintainers/WaAPIapp)

---

Top Contributors

[![Tebros](https://avatars.githubusercontent.com/u/25565890?v=4)](https://github.com/Tebros "Tebros (16 commits)")[![sneumannws](https://avatars.githubusercontent.com/u/137796422?v=4)](https://github.com/sneumannws "sneumannws (5 commits)")[![WaAPIapp](https://avatars.githubusercontent.com/u/134516466?v=4)](https://github.com/WaAPIapp "WaAPIapp (2 commits)")

---

Tags

apisdklibrarywhatsappeaze

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/waapi-waapi-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/waapi-waapi-php-sdk/health.svg)](https://phpackages.com/packages/waapi-waapi-php-sdk)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[fabian-beiner/todoist-php-api-library

A PHP client library that provides a native interface to the official Todoist REST API.

4810.8k](/packages/fabian-beiner-todoist-php-api-library)[chatapi/whatsapp

Library for WhatsApp api

453.6k](/packages/chatapi-whatsapp)[telegramsdk/botapi

SDK for the Telegram Bot API.

234.0k1](/packages/telegramsdk-botapi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
