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

# Slack Integration

> Receive real-time alerts and notifications in your Slack workspace

## Overview

Connect Slack to receive real-time notifications when customer health changes, clients become at-risk, or important events occur. Slack is an output-only integration—Stanna sends alerts to your channels but doesn't collect any data from Slack.

## Features

<CardGroup cols={2}>
  <Card title="Real-time Alerts" icon="bell">
    Instant notifications when health scores drop or clients show churn risk
  </Card>

  <Card title="Event Notifications" icon="message">
    Get notified of important client events, milestones, and interactions
  </Card>

  <Card title="Custom Channels" icon="hashtag">
    Route different alert types to specific Slack channels
  </Card>

  <Card title="No Data Collection" icon="shield-check">
    Output-only integration—Stanna never reads your Slack messages
  </Card>
</CardGroup>

## Setting Up Slack Integration

### Prerequisites

Before connecting Slack:

* [ ] Slack workspace admin permissions (to install apps)
* [ ] Identify which channel(s) should receive notifications
* [ ] Understanding of what types of alerts you want to receive

### Connection Process

<Steps>
  <Step title="Initiate OAuth Flow">
    Navigate to `/api/integrations/slack/start` or click "Connect Slack" in integrations
  </Step>

  <Step title="Authorize Access">
    Sign in to your Slack workspace and grant Stanna permission to:

    * Post messages to channels
    * Access basic workspace information
    * View channel list (for channel selection)

    **Note**: Stanna will NOT read any messages or channel content
  </Step>

  <Step title="Select Notification Channel">
    Choose which Slack channel should receive notifications:

    * Create a dedicated channel like `#customer-health`
    * Use an existing channel like `#cs-alerts`
    * Configure different channels for different alert types (optional)
  </Step>

  <Step title="Verify Connection">
    Check status at `/api/integrations/slack/status` to confirm:

    * Active connection status
    * Connected workspace name
    * Selected notification channel
  </Step>
</Steps>

## What Data is Synced

### No Data Collection

**Important**: Slack is an output-only integration. Stanna:

* ✅ **Sends** notifications and alerts TO Slack
* ❌ **Does NOT read** any Slack messages
* ❌ **Does NOT collect** conversation data
* ❌ **Does NOT access** message history

### What Stanna Sends to Slack

Notifications are sent for key events:

* **Health score changes**: When a client's health score drops significantly
* **Churn risk alerts**: Clients identified as at-risk of churning
* **Payment issues**: Failed payments or billing problems (from Stripe integration)
* **Engagement changes**: Sudden drops in client activity
* **Sentiment alerts**: Detection of frustrated or unhappy customers

## How Slack Notifications Work

### Alert Types

Different events trigger different notification formats:

**Health Score Alerts**

* Triggered when health score drops below configured thresholds
* Includes client name, current score, and reason for decline
* Provides quick action links to client profile

**Churn Risk Notifications**

* Sent when AI identifies high churn probability
* Includes risk factors and recommended actions
* Links to client details and interaction history

**Payment Issues**

* Alerts for failed payments or past due subscriptions (requires Stripe)
* Includes payment status and customer contact info
* Quick links to Stripe dashboard and client profile

**Engagement Warnings**

* Notifies when client engagement drops significantly
* Shows engagement trends and comparison to baseline
* Suggests re-engagement strategies

### Notification Frequency

Control how often you receive alerts:

* **Real-time**: Critical events sent immediately
* **Daily Digest**: Summary of health changes once per day
* **Weekly Summary**: Overview of portfolio health and trends
* **Custom Rules**: Configure thresholds for specific alert types

### Message Format

Slack notifications are designed for quick action:

* **Clear subject line**: Understand the issue at a glance
* **Key metrics**: Health score, MRR, engagement level
* **Context**: Why the alert was triggered
* **Action buttons**: Quick links to investigate or respond
* **Urgency indicators**: Visual cues for priority level

## Use Cases

### Customer Success Teams

**Proactive Outreach**

* Get notified when clients need attention
* Route alerts to responsible CSM based on account owner
* Track intervention effectiveness over time

**Portfolio Monitoring**

* Daily digest of portfolio health changes
* Weekly summaries for leadership
* Alerts for at-risk high-value accounts

### Account Management

**Expansion Opportunities**

* Notifications when clients show positive engagement
* Alerts for upsell readiness indicators
* Milestone celebrations (anniversaries, usage goals)

**Retention Focus**

* Early warning for churn risk
* Payment issue alerts for quick resolution
* Sentiment monitoring for relationship health

### Leadership & Executives

**Strategic Insights**

* Weekly portfolio health summaries
* Churn risk trends and forecasts
* Revenue at risk notifications
* Key account status updates

## API Endpoints

### Core Integration

```
GET  /api/integrations/slack/start      # Start OAuth flow
GET  /api/integrations/slack/callback   # OAuth callback handling
GET  /api/integrations/slack/status     # Check connection status
POST /api/integrations/slack/disconnect # Remove integration
```

### Notification Management

```
POST /api/notifications/send            # Send custom notification
GET  /api/notifications/history         # View sent notifications
POST /api/notifications/configure       # Update notification settings
```

