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

# Connect Your WhatsApp Provider

> Send Flabs reports and bills from your own WhatsApp number, step by step.

## Before you start

* **A WhatsApp provider account** that can send approved templates from your number.
* **Flabs API access:** ask Flabs support for API access. You get a **Client ID** and **Client Secret**. If your lab already has an integration, use the same credentials.
* **A webhook URL:** a public HTTPS URL on your side that receives the events and sends the WhatsApp through your provider.

## Steps

**1. Add the templates to your provider**

Create the [templates](https://developer.flabslis.com/whatsapp/templates.md) in your provider and get them approved by Meta.

**2. Get a token**

```bash theme={null}
curl --request POST \
  --url https://v2.flabs.in/client/auth/token \
  --header 'Content-Type: application/json' \
  --data '{ "clientID": "<Client ID>", "clientSecret": "<Client Secret>" }'
```

Copy `authToken` from the response (valid for 10 minutes).

**3. Register your webhook**

```bash theme={null}
curl --request POST \
  --url https://v2.flabs.in/client/events/subscribe \
  --header 'Authorization: Bearer <authToken>' \
  --header 'Content-Type: application/json' \
  --data '{
    "labID": "<branch ID>",
    "events": ["report.send", "bill.send"],
    "endpoint": "<your webhook URL>",
    "protocol": "https"
  }'
```

Do this once per branch. See [Register WhatsApp Webhook](https://developer.flabslis.com/whatsapp/register-webhook.md).

**4. Test**

Send a test bill or report (or click **WhatsApp** on a booking) to your own number. Your webhook receives the [event](https://developer.flabslis.com/whatsapp/payload.md) and the WhatsApp arrives from your number.

**5. Go live**

From now on only your provider sends the subscribed messages. To go back to the Flabs number (or AiSensy), [delete the webhook](https://developer.flabslis.com/whatsapp/register-webhook.md#remove-or-change).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.