# Send Message to Group Chat — Beekeeper

> Send a precomposed message to a defined group chat. See the documentation

- Key: `beekeeper-send-message-group-chat`
- Type: Action (Write)
- Version: 0.0.2
- App: Beekeeper (`beekeeper`) — https://pipedream.com/apps/beekeeper.md
- This page (HTML): https://pipedream.com/apps/beekeeper/actions/send-message-group-chat
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/beekeeper/actions/send-message-group-chat/send-message-group-chat.mjs

## Description

Send a precomposed message to a defined group chat. [See the documentation](https://beekeeper.stoplight.io/docs/beekeeper-api/9075b32d36db4-send-a-message-to-a-group-chat)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `chatId` | `string` | Yes | The ID of the chat to send a message Options are loaded from the connected account. |
| `body` | `string` | No | The message body. Supports rich text formatting. |
| `attachment` | `object` | No | JSON object representing attachment. A valid attachment object can be created and fetched using the POST /files/{usage_type}/upload endpoint. |
| `eventType` | `string` | No | Type of event that the message corresponds to. |
| `chatStateAddons` | `string[]` | No | Array of objects containing type and data fields for chat state addons. |
| `messageAddons` | `string[]` | No | Array of objects containing type and data fields for message addons. |
| `mentions` | `string[]` | No | IDs of the users mentioned in the message body. Can also have value of 'all', which means all the chat members were mentioned. Options are loaded from the connected account. |

## 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": "beekeeper",
      },
    },
  },
)

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: "beekeeper-send-message-group-chat",
  arguments: {
    chatId: "Chat ID",
    body: "Body",
  },
})
```

**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: "beekeeper-send-message-group-chat",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    beekeeper: { authProvisionId: "apn_xxxxxxx" },
    chatId: "Chat ID",
    body: "Body",
  },
})

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": "beekeeper-send-message-group-chat",
    "configured_props": {
      "beekeeper": { "authProvisionId": "apn_xxxxxxx" },
      "chatId": "Chat ID",
      "body": "Body"
    }
  }'
```

---

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