# Slack webhook trigger

> Run a workflow on Slack Events API events: messages and any event your Slack app subscribes to, with signature verification.

Source: https://cotera.co/docs/reference/webhooks/slack

---

Run a workflow on Slack activity — a message posted, a mention, any event your Slack app subscribes to. The Slack Events API envelope becomes the workflow's input.

For behavior shared by every provider (the delivery URL, testing), see the [webhook triggers reference](https://cotera.co/docs/reference/webhooks.md).

## Setup

Slack sends events to a **Request URL** you configure on a Slack app, so you wire it up in Slack:

1. Add a **From an app** trigger and pick **Slack**. Cotera gives you a delivery URL.
2. In your Slack app's **Event Subscriptions**, set the **Request URL** to Cotera's URL.
3. Subscribe to the events you want (for example `message.channels`). Slack only sends the events you subscribe to.

There's nothing to tear down on Cotera's side; remove the subscription in Slack to stop deliveries.

## Events

The Slack trigger is a passthrough: **every event Slack delivers runs the workflow**. There's no per-event filtering in Cotera — you scope what fires by choosing which events to subscribe to in Slack (and, if needed, by branching inside the workflow on `event.type`).

## Payload

The raw Slack Events API `event_callback` envelope is passed through as the workflow input. A message event looks like:

```json
{
  "token": "cotera-test-verification-token",
  "team_id": "T0123456789",
  "api_app_id": "A0123456789",
  "type": "event_callback",
  "event_id": "Ev0123456789",
  "event_time": 1716111111,
  "event": {
    "type": "message",
    "channel": "C0123456789",
    "user": "U0123456789",
    "text": "Hello from Cotera",
    "ts": "1716111111.000100",
    "channel_type": "channel"
  },
  "authorizations": [
    { "enterprise_id": null, "team_id": "T0123456789", "user_id": "U0123456789", "is_bot": true }
  ]
}
```

| Field                    | Description                                                                               |
| ------------------------ | ----------------------------------------------------------------------------------------- |
| `type`                   | The envelope type — `event_callback` for a delivered event.                               |
| `event`                  | The actual event: its `type` (e.g. `message`), `channel`, `user`, `text`, and timestamps. |
| `event_id`               | Slack's unique event id, used to deduplicate retries.                                     |
| `team_id` / `api_app_id` | The workspace and Slack app the event came from.                                          |

## Signature verification

Slack signs each delivery with the `X-Slack-Signature` header in the form `v0=<hex>` — an HMAC-SHA256 over `v0:{timestamp}:{body}`, where the timestamp comes from the `X-Slack-Request-Timestamp` header. Cotera verifies it against the trigger's signing secret on every delivery and rejects anything that fails.

