aldinokemal / gowa-sdk-php
This API is used for sending whatsapp via API. The web dashboard is a separate project (gowa-ui); the server downloads its latest release asset and serves it at `/` (or returns a JSON banner when APP_UI_ENABLED=false). Device scoping: - Send `X-Device-Id` on all device-scoped REST calls. - WebSock
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3 || ^8.0
- guzzlehttp/psr7: ^1.7 || ^2.0 || ^3.0
- psr/http-client: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-28 14:35:37 UTC
README
This API is used for sending whatsapp via API.
Device scoping:
- Send
X-Device-Idon all device-scoped REST calls. - WebSocket: connect to
/ws?device_id=<id>.
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
Install the SDK with Composer. Use the SDK version that matches your GOWA server release.
composer require aldinokemal/gowa-sdk-php
The Composer package moved from aldinokemal/sdk-php-whatsapp-web-multidevice. The PHP namespace remains SdkWhatsappWebMultiDevice. Remove the old package requirement and any custom repository for it when migrating. Use named arguments for media send methods if your code used positional arguments with the old development package. New API options changed the generated argument order.
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/SdkWhatsappWebMultiDevice/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure HTTP basic authorization: basicAuth $config = SdkWhatsappWebMultiDevice\Configuration::getDefaultConfiguration() ->setUsername('YOUR_USERNAME') ->setPassword('YOUR_PASSWORD'); $apiInstance = new SdkWhatsappWebMultiDevice\Api\AppApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->appDevices(); print_r($result); } catch (Exception $e) { echo 'Exception when calling AppApi->appDevices: ', $e->getMessage(), PHP_EOL; }
Releasing
The Release PHP SDK workflow regenerates the Composer package from the OpenAPI file in a published GOWA tag. It verifies the source commit, lints PHP, installs the runtime dependencies, and checks generated requests locally. The SDK's Git tag matches the GOWA tag. Packagist reads the version from that tag.
The GitHub workflow needs permission to update the default branch and create tags. To enable automatic indexing, set both PACKAGIST_USERNAME and PACKAGIST_API_TOKEN in the SDK repository's Actions secrets using a Packagist maintainer account and its SAFE API token. If automatic indexing fails, rerun the same tag to retry. With both secrets unset, the workflow creates the Git tag and a maintainer can select Update on the Packagist package page to index it.
Pull requests that change the release files validate against the latest stable GOWA release. To validate a specific tag, start Release PHP SDK from Actions, enter a published GOWA tag, and leave publishing disabled. Enable publishing on the default branch to publish or retry a version.
The old Packagist listing points to a development branch. The last development snapshot under that package name is commit d8689d1.
API Endpoints
All URIs are relative to http://localhost:3000
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AppApi | appDevices | GET /app/devices | Get list connected devices |
| AppApi | appInfo | GET /app/info | Get server metadata |
| AppApi | appLogin | GET /app/login | Login to whatsapp server |
| AppApi | appLoginWithCode | GET /app/login-with-code | Login with pairing code |
| AppApi | appLogout | GET /app/logout | Logout the active device (keeps the device slot) |
| AppApi | appMetrics | GET /app/metrics | Get server health metrics |
| AppApi | appPasskeyConfirm | POST /app/passkey/confirm | Confirm the passkey pairing code |
| AppApi | appPasskeyResponse | POST /app/passkey/response | Submit the WebAuthn assertion for passkey pairing |
| AppApi | appPasskeyStatus | GET /app/passkey | Get pending passkey pairing state |
| AppApi | appReconnect | GET /app/reconnect | Reconnecting to whatsapp server |
| AppApi | appStatus | GET /app/status | Get connection status |
| AppApi | health | GET /health | Health check |
| CallApi | listCallLogs | GET /call/logs | Get list of call logs |
| CallApi | rejectCall | POST /call/reject | Reject an incoming call |
| ChatApi | archiveChat | POST /chat/{chat_jid}/archive | Archive or unarchive a chat |
| ChatApi | getChatMessages | GET /chat/{chat_jid}/messages | Get messages from a specific chat |
| ChatApi | listChats | GET /chats | Get list of chats |
| ChatApi | pinChat | POST /chat/{chat_jid}/pin | Pin or unpin a chat |
| ChatApi | requestChatHistory | POST /chat/{chat_jid}/history | Request older chat history from the phone |
| ChatApi | setDisappearingTimer | POST /chat/{chat_jid}/disappearing | Set disappearing messages timer |
| ChatwootApi | chatwootDeleteDeviceConfig | DELETE /devices/{device_id}/chatwoot/config | Delete a device's Chatwoot config |
| ChatwootApi | chatwootDeviceWebhook | POST /chatwoot/webhook/{device_id} | Per-device Chatwoot webhook endpoint |
| ChatwootApi | chatwootGetDeviceConfig | GET /devices/{device_id}/chatwoot/config | Get a device's Chatwoot config |
| ChatwootApi | chatwootListConfigs | GET /chatwoot/configs | List per-device Chatwoot configs |
| ChatwootApi | chatwootSyncHistory | POST /chatwoot/sync | Sync message history to Chatwoot |
| ChatwootApi | chatwootSyncStatus | GET /chatwoot/sync/status | Get Chatwoot sync progress |
| ChatwootApi | chatwootUpsertDeviceConfig | PUT /devices/{device_id}/chatwoot/config | Create or update a device's Chatwoot config |
| ChatwootApi | chatwootWebhook | POST /chatwoot/webhook | Chatwoot webhook endpoint |
| DeviceApi | addDevice | POST /devices | Add a new device |
| DeviceApi | getDevice | GET /devices/{device_id} | Get device info |
| DeviceApi | getDeviceStatus | GET /devices/{device_id}/status | Get device connection status |
| DeviceApi | getDeviceWebhook | GET /devices/{device_id}/webhook | Get device webhook configuration |
| DeviceApi | listDevices | GET /devices | List all devices |
| DeviceApi | loginDevice | GET /devices/{device_id}/login | Login a device with QR code |
| DeviceApi | loginDeviceWithCode | POST /devices/{device_id}/login/code | Login a device with pairing code |
| DeviceApi | logoutDevice | POST /devices/{device_id}/logout | Logout device |
| DeviceApi | reconnectDevice | POST /devices/{device_id}/reconnect | Reconnect device |
| DeviceApi | removeDevice | DELETE /devices/{device_id} | Remove a device |
| DeviceApi | updateDeviceWebhook | PATCH /devices/{device_id}/webhook | Set device webhook configuration |
| GroupApi | addParticipantToGroup | POST /group/participants | Adding more participants to group |
| GroupApi | approveGroupParticipantRequest | POST /group/participant-requests/approve | Approve participant request to join group |
| GroupApi | createGroup | POST /group | Create group and add participant |
| GroupApi | demoteParticipantToMember | POST /group/participants/demote | Demote participants to member |
| GroupApi | exportGroupParticipants | GET /group/participants/export | Export group participants as CSV |
| GroupApi | getGroupInfoFromLink | GET /group/info-from-link | Get group information from invitation link |
| GroupApi | getGroupParticipantRequests | GET /group/participant-requests | Get list of participant requests to join group |
| GroupApi | getGroupParticipants | GET /group/participants | Get list of participants in a group |
| GroupApi | groupInfo | GET /group/info | Group Info |
| GroupApi | groupInviteLink | GET /group/invite-link | Group Invite Link |
| GroupApi | joinGroupWithLink | POST /group/join-with-link | Join group with link |
| GroupApi | leaveGroup | POST /group/leave | Leave group |
| GroupApi | promoteParticipantToAdmin | POST /group/participants/promote | Promote participants to admin |
| GroupApi | rejectGroupParticipantRequest | POST /group/participant-requests/reject | Reject participant request to join group |
| GroupApi | removeParticipantFromGroup | POST /group/participants/remove | Remove participants from group |
| GroupApi | setGroupAnnounce | POST /group/announce | Set group announce mode |
| GroupApi | setGroupLocked | POST /group/locked | Set group locked status |
| GroupApi | setGroupName | POST /group/name | Set group name |
| GroupApi | setGroupPhoto | POST /group/photo | Set group photo |
| GroupApi | setGroupTopic | POST /group/topic | Set group topic |
| MessageApi | deleteMessage | POST /message/{message_id}/delete | Delete Message |
| MessageApi | downloadMessageMedia | GET /message/{message_id}/download | Download media from message |
| MessageApi | forwardMessage | POST /message/{message_id}/forward | Forward Message |
| MessageApi | markMessagePlayed | POST /message/{message_id}/played | Mark an audio message as played |
| MessageApi | reactMessage | POST /message/{message_id}/reaction | Send reaction to message |
| MessageApi | readMessage | POST /message/{message_id}/read | Mark as read message |
| MessageApi | revokeMessage | POST /message/{message_id}/revoke | Revoke Message |
| MessageApi | starMessage | POST /message/{message_id}/star | Star message |
| MessageApi | unstarMessage | POST /message/{message_id}/unstar | Unstar message |
| MessageApi | updateMessage | POST /message/{message_id}/update | Edit message by message ID before 15 minutes |
| NewsletterApi | downloadNewsletterMessageMedia | GET /newsletter/messages/{server_id}/download | Download media from a newsletter message |
| NewsletterApi | followNewsletter | POST /newsletter/follow | Follow newsletter |
| NewsletterApi | getNewsletterInfo | GET /newsletter/info | Get newsletter (channel) metadata |
| NewsletterApi | getNewsletterMessageUpdates | GET /newsletter/message-updates | Get newsletter message counters |
| NewsletterApi | getNewsletterMessages | GET /newsletter/messages | Get latest newsletter (channel) messages |
| NewsletterApi | listNewsletterLiveUpdates | GET /newsletter/live-updates | List live updates subscriptions of the device |
| NewsletterApi | searchNewsletterDirectory | GET /newsletter/directory | Browse or search the public channel directory |
| NewsletterApi | subscribeNewsletterLiveUpdates | POST /newsletter/live-updates | Subscribe to newsletter live updates |
| NewsletterApi | unfollowNewsletter | POST /newsletter/unfollow | Unfollow newsletter |
| NewsletterApi | unsubscribeNewsletterLiveUpdates | DELETE /newsletter/live-updates | Stop renewing newsletter live updates |
| SendApi | cancelScheduledSend | POST /send/schedules/{schedule_id}/cancel | Cancel a scheduled send |
| SendApi | getScheduledSend | GET /send/schedules/{schedule_id} | Get a scheduled send |
| SendApi | listScheduledSends | GET /send/schedules | List scheduled sends |
| SendApi | pauseScheduledSend | POST /send/schedules/{schedule_id}/pause | Pause a scheduled send |
| SendApi | resumeScheduledSend | POST /send/schedules/{schedule_id}/resume | Resume a paused scheduled send |
| SendApi | sendAudio | POST /send/audio | Send Audio |
| SendApi | sendChatPresence | POST /send/chat-presence | Send chat presence (typing indicator) |
| SendApi | sendContact | POST /send/contact | Send Contact |
| SendApi | sendFile | POST /send/file | Send File |
| SendApi | sendImage | POST /send/image | Send Image |
| SendApi | sendInteractive | POST /send/interactive | Send an experimental interactive message |
| SendApi | sendLink | POST /send/link | Send Link |
| SendApi | sendLocation | POST /send/location | Send Location |
| SendApi | sendMessage | POST /send/message | Send Message |
| SendApi | sendPoll | POST /send/poll | Send Poll / Vote |
| SendApi | sendPresence | POST /send/presence | Send presence status |
| SendApi | sendSticker | POST /send/sticker | Send Sticker |
| SendApi | sendVideo | POST /send/video | Send Video |
| UserApi | userAvatar | GET /user/avatar | User Avatar |
| UserApi | userBusinessProfile | GET /user/business-profile | Get Business Profile Information |
| UserApi | userChangeAvatar | POST /user/avatar | User Change Avatar |
| UserApi | userChangePushName | POST /user/pushname | User Change Push Name |
| UserApi | userCheck | GET /user/check | Check if user is on WhatsApp |
| UserApi | userInfo | GET /user/info | User Info |
| UserApi | userMyContacts | GET /user/my/contacts | Get list of user contacts |
| UserApi | userMyContactsDetailed | GET /user/my/contacts/detailed | Get list of user contacts with every contact name separate |
| UserApi | userMyGroups | GET /user/my/groups | User My List Groups |
| UserApi | userMyNewsletter | GET /user/my/newsletters | User My List Groups |
| UserApi | userMyPrivacy | GET /user/my/privacy | User My Privacy Setting |
| UserApi | userSubscribePresence | POST /user/presence/subscribe | Subscribe to contact presence |
Models
- AddDeviceRequest
- AppInfo200Response
- AppInfo200ResponseResults
- AppMetrics200Response
- AppMetrics200ResponseResults
- AppMetrics200ResponseResultsDevices
- AppMetrics200ResponseResultsSystem
- AppMetrics200ResponseResultsSystemFilesystem
- AppMetrics200ResponseResultsSystemFoldersValue
- AppMetrics200ResponseResultsSystemMemory
- AppStatus200Response
- AppStatus200ResponseResults
- ApproveGroupParticipantRequestRequest
- ArchiveChatRequest
- ArchiveChatResponse
- ArchiveChatResponseResults
- BusinessProfileResponse
- BusinessProfileResponseResults
- BusinessProfileResponseResultsBusinessHoursInner
- BusinessProfileResponseResultsCategoriesInner
- CallLog
- CallLogCallMetadata
- CallLogListResponse
- CallLogListResponseResults
- CallLogListResponseResultsPagination
- Chat
- ChatListResponse
- ChatListResponseResults
- ChatListResponseResultsPagination
- ChatMessage
- ChatMessagesResponse
- ChatMessagesResponseResults
- ChatMessagesResponseResultsPagination
- ChatReaction
- ChatwootDeleteDeviceConfig200Response
- ChatwootDeleteDeviceConfig200ResponseResults
- ChatwootDeviceConfig
- ChatwootGetDeviceConfig200Response
- ChatwootListConfigs200Response
- ChatwootSyncHistory409Response
- ChatwootSyncHistory409ResponseResults
- ChatwootSyncHistoryRequest
- ChatwootSyncResponse
- ChatwootSyncResponseResults
- ChatwootSyncStatusResponse
- ChatwootSyncStatusResponseResults
- ChatwootUpsertDeviceConfig200Response
- ChatwootUpsertDeviceConfigRequest
- CreateGroupRequest
- CreateGroupResponse
- CreateGroupResponseResults
- DeviceAddResponse
- DeviceAddResponseResults
- DeviceInfo
- DeviceInfoResponse
- DeviceListResponse
- DeviceLoginResponse
- DeviceLoginResponseResults
- DeviceLoginWithCodeResponse
- DeviceLoginWithCodeResponseResults
- DeviceResponse
- DeviceResponseResultsInner
- DeviceStatusResponse
- DeviceStatusResponseResults
- DownloadMessageMedia200Response
- DownloadMessageMedia200ResponseResults
- ErrorBadRequest
- ErrorForbidden
- ErrorInternalServer
- ErrorNotFound
- ErrorUnauthorized
- FollowNewsletterRequest
- ForwardMessageRequest
- GenericResponse
- GetDeviceWebhook200Response
- GetDeviceWebhook200ResponseResults
- GetGroupInviteLinkResponse
- GetGroupInviteLinkResponseResults
- GroupInfoFromLinkResponse
- GroupInfoFromLinkResponseResults
- GroupInfoResponse
- GroupParticipantItem
- GroupParticipantRequestItem
- GroupParticipantRequestListResponse
- GroupParticipantsResponse
- GroupParticipantsResult
- InteractiveCarouselCard
- InteractiveNativeFlowButton
- InteractiveSendRequest
- JoinGroupWithLinkRequest
- JoinedGroupParticipant
- LeaveGroupRequest
- LoginResponse
- LoginResponseResults
- LoginWithCodeResponse
- LoginWithCodeResponseResults
- ManageParticipantRequest
- ManageParticipantResponse
- ManageParticipantResponseResultsInner
- MarkMessagePlayedRequest
- MyListContacts
- MyListContactsDetailed
- MyListContactsDetailedResponse
- MyListContactsDetailedResponseResults
- MyListContactsResponse
- MyListContactsResponseResults
- Newsletter
- NewsletterDirectoryResponse
- NewsletterDirectoryResponseResults
- NewsletterInfoResponse
- NewsletterLiveUpdatesListResponse
- NewsletterLiveUpdatesListResponseResults
- NewsletterLiveUpdatesResponse
- NewsletterLiveUpdatesSubscription
- NewsletterMediaDownloadResponse
- NewsletterMediaDownloadResponseResults
- NewsletterMessage
- NewsletterMessagesResponse
- NewsletterMessagesResponseResults
- NewsletterResponse
- NewsletterResponseResults
- NewsletterState
- NewsletterThreadMetadata
- NewsletterThreadMetadataDescription
- NewsletterThreadMetadataName
- NewsletterThreadMetadataPicture
- NewsletterThreadMetadataPreview
- NewsletterThreadMetadataSettings
- NewsletterThreadMetadataSettingsReactionCodes
- NewsletterViewerMetadata
- PasskeyStatusResponse
- PasskeyStatusResponseResults
- PasskeyStatusResponseResultsChallenge
- PasskeyStatusResponseResultsChallengeAllowCredentialsInner
- PinChatRequest
- PinChatResponse
- PinChatResponseResults
- ReactMessageRequest
- ReadMessageRequest
- RejectCallRequest
- RejectGroupParticipantRequestRequest
- RequestChatHistoryRequest
- RequestChatHistoryResponse
- RequestChatHistoryResponseResults
- RevokeMessageRequest
- Schedule
- ScheduleListResponse
- ScheduleListResponseResults
- ScheduleListResponseResultsPagination
- ScheduleOptions
- ScheduleResponse
- SendChatPresenceRequest
- SendContactRequest
- SendLinkRequest
- SendLocationRequest
- SendMessageRequest
- SendPollRequest
- SendPresenceRequest
- SendResponse
- SendResponseResults
- SetDisappearingTimerRequest
- SetDisappearingTimerResponse
- SetDisappearingTimerResponseResults
- SetGroupAnnounceRequest
- SetGroupLockedRequest
- SetGroupNameRequest
- SetGroupPhotoResponse
- SetGroupPhotoResponseResults
- SetGroupTopicRequest
- UnfollowNewsletterRequest
- UpdateDeviceWebhook200Response
- UpdateDeviceWebhook200ResponseResults
- UpdateDeviceWebhookRequest
- UpdateMessageRequest
- UserAvatarResponse
- UserAvatarResponseResults
- UserChangePushNameRequest
- UserCheckResponse
- UserCheckResponseResults
- UserGroupResponse
- UserGroupResponseResults
- UserInfoResponse
- UserInfoResponseResults
- UserInfoResponseResultsDevicesInner
- UserMyGroupItem
- UserPrivacyResponse
- UserPrivacyResponseResults
- UserSubscribePresence200Response
- UserSubscribePresence200ResponseResults
- UserSubscribePresenceRequest
- WebAuthnAssertion
- WebAuthnAssertionResponse
Authorization
Authentication schemes defined for the API:
basicAuth
- Type: HTTP basic authentication
Tests
To run the tests, use:
composer install vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
9.7.0- Generator version:
7.27.0
- Generator version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen