# Send WhatsApp Message — BotPenguin

> Sends a WhatsApp message. See the documentation

- Key: `botpenguin-send-whatsapp-message`
- Type: Action (Write)
- Version: 0.0.3
- App: BotPenguin (`botpenguin`) — https://pipedream.com/apps/botpenguin.md
- This page (HTML): https://pipedream.com/apps/botpenguin/actions/send-whatsapp-message
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/botpenguin/actions/send-whatsapp-message/send-whatsapp-message.mjs

## Description

Sends a WhatsApp message. [See the documentation](https://help.botpenguin.com/api-references/whatsapp-cloud-api/post-send-message-api)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `apiKey` | `string` | Yes | The bot's api key Click here for further information. |
| `userName` | `string` | No | The name of the user to whom the message is being sent. |
| `waId` | `string` | Yes | The WhatsApp number of the user to whom the message is being sent. The number must contain the country code without the plus sign. |
| `message` | `string` | No | The message that needs to sent. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "botpenguin",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "botpenguin-send-whatsapp-message",
  arguments: {
    apiKey: "Api Key",
    userName: "Username",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "botpenguin-send-whatsapp-message",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    botpenguin: { authProvisionId: "apn_xxxxxxx" },
    apiKey: "Api Key",
    userName: "Username",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "botpenguin-send-whatsapp-message",
    "configured_props": {
      "botpenguin": { "authProvisionId": "apn_xxxxxxx" },
      "apiKey": "Api Key",
      "userName": "Username"
    }
  }'
```

---

- App: https://pipedream.com/apps/botpenguin.md · All apps: https://pipedream.com/apps
