We are sunsetting On-Premises API. Refer to our On-Premises API Sunset document for details, and to learn how to migrate to our next-generation Cloud API.
/v1/health
Use the health
node to check the status of your WhatsApp Business API client.
The health
node supports Bearer token and API keys authentication.
health
, metrics
, and stats
nodes from an orchestrator, Bearer tokens are not the best option for ongoing checks as they expire every 7 days. To mediate this, you can use an API key, which can be set using the WA_API_KEY
environment variable in the waweb
environment section in the .yml
file of your installation setup.
services: ... waweb: ... environment: ... WA_API_KEY: your-api-key-tokenThe API key you set must have a minimum of 12 characters and a maximum of 128 characters. The Webapp must be restarted whenever you change the API key.
The API key you set must have a minimum of 12 characters and a maximum of 128 characters.
Make a GET
call to this node to retrieve the status of your WhatsApp Business API client.
Request:
GET /v1/health { Authorization: Bearer your-auth-token | Apikey your-api-key-token }
The response provides the status of the health of the gateway to the WhatsApp server. If the Authorization
header is not present or invalid, a 401
error code is returned.
{ "health": { "gateway_status": "connected | connecting | disconnected | uninitialized | unregistered" } }
{ "health": { "your-hostname1:your-container-id1": { "gateway_status": "connected | connecting | disconnected | uninitialized | unregistered", "role": "primary_master | secondary_master | coreapp" }, "your-hostname2:your-container-id2": { "gateway_status": "connected | connecting | disconnected | uninitialized | unregistered", "role": "primary_master | secondary_master | coreapp" }, } }
In High Availability mode, only one Coreapp will be connected to the WhatsApp server, all other nodes including the primary Master will have a gateway_status
of disconnected
. In Multiconnect mode with X
shards, X
Coreapps will be connected to the WhatsApp server, and the primary Master will also connect to the WhatsApp server.
Name | Description |
---|---|
type: Object | Contains the fields that describe the health of the WhatsApp Business API client. |
type: String | Status of the connection between the Coreapp and WhatsApp servers. Supported values:
|
type: String | Role of the container in High Availability/Multiconnect setups. See the Availability and Scaling documentation for more information on these setups. Supported values: |