# Update Message — Bot for Slack

> Update a message (Bot). See the documentation

- Key: `slack_bot-update-message`
- Type: Action (Write)
- Version: 0.0.5
- App: Bot for Slack (`slack_bot`) — https://pipedream.com/apps/slack-bot.md
- This page (HTML): https://pipedream.com/apps/slack-bot/actions/update-message
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/slack_bot/actions/update-message/update-message.mjs

## Description

Update a message (Bot). [See the documentation](https://api.slack.com/methods/chat.update)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `conversation` | `string` | Yes | Select a public or private channel, or a user or group. In order to list a Slack channel, your bot must be a member of that channel, and in order to list private channels, your bot must have the groups:read scope in the OAuth & Permissions settings in Slack for this bot. Options are loaded from the connected account. |
| `timestamp` | `string` | Yes | Timestamp of a message. e.g. 1403051575.000407. |
| `text` | `string` | Yes | Text of the message to send (see Slack's formatting docs). This field is usually necessary, unless you're providing only attachments instead. |
| `attachments` | `string` | No | A JSON-based array of structured attachments, presented as a URL-encoded string (e.g., [{"pretext": "pre-hello", "text": "text-world"}]). |

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

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: "slack_bot-update-message",
  arguments: {
    conversation: "Channel",
    timestamp: "Message Timestamp",
  },
})
```

**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: "slack_bot-update-message",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    slack_bot: { authProvisionId: "apn_xxxxxxx" },
    conversation: "Channel",
    timestamp: "Message Timestamp",
  },
})

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": "slack_bot-update-message",
    "configured_props": {
      "slack_bot": { "authProvisionId": "apn_xxxxxxx" },
      "conversation": "Channel",
      "timestamp": "Message Timestamp"
    }
  }'
```

---

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