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

# Slack Integration

Connect Slack to receive documentation notifications, get help from the AI assistant, and manage agent suggestions.

## Overview

The HolyDocs Slack integration connects your workspace to your documentation project, enabling:

- AI-powered help responses when team members ask documentation questions
- Notifications when agent jobs complete
- Interactive approval of agent suggestions
- Deployment status alerts

## Setting Up

**Navigate to Integrations**

In your project dashboard, go to **Integrations > Slack**.
  **Install the Slack App**

Click **Add to Slack**. This initiates the Slack OAuth flow and installs the HolyDocs bot in your workspace.
  **Choose a Channel**

Select the channel where the bot should post notifications. The bot can also respond to direct messages.
  **Configure Events**

Choose which events trigger Slack notifications:
    - Deployment completed/failed
    - Agent job completed
    - Agent suggestion pending review

## Help Bot

The Slack bot automatically detects help requests in channels where it is installed. When someone asks a documentation question, the bot:

1. Detects the question pattern using `isHelpRequest()` analysis
2. Searches your documentation using the RAG pipeline
3. Returns a formatted answer with links to relevant docs pages

Example interaction:

```
User: How do I set up a custom domain in HolyDocs?

HolyDocs Bot: To set up a custom domain:
1. Go to Settings > Domains in your project dashboard
2. Enter your custom domain (e.g., docs.yourcompany.com)
3. Add a CNAME record pointing to proxy.holydocs.com
4. Wait for DNS verification and automatic SSL provisioning

📄 Read more: Custom Domains (https://docs.holydocs.com/custom-domains)
```

The bot distinguishes between help requests and agent requests. Questions about documentation content trigger the RAG pipeline, while requests to fix or update docs are routed to the AI agent.

## Agent Notifications

When an AI agent job completes, the bot posts a summary to the configured channel:

```
🤖 Agent Job Completed
Project: My API Docs
Prompt: "Check all links and fix broken ones"
Status: Completed
Suggestions: 3 pending review
Time: 45 seconds
```

## Interactive Approvals

Agent suggestions can be approved or rejected directly from Slack:

- Each suggestion includes a diff preview
- **Approve** button commits the change to your repository
- **Reject** button dismisses the suggestion
- **View Details** links to the full suggestion in the dashboard

## Webhook Events

| Event | Slack Message |
|---|---|
| `deployment.completed` | Build successful notification with deployment URL |
| `deployment.failed` | Build failure alert with error details |
| `agent.job.completed` | Job summary with suggestion count |
| `feedback.received` | Reader feedback notification |

## Slack Routes

The Slack integration uses these API endpoints:

- `POST /api/v1/slack/oauth` — OAuth callback for app installation
- `POST /api/v1/slack/events` — Slack Events API endpoint

Slack routes skip the dashboard session authentication since they receive requests from Slack's servers. They're verified by HMAC-SHA256 signature checking against the signing secret instead.

## Disconnecting

To remove the Slack integration:

1. Go to **Integrations > Slack** in the dashboard
2. Click **Disconnect**
3. Optionally remove the HolyDocs app from your Slack workspace settings