> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# WhatsApp

> Send WhatsApp messages and manage your business profile and message templates via the WhatsApp Business Cloud API

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: API key.
* **Connection**: The key from `WHATSAPP_ACCESS_TOKEN` is sent as the `Bearer` prefixed `Authorization` header.
* **Docs**: [https://developers.facebook.com/docs/whatsapp/cloud-api/get-started](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable                       | Required | Description                                                                                                                                                                                                                                |
| ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `WHATSAPP_ACCESS_TOKEN`        | Yes      | Meta access token with whatsapp\_business\_messaging and whatsapp\_business\_management permissions (use a System User token in production) [Docs](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started).                   |
| `WHATSAPP_PHONE_NUMBER_ID`     | Yes      | Phone number ID of the business phone number (from WhatsApp > API Setup in the Meta app dashboard); pass it as the phoneNumberId parameter of messaging tools [Docs](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started). |
| `WHATSAPP_BUSINESS_ACCOUNT_ID` | No       | WhatsApp Business Account (WABA) ID, needed to list message templates; pass it as the wabaId parameter [Docs](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started).                                                        |

## Setup

1. **Create a Meta app with the WhatsApp product**: Sign in at [https://developers.facebook.com](https://developers.facebook.com) (a free Meta developer account works), create a Business-type app, and add the WhatsApp product. Meta provisions a free test phone number and sandbox automatically.
2. **Get a test token and phone number ID**: In WhatsApp > API Setup, copy the temporary access token and the Phone number ID for the test number. Add up to 5 verified recipient numbers for sandbox testing. Set WHATSAPP\_ACCESS\_TOKEN and WHATSAPP\_PHONE\_NUMBER\_ID.
3. **Note your WhatsApp Business Account ID**: The WABA ID is shown in WhatsApp > API Setup (and in Meta Business Suite). Set it as WHATSAPP\_BUSINESS\_ACCOUNT\_ID if you want to list message templates.
4. **Create a permanent token for production**: Temporary tokens expire after about 24 hours. For production, create a System User in Meta Business Suite, grant it the whatsapp\_business\_messaging and whatsapp\_business\_management permissions, generate a non-expiring token, and use it as WHATSAPP\_ACCESS\_TOKEN.

* Free-form text messages are only delivered within 24 hours of the customer's last message; outside that window you must send an approved template.
* Use the internal phone number ID in API calls, not the E.164 phone number.
* New templates must be approved by Meta before they can be sent; check status with the List Message Templates tool.

Provider API reference: [https://developers.facebook.com/docs/whatsapp/cloud-api](https://developers.facebook.com/docs/whatsapp/cloud-api)

## Tools

| Tool                    | Access | Description                                                                                                                                                  |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Send Text Message       | Write  | Send a free-form text message to a WhatsApp user (only within 24 hours of their last message; otherwise use a template)                                      |
| Send Template Message   | Write  | Send an approved message template to a WhatsApp user; required to start conversations outside the 24-hour customer service window                            |
| Send Media Message      | Write  | Send an image, document, video, or audio message to a WhatsApp user by public URL or uploaded media ID (subject to the same 24-hour window as text messages) |
| Get Media URL           | Read   | Get a short-lived download URL and metadata for a media ID, e.g. to retrieve an image or document a customer sent inbound                                    |
| Update Business Profile | Write  | Update the business profile (about, address, description, email, websites, vertical) shown to customers for a business phone number                          |
| Mark Message as Read    | Write  | Mark an inbound WhatsApp message as read so the customer sees read receipts after the agent processes it                                                     |
| Get Business Profile    | Read   | Read the business profile (about, address, email, websites) shown to customers for a business phone number                                                   |
| List Message Templates  | Read   | List the message templates on a WhatsApp Business Account so an agent can pick an approved template name and language before sending                         |

## Example prompts

* Send a WhatsApp message to a customer following up on their recent inquiry.
* List my approved WhatsApp message templates and summarize what each one is for.
* Show my WhatsApp business profile and suggest improvements to the description and website links.
