# Verify Slack Signature — Slack

> Verifying requests from Slack, slack signs its requests using a secret that's unique to your app. Request Body must be the raw request body as a string (not a parsed object) — Slack computes its signature over the exact raw bytes it sent…

- Key: `slack_v2-verify-slack-signature`
- Type: Action (Read-only)
- Version: 1.0.4
- App: Slack (`slack_v2`) — https://pipedream.com/apps/slack-v2.md
- This page (HTML): https://pipedream.com/apps/slack-v2/actions/verify-slack-signature
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/slack_v2/actions/verify-slack-signature/verify-slack-signature.mjs

## Description

Verifying requests from Slack, slack signs its requests using a secret that's unique to your app. `Request Body` must be the raw request body as a string (not a parsed object) — Slack computes its signature over the exact raw bytes it sent, so re-serializing a parsed object will not match. [See the documentation](https://api.slack.com/authentication/verifying-requests-from-slack)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `slackSigningSecret` | `string` | Yes | Slack Signing Secret, available in the app admin panel under Basic Info. |
| `slackSignature` | `string` | Yes | Slack signature (from X-Slack-Signature header). |
| `slackRequestTimestamp` | `string` | Yes | Slack request timestamp (from X-Slack-Request-Timestamp header). |
| `requestBody` | `string` | Yes | The body of the request to be verified. |

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

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_v2-verify-slack-signature",
  arguments: {
    slackSigningSecret: "Signing Secret",
    slackSignature: "X-Slack-Signature",
  },
})
```

**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_v2-verify-slack-signature",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    slack_v2: { authProvisionId: "apn_xxxxxxx" },
    slackSigningSecret: "Signing Secret",
    slackSignature: "X-Slack-Signature",
  },
})

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_v2-verify-slack-signature",
    "configured_props": {
      "slack_v2": { "authProvisionId": "apn_xxxxxxx" },
      "slackSigningSecret": "Signing Secret",
      "slackSignature": "X-Slack-Signature"
    }
  }'
```

---

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