Skip to content

Commit a086052

Browse files
authored
Merge pull request #460 from signalwire/august-20260623-whatsapp-messaging
Early access WhatsApp messaging: add API reference, spec updates, guides
2 parents d0c1dd8 + 5a8810c commit a086052

25 files changed

Lines changed: 3122 additions & 5 deletions

File tree

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ so the committed OpenAPI/JSON Schema files under `fern/apis/**` and `specs/swml/
8080
> Change the `.tsp` source in `specs/`, then rebuild with `yarn build:specs` and commit both the source and the regenerated output.
8181
> See [API specifications](README.md#api-specifications) in the README for the full spec workflow.
8282
83+
> [!NOTE]
84+
> The OpenAPI emitters (`@signalwire/*` under `specs/emitters/`) are local workspace packages that must be built before the specs compile. `yarn build:specs` handles this for you — prefer it over running an internal sub-step like `build:signalwire-rest` directly. If a build fails with `Couldn't resolve import "@signalwire/..."` or `missing-implementation: Extern declaration...`, the emitter symlinks are missing — run `yarn install`, then rebuild.
85+
8386
## Checks your PR has to pass
8487

8588
CI runs on every pull request.

fern/apis/signalwire-rest/openapi.yaml

Lines changed: 1812 additions & 2 deletions
Large diffs are not rendered by default.

fern/products/apis/apis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ navigation:
132132
slug: webhooks
133133
contents:
134134
- subpackage_campaignRegistry.ten_dlc_status_callback
135+
- section: WhatsApp
136+
slug: whatsapp
137+
referenced-packages:
138+
- whatsAppBusinesses
139+
- whatsAppNumbers
140+
- whatsAppTemplates
141+
contents: []
135142
- shortCodes
136143
- section: Phone Number Management
137144
skip-slug: true
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: WhatsApp message templates
3+
slug: /messaging/whatsapp/message-templates
4+
sidebar-title: Message templates
5+
description: Create and manage the Meta-approved templates required to start WhatsApp conversations.
6+
max-toc-depth: 3
7+
---
8+
9+
Templates are pre-approved message formats required when reaching out to customers who have not
10+
contacted you first. Think of them as pre-written scripts that Meta reviews and approves in advance.
11+
Once approved, you can send them to any customer at any time. See
12+
[Send a template message](/docs/platform/messaging/whatsapp/send-messages#template-message) for how to
13+
deliver one.
14+
15+
<Info>
16+
WhatsApp on SignalWire is in **early-access alpha**. Template management through the SignalWire
17+
Dashboard is planned; today, templates are managed via the API or directly in the Meta Business
18+
dashboard.
19+
</Info>
20+
21+
## Template components
22+
23+
A template is made up of components. A **Body** component is required; the header, footer, and
24+
buttons are optional.
25+
26+
| Component | Description |
27+
|---|---|
28+
| `HEADER` | Optional title line. Can be plain text or media (image, video, document). |
29+
| `BODY` | **Required.** Main message text. Supports variable placeholders for personalization. |
30+
| `FOOTER` | Optional closing line (e.g. "Thank you for your order"). |
31+
| `BUTTONS` | Optional interactive buttons: quick reply, phone number, or URL. |
32+
33+
### Parameters
34+
35+
Templates support variable placeholders so you can personalize messages with customer names, order
36+
numbers, and so on. There are two styles, set by `parameter_format`:
37+
38+
- **Positional** (`positional`): referenced as `{{1}}`, `{{2}}`, `{{3}}` in order.
39+
- **Named** (`named`): referenced by descriptive labels like `{{first_name}}` or `{{order_status}}`.
40+
41+
### Categories
42+
43+
The `category` field must be one of:
44+
45+
- `marketing`: promotional messages, offers, announcements
46+
- `utility`: transactional messages, order updates, account alerts
47+
- `authentication`: one-time passwords and verification codes
48+
49+
## Manage templates
50+
51+
Templates are managed through the API. For the full request and response schemas, see the reference:
52+
53+
<CardGroup>
54+
<Card title="Create a template" href="/docs/apis/rest/whatsapp/create-whatsapp-template" />
55+
<Card title="List templates" href="/docs/apis/rest/whatsapp/list-whatsapp-templates" />
56+
<Card title="Get a template" href="/docs/apis/rest/whatsapp/retrieve-whatsapp-template" />
57+
<Card title="Update a template" href="/docs/apis/rest/whatsapp/update-whatsapp-template" />
58+
<Card title="Delete a template" href="/docs/apis/rest/whatsapp/delete-whatsapp-template" />
59+
</CardGroup>
60+
61+
The example below creates an order-update template with positional parameters. The `components`
62+
array is the heart of the request; each component's fields depend on its `type`.
63+
64+
<EndpointRequestSnippet endpoint="POST /api/messaging/whatsapp/templates" />
65+
66+
## Approval and updates
67+
68+
<Note>
69+
Templates must be reviewed and approved by Meta before use. Approval typically takes a few minutes
70+
to a few hours. A template's current state is reported in its `template_status` field. It must be
71+
`approved` before it can be used to send messages.
72+
</Note>
73+
74+
A template can only be updated while it is **not yet approved**. Once approved, delete and recreate
75+
it to make changes.
76+
77+
<Note>
78+
Anywhere a template ID is accepted, you can use either the SignalWire template ID (a UUID) or the
79+
Meta template ID (a numeric string).
80+
</Note>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: Connect a WhatsApp business number
3+
slug: /messaging/whatsapp/onboarding
4+
sidebar-title: Onboarding
5+
description: Connect a Meta-verified WhatsApp business number to your SignalWire Space during the early-access alpha.
6+
max-toc-depth: 3
7+
---
8+
9+
Your SignalWire account connects to WhatsApp through your existing Facebook/Meta Business account.
10+
Once connected, your WhatsApp business numbers appear in your Space and can be used as the
11+
`from` address in the [Messaging API](/docs/platform/messaging/whatsapp/send-messages).
12+
13+
<Info>
14+
WhatsApp on SignalWire is in **early-access alpha** and is enabled per Space. The steps below are
15+
coordinated with your SignalWire representative. Number provisioning is not yet self-serve. See the
16+
[overview](/docs/platform/messaging/whatsapp) for what's included in the alpha.
17+
</Info>
18+
19+
## Prerequisites
20+
21+
- A **Meta Business Account** (Facebook/Meta Business).
22+
- A **SignalWire Space** with WhatsApp alpha access enabled.
23+
- SignalWire **project credentials**: your Project ID and an API key with the `numbers` scope. You'll
24+
find these in your [SignalWire Dashboard](https://my.signalwire.com).
25+
26+
## Connect your account
27+
28+
<Steps>
29+
30+
### Request alpha access
31+
32+
WhatsApp access is gated at the Space level. [Request early access through this
33+
form](https://signalwire.typeform.com/to/EyPVZ1St) to have the feature enabled for your Space and
34+
begin onboarding.
35+
36+
### Complete Meta embedded signup
37+
38+
SignalWire uses Meta's **embedded signup** flow to link your WhatsApp Business Account (WABA) to
39+
your SignalWire Space. During this flow you authorize the connection with Meta and select the
40+
business phone number(s) to register.
41+
42+
### Confirm your numbers
43+
44+
After signup completes, your registered WhatsApp numbers appear in your Space, associated with your
45+
WhatsApp Business Account. Confirm they're present before sending messages.
46+
47+
</Steps>
48+
49+
<Note>
50+
During the alpha, adding or removing WhatsApp numbers is handled on request by the SignalWire team,
51+
or directly via the Meta Business dashboard. It cannot be done programmatically through the API or the
52+
customer-facing SignalWire Dashboard at this time.
53+
</Note>
54+
55+
## Verify the connection
56+
57+
List the WhatsApp Business Accounts connected to your Space:
58+
59+
<EndpointRequestSnippet endpoint="GET /api/messaging/whatsapp/businesses" />
60+
61+
And list the WhatsApp numbers available to use as a `from` address:
62+
63+
<EndpointRequestSnippet endpoint="GET /api/messaging/whatsapp/numbers" />
64+
65+
<EndpointResponseSnippet endpoint="GET /api/messaging/whatsapp/numbers" />
66+
67+
Each number record includes its association with a WhatsApp Business Account, voice-capability flags,
68+
and the resource IDs used for routing calls or messages through SignalWire. See the
69+
[List WhatsApp numbers](/docs/apis/rest/whatsapp/list-whatsapp-numbers) and
70+
[List WhatsApp Business Accounts](/docs/apis/rest/whatsapp/list-whatsapp-businesses) reference for the
71+
full response schemas.
72+
73+
## Next steps
74+
75+
<CardGroup>
76+
<Card title="Send messages" href="/docs/platform/messaging/whatsapp/send-messages">
77+
Send text, media, interactive, and template messages over WhatsApp.
78+
</Card>
79+
<Card title="Message templates" href="/docs/platform/messaging/whatsapp/message-templates">
80+
Create and manage the Meta-approved templates required to start conversations.
81+
</Card>
82+
</CardGroup>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
title: WhatsApp messaging
3+
slug: /messaging/whatsapp
4+
sidebar-title: Overview
5+
position: 0
6+
subtitle: Send and receive WhatsApp messages through the SignalWire platform, currently in early-access alpha.
7+
description: Send and receive WhatsApp messages from a Meta-verified business number through SignalWire, in early-access alpha.
8+
max-toc-depth: 3
9+
---
10+
11+
SignalWire's WhatsApp integration lets you send and receive WhatsApp messages from a
12+
Meta-verified business number using the same platform, APIs, and routing you already use for
13+
SMS, MMS, and voice. Inbound and outbound messages are handled through the same
14+
[Messaging API](/docs/platform/messaging), so WhatsApp becomes one more channel
15+
alongside the ones you already run, with no third-party middleware required.
16+
17+
<Info>
18+
WhatsApp on SignalWire is in **early-access alpha**, enabled per Space. Request access below to join the alpha.
19+
</Info>
20+
21+
<CardGroup>
22+
<Card title="Request early access" href="https://signalwire.typeform.com/to/EyPVZ1St">
23+
WhatsApp access is gated at the Space level. Request access and the SignalWire team will enable the
24+
feature for your Space.
25+
</Card>
26+
</CardGroup>
27+
28+
## What's available today
29+
30+
During the alpha, the following is supported:
31+
32+
- **Inbound and outbound messaging** through the SignalWire Messaging API.
33+
- **Messaging from a Meta-verified business number** that you connect through Meta's embedded
34+
signup flow.
35+
- **Programmatic routing** of inbound messages to your application, just like SMS and MMS.
36+
37+
## Coming soon
38+
39+
The following capabilities are planned and are **not yet available**:
40+
41+
- Inbound and outbound WhatsApp **voice calls**, including routing to [AI Agents](/docs/platform/ai).
42+
- **Messaging fallback** to SMS/MMS when WhatsApp delivery fails.
43+
- **Message template management** from the SignalWire Dashboard.
44+
45+
## How it works
46+
47+
Customers reach your business through WhatsApp Ads or a Facebook call-to-action button, which
48+
opens WhatsApp and starts a conversation with your Meta-verified business number. From there,
49+
messages are handled programmatically like any other channel, with the
50+
[Server SDKs](/docs/server-sdks), [SWML](/docs/swml), or [AI Agents](/docs/platform/ai).
51+
52+
## Prerequisites
53+
54+
To use WhatsApp messaging during the alpha, you need:
55+
56+
1. A **Meta Business Account**.
57+
2. A **SignalWire Space** enabled for WhatsApp alpha access.
58+
3. To **authorize the connection** between Meta and SignalWire through the embedded signup flow.
59+
60+
Once connected, your registered business number can be used for inbound and outbound messaging
61+
and programmatic routing.
62+
63+
## Next steps
64+
65+
<CardGroup>
66+
<Card title="Connect your WhatsApp business number" href="/docs/platform/messaging/whatsapp/onboarding">
67+
Walk through Meta's embedded signup to connect a business number to your SignalWire Space.
68+
</Card>
69+
</CardGroup>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Receive WhatsApp messages
3+
slug: /messaging/whatsapp/receive-messages
4+
sidebar-title: Receive messages
5+
description: View inbound WhatsApp messages and track delivery status through the SignalWire Messaging API.
6+
max-toc-depth: 3
7+
---
8+
9+
Inbound messages sent to your WhatsApp business number are automatically received and logged by
10+
SignalWire. You can view them in your Dashboard or retrieve them through the Messaging API, alongside
11+
the delivery status of the messages you send.
12+
13+
<Info>
14+
WhatsApp on SignalWire is in **early-access alpha**. Inbound messages from customers are
15+
automatically received and logged by SignalWire.
16+
</Info>
17+
18+
## Message logs
19+
20+
Inbound messages and the delivery status of the messages you send are available through the message
21+
logs endpoint, [`GET /api/messaging/logs`](/docs/apis/rest/message-logs/list-message-logs), which
22+
returns history for both inbound and outbound messages. WhatsApp messages are identified by
23+
`kind: whatsapp`. See the [Message Logs](/docs/apis/rest/message-logs/list-message-logs) reference for
24+
the full response schema.
25+
26+
## Delivery status
27+
28+
The `status` field updates as an outbound message progresses:
29+
30+
| Status | Meaning |
31+
|---|---|
32+
| `sent` | SignalWire has dispatched the message to Meta. |
33+
| `delivered` | The recipient's device has received the message. |
34+
| `read` | The recipient has opened the message. |
35+
36+
You can also view message history graphically in your
37+
[SignalWire Dashboard](https://my.signalwire.com) under **Logs → Messaging**.
38+
39+
To be notified of each status change as it happens, set `status_callback` when
40+
[sending a message](/docs/platform/messaging/whatsapp/send-messages). SignalWire then POSTs the
41+
following payload to your URL at each state change:
42+
43+
<WebhookPayloadSnippet webhook="messageStatusCallback" />
44+
45+
## Replying to inbound messages
46+
47+
When a customer messages you first, you can reply with any message type for **24 hours** from their
48+
last inbound message. Outside that window, you must use an approved
49+
[template](/docs/platform/messaging/whatsapp/message-templates). See
50+
[Messaging rules](/docs/platform/messaging/whatsapp/send-messages#messaging-rules) for details.
51+
52+
## Next steps
53+
54+
<CardGroup>
55+
<Card title="Send messages" href="/docs/platform/messaging/whatsapp/send-messages">
56+
Send text, media, interactive, and template messages.
57+
</Card>
58+
<Card title="Message templates" href="/docs/platform/messaging/whatsapp/message-templates">
59+
Create and manage Meta-approved templates.
60+
</Card>
61+
</CardGroup>

0 commit comments

Comments
 (0)