# Setting up the WhatsApp integration

> How to use Timed's shared WhatsApp number or connect your own Meta WhatsApp Business number, configure the webhook, and troubleshoot common errors.

Timed connects to WhatsApp through Meta's WhatsApp Cloud API. There are two ways to use it:

| Option | When to choose |
|---|---|
| **Use Timed's WhatsApp number** | You don't want to manage a Meta app yourself. Messages go out from Timed's shared number, so they show as Timed rather than your company name. No setup required, and Timed's shared message templates are available to you automatically. |
| **Use my own WhatsApp Business number** | You have (or want) your own verified WhatsApp Business number. Messages show your company's branding, and you can create and submit your own message templates. |

Both options are on the same settings page: **Admin → Integrations → WhatsApp**. You can switch between them later.

## Using Timed's WhatsApp number

1. Open **Admin → Integrations → WhatsApp**.
2. Select **Use Timed's WhatsApp number** and click **Save Choice**.
3. Click **Test Connection** — it should show **Connected**.
4. Once connected, use **Send a Test Message** to send a message to a number you control and confirm everything works.

You don't need any Meta credentials for this option — Timed manages the shared number. If the test fails, contact Timed support.

## Connecting your own WhatsApp Business number

You'll need:

- A [Meta Business Manager](https://business.facebook.com) account with a verified business.
- A WhatsApp Business Account (WABA) with at least one phone number registered to it.
- A permanent **System User access token** with the `whatsapp_business_messaging` and `whatsapp_business_management` permissions.

### Step 1 — Fill in the credentials

On **Admin → Integrations → WhatsApp**, select **Use my own WhatsApp Business number** and fill in:

| Field | Where to get it |
|---|---|
| **API URL** | `https://graph.facebook.com/v22.0` is the default. Only change it if Meta releases a new version you want to use. |
| **Phone Number ID** | Meta Business Manager → WhatsApp Manager → Phone numbers — the long numeric ID, **not** the phone number itself. |
| **Access Token** | Business Manager → System Users → [your system user] → Generate Token. Use a permanent token, not the temporary 24-hour one. Stored encrypted. |
| **WhatsApp Business Account ID** | WhatsApp Manager → Account info → WhatsApp Business Account ID. Needed to sync your templates from Meta. |
| **Webhook Verify Token** | Make up any string (e.g. 32 random characters). You'll paste the same value into Meta in Step 2. |
| **Webhook Secret (Meta App Secret)** | The **App Secret** from your Meta app's Settings → Basic. Used to check that incoming messages really come from Meta. Stored encrypted. |
| **Active** | Tick once you've tested. While unticked, Timed doesn't send from your number. |

Click **Save Settings**, then **Test Connection**. If Timed can reach your number with the token you entered, the status changes to **Connected** and a **Send a Test Message** section appears so you can check that sending works.

### Step 2 — Configure the webhook in Meta

So that incoming messages and delivery updates reach Timed:

1. In the Meta App Dashboard, go to WhatsApp → Configuration → Webhook → **Edit**.
2. **Callback URL**: copy the URL shown under **Webhook URL for Meta** on the Timed WhatsApp settings page, exactly as shown. When you use your own number, this URL is unique to your company and looks like `https://app.timed.co.za/api/whatsapp/webhook/your-company`. Don't share it with anyone else.
3. **Verify Token**: the value you set in Step 1.
4. Click **Verify and Save**. Meta checks the URL, and Timed confirms it if the verify token matches.
5. Subscribe to at least the `messages` field. Without it, no incoming messages will ever arrive.

If verification fails, check:

- You copied the Callback URL exactly, including the `/api/` part.
- The verify token matches **exactly** — it's case-sensitive.

If it still fails, contact Timed support.

### Step 3 — Sync templates

If you'll send template messages:

1. Go to **Management → Communication** and open the **Templates** tab.
2. Click **Sync from Meta**. Timed pulls in every template registered to your WhatsApp Business Account, including its language, status, and text.
3. Templates that are approved in Meta can be sent straight away. Pending or rejected templates show their status and can't be sent.

You can also add templates in Timed and submit them to Meta for approval — see [Managing WhatsApp templates](https://timed.co.za/docs/whatsapp-templates).

## Troubleshooting

If you're on Timed's shared number and something isn't working, the **Run Diagnostics** button under **Timed's WhatsApp number** runs a check of the shared connection. If it reports a problem, contact Timed support — there's nothing you need to change on your side.

For your own number, these are the most common errors:

| Error | What to do |
|---|---|
| **"Unknown path components"** (from Meta) | The Phone Number ID is wrong. Double-check it in WhatsApp Manager — it's a long numeric ID, not the phone number. |
| **132000** (from Meta) | The template variables sent don't match what Meta expects. See [Sending WhatsApp broadcasts](https://timed.co.za/docs/whatsapp-broadcasts#troubleshooting-meta-error-132000). |
| Meta can't verify the webhook | Verify token mismatch. Re-copy the same verify token into both Timed and Meta. |
| Webhook verified, but incoming messages never appear | Usually an App Secret mismatch. Re-copy the App Secret from Meta into the **Webhook Secret** field, and check you're subscribed to the `messages` field. |

## What you can do once connected

| Feature | Article |
|---|---|
| Two-pane chat with employees | [The WhatsApp Inbox](https://timed.co.za/docs/whatsapp-inbox) |
| Send bulk text or template messages | [WhatsApp Broadcasts](https://timed.co.za/docs/whatsapp-broadcasts) |
| Manage Meta-approved templates | [Managing WhatsApp templates](https://timed.co.za/docs/whatsapp-templates) |
| Let managers ask the AI assistant via WhatsApp | [WhatsApp AI Copilot](https://timed.co.za/docs/whatsapp-ai-copilot) |
| Let employees upload documents (send `DOC`) | [Employee documents (FICA)](https://timed.co.za/docs/employee-documents) |

If something doesn't work after following this guide, contact Timed support.