> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ziplined.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

> Post new qualified leads from one audience into a Slack channel.

Use the Slack integration when you want a message in a channel as soon as someone qualifies
as a lead.

## Before you connect

* A key with scope `write`.
* A Slack incoming webhook URL, from **Incoming Webhooks** in your Slack app configuration.
* An audience. `new_qualified_lead` hangs off one.

## Connect Slack

**1. Find the audience id**

```bash theme={null}
curl -H "Authorization: Bearer $ZIPLINED_API_KEY" \
  "https://api.ziplined.io/v1/audiences?limit=50"
```

```json theme={null}
{
  "data": [
    { "id": "c41d...", "name": "NL SaaS founders", "people_count": 184, "companies_count": 96 }
  ],
  "next_cursor": null
}
```

**2. Connect the destination**

```bash theme={null}
curl -X POST https://api.ziplined.io/v1/integrations \
  -H "Authorization: Bearer $ZIPLINED_API_KEY" \
  -H "Idempotency-Key: 5d6e7f80-1a2b-4c3d-8e9f-0a1b2c3d4e5f" \
  -H "Content-Type: application/json" \
  -d '{
        "provider": "slack",
        "config": {
          "webhook_url": "https://hooks.slack.com/services/T000/B000/XXXX",
          "channel_label": "#leads"
        }
      }'
```

The answer carries the destination id. `secret` is `null`: only webhook destinations
have a signing secret.

**3. Add the rule**

```bash theme={null}
curl -X POST https://api.ziplined.io/v1/integrations/9a3c.../rules \
  -H "Authorization: Bearer $ZIPLINED_API_KEY" \
  -H "Idempotency-Key: 6e7f8091-2b3c-4d5e-9f01-1b2c3d4e5f60" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "newQualifiedLeads",
        "event": "new_qualified_lead",
        "audience_id": "c41d...",
        "filter": { "min_fit_tier": "high" },
        "min_interval_minutes": 60,
        "is_active": true
      }'
```

`min_interval_minutes: 60` batches to at most one message an hour. Use `0` for
immediate, or `1440` with `send_hour_utc` for one digest a day.

## Verify it works

```bash theme={null}
curl -X POST https://api.ziplined.io/v1/integrations/9a3c.../test \
  -H "Authorization: Bearer $ZIPLINED_API_KEY"
```

A short test message goes to the channel and you get `{ "ok": true, "status": 200 }` back.
If Slack refuses, `ok` is `false` inside a 200 and `body` says why.

## Pause the rule

```bash theme={null}
curl -X PATCH https://api.ziplined.io/v1/integrations/9a3c.../rules/4b2e... \
  -H "Authorization: Bearer $ZIPLINED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "is_active": false }'
```

The cursor and the watermark stay where they are. A rule you switch off for a week does not
dump that week into the channel later.

## Troubleshoot

Settings, Integrations, Slack lists the recent deliveries, with a "Failed only" switch.
`response_ref` carries what Slack said back. More on [Reliability](https://docs.ziplined.io/webhooks/reliability.md).

> [accordion] Nothing arrives at all
>
> A destination whose last ten deliveries were all `dead` flips to `status: "error"`. That
> usually means the Slack webhook URL was revoked.
>
> `config_summary` shows the host, never the URL itself, so a later `GET` cannot hand your
> Slack webhook to anyone.
>
> Posting a second Slack destination updates the first. There is one per provider per
> workspace.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.