## Configuration & Settings

### Channel Configuration

Choose where notifications are sent:

* **Single channel**: All alerts to one channel
* **Multiple channels**: Different alert types to different channels
* **Private channels**: Supported with proper permissions
* **Direct messages**: Send alerts to specific users (optional)

### Alert Thresholds

Customize when alerts are triggered:

* **Health score drops**: Set threshold (e.g., drop of 10+ points)
* **Churn probability**: Alert above certain risk percentage
* **Engagement decline**: Percentage decrease that triggers alert
* **MRR at risk**: Dollar amount threshold for revenue alerts

### Notification Filtering

Control what alerts you receive:

* **Minimum MRR**: Only alert for clients above revenue threshold
* **Account tier**: Filter by enterprise, growth, or starter tiers
* **Health zone**: Only alert for red/yellow zone clients
* **Custom rules**: Advanced filtering with multiple conditions

## Troubleshooting

<AccordionGroup>
  <Accordion title="Not receiving Slack notifications">
    **Common Causes**:

    * Slack integration disconnected or permissions revoked
    * Channel permissions changed
    * Notification thresholds not being met
    * Bot removed from channel

    **Resolution Steps**:

    1. Check `/api/integrations/slack/status` for connection status
    2. Verify bot is still in the notification channel
    3. Review notification threshold settings
    4. Test with manual notification send
    5. Re-authenticate if connection is broken
  </Accordion>

  <Accordion title="Notifications going to wrong channel">
    **Fixing Channel Configuration**:

    1. Navigate to integrations settings
    2. Update channel selection in Slack configuration
    3. Verify bot has access to the new channel
    4. Test with a sample notification

    **Note**: You may need to invite the Stanna bot to private channels manually
  </Accordion>

  <Accordion title="Too many notifications">
    **Reducing Alert Frequency**:

    1. Increase alert thresholds (e.g., only alert for drops >15 points)
    2. Set minimum MRR threshold to filter small accounts
    3. Switch from real-time to daily digest mode
    4. Refine custom alert rules to be more specific

    **Best Practice**: Start with higher thresholds and adjust down as needed
  </Accordion>

  <Accordion title="Missing context in notifications">
    **Improving Alert Quality**:

    * Ensure other integrations (Gmail, HubSpot, etc.) are connected
    * Allow 24-48 hours for AI to gather sufficient context
    * Review client profiles to ensure basic info is populated
    * Contact support to customize notification templates
  </Accordion>
</AccordionGroup>

## Best Practices

<CardGroup cols={2}>
  <Card title="Dedicated Channel" icon="hashtag">
    Create a specific channel like `#customer-health` to keep alerts organized
  </Card>

  <Card title="Threshold Tuning" icon="sliders">
    Start with conservative thresholds and adjust based on alert usefulness
  </Card>

  <Card title="Team Visibility" icon="users">
    Make notification channel visible to entire CS team for transparency
  </Card>

  <Card title="Action Protocols" icon="list-check">
    Establish team protocols for responding to different alert types
  </Card>
</CardGroup>

## Advanced Configuration

### Custom Alert Rules

Create sophisticated notification logic:

* **Multiple conditions**: Combine health score, MRR, and engagement criteria
* **Time-based rules**: Different alerts for business hours vs. off-hours
* **Account-specific rules**: Custom alerts for VIP or strategic accounts
* **Escalation rules**: Send to different channels based on severity

### Webhook Integration

For advanced use cases:

* **Custom workflows**: Trigger automation when alerts fire
* **External integrations**: Forward notifications to other tools
* **Data capture**: Log alerts to external systems
* **Bi-directional sync**: Use webhooks to update Stanna from Slack actions (custom)

### Notification Templates

Customize message format and content:

* **Branded messages**: Add company logo and colors
* **Custom fields**: Include specific data points important to your team
* **Language/tone**: Adjust message style to match team culture
* **Action buttons**: Configure quick action links and buttons

## Security & Privacy

### Permissions

Stanna's Slack integration requires minimal permissions:

* **Post messages**: Send notifications to configured channels
* **View channels**: List channels for configuration (read-only names only)
* **Bot user**: Basic bot identity for posting

### Data Protection

Your Slack data remains private:

* **No message reading**: Stanna cannot and does not read Slack messages
* **No conversation access**: Chat history is never accessed
* **Output-only**: Integration only sends data, never receives
* **Audit trail**: All sent notifications are logged for compliance

### Compliance

Slack integration maintains security standards:

* **OAuth 2.0**: Secure authentication flow
* **Encrypted transmission**: All data sent over HTTPS
* **Token security**: OAuth tokens encrypted at rest
* **Revocable access**: Disconnect anytime from either platform

<Warning>
  **Bot Channel Access**: The Stanna bot must be added to your notification channel to send messages. If notifications stop, verify the bot wasn't removed from the channel.
</Warning>

<Info>
  **Need help with Slack setup?** Contact [support@gostanna.com](mailto:support@gostanna.com) for assistance with configuration or troubleshooting.
</Info>
