diff --git a/apps/docs/examples/examples.mdx b/apps/docs/examples/examples.mdx
index c1bd47e1383..df619289540 100644
--- a/apps/docs/examples/examples.mdx
+++ b/apps/docs/examples/examples.mdx
@@ -20,4 +20,7 @@ You can use these workflows in your product by following the instructions on eac
Create a welcome email drip campaign.
+
+ Listen for WhatsApp messages and reply.
+
diff --git a/apps/docs/examples/whatsapp.mdx b/apps/docs/examples/whatsapp.mdx
new file mode 100644
index 00000000000..ae298f8cb3a
--- /dev/null
+++ b/apps/docs/examples/whatsapp.mdx
@@ -0,0 +1,48 @@
+---
+title: "WhatsApp"
+sidebarTitle: "WhatsApp"
+description: "Here are some example workflows you could create using the WhatsApp integration."
+---
+
+For more information about the WhatsApp integration, check out the [integration page](/integrations/apis/whatsapp).
+
+## Listen for WhatsApp messages and reply
+
+Integrations required: WhatsApp
+
+```ts
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendReaction, sendText } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "whatsapp-webhook",
+ name: "Listen for WhatsApp messages and reply",
+ apiKey: "",
+ //this listens for all WhatsApp messages sent to your WhatsApp Business account
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //these logs will appear on the run page
+ await ctx.logger.info(`Message data`, event.message);
+ await ctx.logger.info(`Phone number`, event.contacts[0]);
+
+ //add a 🥰 reaction to the original message
+ const reactionResponse = await sendReaction("reaction", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ isReplyTo: event.message.id,
+ emoji: "🥰",
+ });
+
+ //send a text message in response
+ const textResponse = await sendText("text-msg", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ text: "Hello! This is a text sent automatically from https://www.trigger.dev",
+ });
+
+ //we support all other types of WhatsApp messages (audio, video, document, location, etc)
+ },
+}).listen();
+```
diff --git a/apps/docs/integrations/apis/whatsapp/actions/audio-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/audio-message.mdx
new file mode 100644
index 00000000000..e031bcaeb6f
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/audio-message.mdx
@@ -0,0 +1,94 @@
+---
+title: "Send Audio Message"
+sidebarTitle: "Audio Message"
+description: "Post a audio message to WhatsApp"
+---
+
+Send WhatsApp audio messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The url of the audio file to be sent.
+
+
+
+ Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendAudio } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an automatic audio reply to the message
+ const audioResponse = await sendAudio("audio", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ url: "https://ssl.gstatic.com/dictionary/static/pronunciation/2022-03-02/audio/wi/wikipedia_en_gb_1.mp3",
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/contacts-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/contacts-message.mdx
new file mode 100644
index 00000000000..c3aa6c8b3b0
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/contacts-message.mdx
@@ -0,0 +1,103 @@
+---
+title: "Send a Contacts Message"
+sidebarTitle: "Contacts Message"
+description: "Post a contacts message to WhatsApp"
+---
+
+Send WhatsApp contacts messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ An array of contacts to be sent.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendVideo } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an contacts message
+ const contactsResponse = await sendContacts("contacts", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ contacts: [
+ {
+ name: {
+ first_name: "Matt",
+ last_name: "Aitken",
+ formatted_name: "Matt Aitken",
+ },
+ phones: [
+ {
+ phone: "+12345678901",
+ },
+ ],
+ },
+ ],
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/document-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/document-message.mdx
new file mode 100644
index 00000000000..2663d513994
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/document-message.mdx
@@ -0,0 +1,99 @@
+---
+title: "Send Document Message"
+sidebarTitle: "Document Message"
+description: "Post a document message to WhatsApp"
+---
+
+Send WhatsApp document messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The url of the document to be sent.
+
+
+
+ Optional caption that sits below the video
+
+
+
+ Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendDocument } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an automatic document reply to the message
+ const documentResponse = await sendDocument("doc", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ url: "https://upload.wikimedia.org/wikipedia/commons/2/20/Re_example.pdf",
+ caption: "A pdf for you",
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/image-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/image-message.mdx
new file mode 100644
index 00000000000..0c8ded7029c
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/image-message.mdx
@@ -0,0 +1,99 @@
+---
+title: "Send Image Message"
+sidebarTitle: "Image Message"
+description: "Post a image message to WhatsApp"
+---
+
+Send WhatsApp image messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The url of the image to be sent.
+
+
+
+ Optional caption that sits below the video
+
+
+
+ Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendImage } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an automatic image reply to the message
+ const imageResponse = await sendImage("image", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ url: "https://app.trigger.dev/emails/logo.png",
+ caption: "This is a great caption",
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/location-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/location-message.mdx
new file mode 100644
index 00000000000..5ccda6f9e30
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/location-message.mdx
@@ -0,0 +1,109 @@
+---
+title: "Send a Location Message"
+sidebarTitle: "Location Message"
+description: "Post a location message to WhatsApp"
+---
+
+Send WhatsApp location messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The latitude of the location to be sent.
+
+
+
+ The latitude of the location to be sent.
+
+
+
+ Name of the location. An address must be specified for this to appear.
+
+
+
+ The address of the location, in a single string.
+
+
+
+ Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendVideo } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an location message
+ const locationResponse = await sendLocation("location", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ latitude: 37.422,
+ longitude: -122.084,
+ name: "Trigger.dev HQ",
+ address: "123 Main St, San Francisco, CA 94105",
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/reaction-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/reaction-message.mdx
new file mode 100644
index 00000000000..ec80438a9c2
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/reaction-message.mdx
@@ -0,0 +1,95 @@
+---
+title: "Send a Reaction Message"
+sidebarTitle: "Reaction Message"
+description: "Post a reaction to a WhatsApp message"
+---
+
+Send WhatsApp reaction messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The emoji you want to react to the message with 🔥
+
+
+
+ This is required: add the id of the message you want to reply to.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendVideo } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an automatic reaction to the message
+ const reactionResponse = await sendReaction("reaction", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ isReplyTo: event.message.id,
+ emoji: "🔥",
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/sticker-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/sticker-message.mdx
new file mode 100644
index 00000000000..c5f863fef07
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/sticker-message.mdx
@@ -0,0 +1,98 @@
+---
+title: "Send a Sticker Message"
+sidebarTitle: "Sticker Message"
+description: "Post a sticker message to WhatsApp"
+---
+
+Send WhatsApp sticker messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The url of the image to be sent. Please note that only webp files will work for stickers.
+
+
+
+ Optional caption that sits below the video
+
+
+
+ Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendVideo } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an automatic sticker to the message
+ const stickerResponse = await sendSticker("stick", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ url: "https://www.tyntec.com/sites/default/files/2020-07/tyntec_rocket_sticker_512px_001_.webp",
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/template-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/template-message.mdx
new file mode 100644
index 00000000000..09b54fec58f
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/template-message.mdx
@@ -0,0 +1,178 @@
+---
+title: "Send Template Message"
+sidebarTitle: "Template Message"
+description: "Post a template message to WhatsApp"
+---
+
+Send WhatsApp template messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The name of the template you want to send. Note that these have to be approved by Meta before they can be used. You can find this in the your WhatsApp Business dashboard.
+
+
+
+ The language code of the template you want to send, e.g. "en_US". You can find this in the your WhatsApp Business dashboard.
+
+
+
+ You can customise the message by providing values for variables in the template. There are three sections header, body and buttons. [Full WhatsApp documentation](https://developers.facebook.com/micro_site/url/?click_from_context_menu=true&country=GB&destination=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fwhatsapp%2Fapi%2Fmessages%2Fmessage-templates%2F%23local&event_type=click&last_nav_impression_id=1gi9JORcnblgd3gKs&max_percent_page_viewed=52&max_viewport_height_px=1272&max_viewport_width_px=2560&orig_http_referrer=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fwhatsapp%2Fapi%2Fmessages%2Fmessage-templates%2F&orig_request_uri=https%3A%2F%2Fdevelopers.facebook.com%2Fajax%2Fdocs%2Fnav%2F%3Fpath1%3Dwhatsapp%26path2%3Dapi%26path3%3Dmessages%26path4%3Dmessage-templates®ion=emea&scrolled=true&session_id=1p7ElKefs7QDpKC36&site=developers)
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendText } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send a templated message, with variables
+ //in this example we have included are the possible variables (mostly commented out)
+ const templateResponse = await sendTemplate("template-msg", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ //this template must be approved in your WhatsApp Business Account
+ template: "hello_world",
+ languageCode: "en_US",
+ //you only need to include these if your template has variables
+ parameters: {
+ //only include this if your header has variables, they can be text, image, video or document
+ header: [
+ {
+ type: "text",
+ text: "Matt",
+ },
+ // {
+ // type: "image",
+ // image: {
+ // link: "https://app.trigger.dev/emails/logo.png",
+ // caption: "This is a logo",
+ // },
+ // },
+ // {
+ // type: "video",
+ // video: {
+ // link: "https://media.giphy.com/media/5i7umUqAOYYEw/giphy.mp4",
+ // caption: "This is a fun video",
+ // },
+ // },
+ // {
+ // type: "document",
+ // video: {
+ // link: "https://upload.wikimedia.org/wikipedia/commons/2/20/Re_example.pdf",
+ // caption: "This is a document",
+ // },
+ // },
+ ],
+ //only include this if the body of your message has variables. They can be text, currency, date_time
+ body: [
+ {
+ type: "text",
+ text: "Matt",
+ },
+ // {
+ // type: "currency",
+ // currency: {
+ // amount_1000: 1000,
+ // code: "USD",
+ // fallback_value: "1000 USD",
+ // },
+ // },
+ // {
+ // type: "date_time",
+ // date_time: {
+ // fallback_value: "2021-01-01",
+ // },
+ // }
+ ],
+ //only include this if the buttons of your message have variables. They can be quick_reply or call_to_action
+ buttons: [
+ {
+ sub_type: "quick_reply",
+ parameters: [
+ {
+ type: "payload",
+ payload: "buy",
+ },
+ // {
+ // type: "text",
+ // text: "Buy now!",
+ // },
+ ],
+ },
+ {
+ sub_type: "call_to_action",
+ parameters: [
+ {
+ type: "text",
+ text: "Buy now!",
+ },
+ ],
+ },
+ ],
+ },
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/text-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/text-message.mdx
new file mode 100644
index 00000000000..2a07935c06e
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/text-message.mdx
@@ -0,0 +1,96 @@
+---
+title: "Send Text Message"
+sidebarTitle: "Text Message"
+description: "Post a text message to WhatsApp"
+---
+
+Send WhatsApp text messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The text of the message to be sent.
+
+
+
+ Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendText } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an automatic reply to the message
+ const textResponse = await sendText("text-msg", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ text: "Hello! This is a text sent automatically from https://www.trigger.dev",
+ //this is optional – if set, the message will appear quoting the original message
+ isReplyTo: event.message.id,
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/actions/video-message.mdx b/apps/docs/integrations/apis/whatsapp/actions/video-message.mdx
new file mode 100644
index 00000000000..4c5b306cfb4
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/actions/video-message.mdx
@@ -0,0 +1,99 @@
+---
+title: "Send Video Message"
+sidebarTitle: "Video Message"
+description: "Post a video message to WhatsApp"
+---
+
+Send WhatsApp video messages from your WhatsApp Business Account.
+
+## Params
+
+
+ A unique string. Please see the [Keys and Resumability](/guides/resumability)
+ doc for more info.
+
+
+
+
+
+ The id of the phone number you want to send the message from. You can find this in the your WhatsApp Business dashboard. Note, this is not the phone number.
+
+
+
+ The phone number you want to send the message to.
+
+
+
+ The url of the video to be sent.
+
+
+
+ Optional caption that sits below the video
+
+
+
+ Optionally, add the id of the message you want to reply to. It will appear as a reply in the WhatsApp chat.
+
+
+
+
+
+## Response
+
+
+ The contact information of who received the message
+
+
+
+ An array of message ids that were sent
+
+
+
+ Always `whatsapp`
+
+
+## Example Workflows
+
+### Notify Slack on New GitHub Star
+
+
+
+```typescript Automated reply to WhatsApp messages
+import { Trigger } from "@trigger.dev/sdk";
+import { events, sendVideo } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //send an automatic video reply to the message
+ const videoResponse = await sendVideo("video", {
+ fromId: event.metadata.phone_number_id,
+ to: event.message.from,
+ url: "https://media.giphy.com/media/5i7umUqAOYYEw/giphy.mp4",
+ caption: "OMGGGG CATTTT",
+ });
+ },
+}).listen();
+```
+
+```json Example response
+{
+ "contacts": [
+ {
+ "input": "12345678901",
+ "wa_id": "12345678901"
+ }
+ ],
+ "messages": [
+ {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+ }
+ ],
+ "messaging_product": "whatsapp"
+}
+```
+
+
diff --git a/apps/docs/integrations/apis/whatsapp/events/message.mdx b/apps/docs/integrations/apis/whatsapp/events/message.mdx
new file mode 100644
index 00000000000..c15d446a58e
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/events/message.mdx
@@ -0,0 +1,106 @@
+---
+title: "Message Event"
+sidebarTitle: "Message"
+description: "Trigger a workflow whenever a WhatsApp message is received in your WhatsApp Business Account"
+---
+
+## Usage
+
+```ts
+import { Trigger } from "@trigger.dev/sdk";
+import { events } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //your workflow code here
+ },
+}).listen();
+```
+
+## Params
+
+
+ Your WhatsApp Business Account id
+
+
+## Event
+
+
+ The message object has the type of message (e.g. text, video, audio etc) and
+ the message content.
+
+
+
+ The contact information of the sender.
+
+
+
+ Information about the account and phone number that received the message, i.e.
+ your WhatsApp Business Account details.
+
+
+## Example Workflows
+
+
+
+```typescript post a message to your support Slack channel
+import { Trigger } from "@trigger.dev/sdk";
+import { events } from "@trigger.dev/whatsapp";
+
+new Trigger({
+ id: "demo",
+ on: events.messageEvent({
+ accountId: "",
+ }),
+ run: async (event, ctx) => {
+ //get the user from your database, using the phone number
+ const user = await db.getUser({ phoneNumber: event.message.from });
+
+ if (!user) {
+ await ctx.logger.error(`No user to phone number ${event.message.from}`);
+ return;
+ }
+
+ //post a message to your support Slack channel
+ await slack.postMessage({
+ channel: "support",
+ text: `Support message from ${user.name} (${user.email})\n${event.message.body}`,
+ });
+ },
+}).listen();
+```
+
+
+
+## Example Event payload
+
+```json
+{
+ "type": "message",
+ "message": {
+ "id": "wamid.ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ "from": "12345678901",
+ "text": {
+ "body": "The quick brown fox jumps over the lazy dog"
+ },
+ "type": "text",
+ "timestamp": 1675257050000
+ },
+ "contacts": [
+ {
+ "wa_id": "12345678901",
+ "profile": {
+ "name": "Matt Aitken"
+ }
+ }
+ ],
+ "metadata": {
+ "phone_number_id": "987654321012",
+ "display_phone_number": "15550676999"
+ }
+}
+```
diff --git a/apps/docs/integrations/apis/whatsapp/index.mdx b/apps/docs/integrations/apis/whatsapp/index.mdx
new file mode 100644
index 00000000000..4ae94d9a3ca
--- /dev/null
+++ b/apps/docs/integrations/apis/whatsapp/index.mdx
@@ -0,0 +1,9 @@
+---
+title: "WhatsApp reference"
+sidebarTitle: "Reference"
+description: "Reference for the WhatsApp integration"
+---
+
+Navigate through the following pages for the full reference for the WhatsApp integration.
+
+Or [view the examples](/examples/whatsapp) of how to use the WhatsApp integration.
diff --git a/apps/docs/mint.json b/apps/docs/mint.json
index 2f53c06a1f9..3ded96c3a52 100644
--- a/apps/docs/mint.json
+++ b/apps/docs/mint.json
@@ -55,10 +55,11 @@
"group": "Example workflows",
"pages": [
"examples/examples",
- "examples/slack",
"examples/github",
"examples/shopify",
- "examples/resend"
+ "examples/slack",
+ "examples/resend",
+ "examples/whatsapp"
]
},
{
@@ -75,6 +76,23 @@
{
"group": "APIs",
"pages": [
+ {
+ "group": "GitHub",
+ "pages": [
+ {
+ "group": "Events",
+ "pages": [
+ "integrations/apis/github/events/issue-comments",
+ "integrations/apis/github/events/issues",
+ "integrations/apis/github/events/new-star",
+ "integrations/apis/github/events/pull-request-comments",
+ "integrations/apis/github/events/pull-request-reviews",
+ "integrations/apis/github/events/pull-requests",
+ "integrations/apis/github/events/push"
+ ]
+ }
+ ]
+ },
{
"group": "Slack",
"pages": ["integrations/apis/slack/actions/post-message"]
@@ -82,6 +100,30 @@
{
"group": "Resend.com",
"pages": ["integrations/apis/resend/actions/send-email"]
+ },
+ {
+ "group": "WhatsApp",
+ "pages": [
+ "integrations/apis/whatsapp/index",
+ {
+ "group": "Events",
+ "pages": ["integrations/apis/whatsapp/events/message"]
+ },
+ {
+ "group": "Actions",
+ "pages": [
+ "integrations/apis/whatsapp/actions/text-message",
+ "integrations/apis/whatsapp/actions/reaction-message",
+ "integrations/apis/whatsapp/actions/audio-message",
+ "integrations/apis/whatsapp/actions/video-message",
+ "integrations/apis/whatsapp/actions/document-message",
+ "integrations/apis/whatsapp/actions/sticker-message",
+ "integrations/apis/whatsapp/actions/template-message",
+ "integrations/apis/whatsapp/actions/location-message",
+ "integrations/apis/whatsapp/actions/contacts-message"
+ ]
+ }
+ ]
}
]
},
diff --git a/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/index.tsx b/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/index.tsx
index 377d5bce542..e533adcda24 100644
--- a/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/index.tsx
+++ b/apps/webapp/app/routes/__app/orgs/$organizationSlug/workflows/$workflowSlug/index.tsx
@@ -107,7 +107,10 @@ export default function Page() {
URL