Skip to main content
The WSAPI provides a RESTful HTTP API for sending WhatsApp messages, managing contacts, groups, chats, and more. All requests are authenticated and use JSON payloads.

Base URL

All API requests use HTTPS encryption.

Authentication

Most requests require two headers:

Account endpoints

The /account/* endpoints are the exception. They act on your account rather than on a single instance, so they take only X-Api-Key and no X-Instance-Id:
These endpoints accept only your account API key. Per-instance API keys are rejected, even for an instance that belongs to you.
Keep your API key secret. Rotate it immediately if you suspect exposure.

Request format

  • Method: Use the appropriate HTTP method (GET, POST, PUT, DELETE)
  • Headers: Include authentication headers and Content-Type: application/json
  • Body: JSON-formatted request body for POST and PUT requests

Example: Send a text message

Response codes

Phone number format

WhatsApp uses the JID (Jabber ID) format for phone numbers:
  • Individual chats: the full international number, digits only, followed by @s.whatsapp.net. Country code first, then the subscriber number, with nothing between them: 15551234567@s.whatsapp.net.
  • Group chats: the group id followed by @g.us: 120363000000000000@g.us.
Do not include the + prefix in phone numbers. Use the raw digits with country code, and drop any leading zero the number carries in its local format: a UK 07700900123 is sent as 447700900123.
Send the whole number in one value. A country code on its own (1@s.whatsapp.net, 44@s.whatsapp.net) is a well-formed JID that belongs to nobody: WhatsApp accepts the send, never acknowledges it, and the request fails on timeout instead of being rejected.This is worth guarding in your code, because it is what a partially substituted template produces. If you build the recipient from two variables, or from a field like a CRM contact identifier that is not always a phone number, check the value before sending rather than concatenating and hoping.

Resources

The API is organized into the following resource groups:

Messages

Send text, media, documents, stickers, locations, contacts, reactions, and buttons and lists

Chats

List, archive, pin, mute, and manage chat settings

Contacts

List, create, update contacts and retrieve profile pictures

Groups

Create groups, manage participants, update settings and invite links

Session

Get QR codes, pairing codes, connection status, and logout

Instance

Manage instance settings, restart, and update configuration

Account

Get and update your WhatsApp profile name, picture, status, and presence

Media

Download and manage media files

Newsletters

Newsletter and channel management

Status

Status and stories posting

Calls

Call management

Communities

Community and sub-group management
To send messages with tappable buttons or a pick-one list, and receive the choice back as an event, see Buttons and lists.

Tools

  • OpenAPI Spec — available for download and import into API clients
  • Interactive Playground — test endpoints directly from the API Reference pages
Browse the full endpoint list in the sidebar, or use the interactive playground to make test requests.