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

# Discord

> Set up Discord channel posting with an incoming webhook URL.

The Discord lane publishes to a channel through an incoming webhook. It publishes only once a Discord credential is present in your `.env`; until then the lane is live-but-unauthenticated and waits for you to connect it (set `PENDPOST_MODE=mock` to exercise it through the mock driver).

You own your Discord server and webhook and are responsible for Discord's terms of service. pendpost drafts and schedules, but a human approves before anything goes live.

## Setup ceremony

There is no OAuth and no token to mint. The webhook URL is the credential.

1. **Create a channel webhook.** In your Discord server, open the target channel's settings, go to Integrations, then Webhooks, and create a new webhook. Name it (for example pendpost) and pick the channel it posts to.
2. **Copy the full webhook URL.** Click "Copy Webhook URL" and copy the entire value; it ends in a long token. A truncated URL fails with "Invalid Webhook Token".

Then confirm the webhook resolves:

```bash theme={null}
node scripts/discord-social.mjs auth
```

## Environment variables

| Variable | Purpose |
| - | - |
| `DISCORD_WEBHOOK_URL` | The full incoming-webhook URL for the channel, including its token. |

> [!NOTE]
>
> A lane publishes only once its credential is present. If the Discord variable is blank, the Discord lane is live-but-unauthenticated and waits for you to connect it. Set `PENDPOST_MODE=mock` to exercise it through the mock driver.

## Validate the lane

A present credential is not the same as a working one. After setup, validate the Discord lane in the **Setup** tab, or run a live probe with the `health_recheck` tool, to confirm the credential is live and not just configured. The lane is ready when it reports live.

> [!NOTE]
>
> **Over MCP.** Setup and rotation are an interactive human ceremony; secrets are never written through MCP. An agent can still check status (`account_status`), run a live liveness probe (`health_recheck`), and read non-secret config (`config_get`) over MCP without touching credentials.

## Common failures

| Symptom | Cause | Fix |
| - | - | - |
| Publishing returns "Invalid Webhook Token". | The webhook URL was copied incompletely, or the webhook was deleted. | Recreate or re-copy the full webhook URL (channel Integrations, then Webhooks), update `DISCORD_WEBHOOK_URL`, and re-run the auth check. |
| Posts 404 after working before. | The webhook (or its channel) was deleted in Discord. | Create a new webhook on the channel and update `DISCORD_WEBHOOK_URL`. |


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