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

# Webhooks

> Post as a webhook, let other apps post into your channels, and send your server's events to your own app.

**Dashboard → Content & tools → Webhooks** has four tabs:

| Tab | What it's for |
| - | - |
| **Server webhooks** | Make, rename and delete your server's own Discord webhooks |
| **Send as webhook** | Post or edit a message under any name and picture |
| **Incoming** | A link other apps (Ko-fi, GitHub, your game server) post to, and cure puts it in a channel |
| **Outgoing** | cure tells your own app when something happens, like a member joining |

> [!NOTE]
>
> cure needs the **Manage Webhooks** permission for the first two tabs. Incoming and outgoing webhooks work without it. Anyone with Automation access in [dashboard access](https://docs.curebot.site/start/dashboard-access.md) can use this page.

## Server webhooks

These are your server's normal Discord webhooks, the same ones in **Server Settings → Integrations**.

**1. Make one**

Give it a name, pick a channel and press **Make**.

**2. Change it**

Open it to change its name, picture or channel.

**3. Use it**

Press **Send** to post through it here, or copy its URL from Discord for another app.

> [!WARNING]
>
> Anyone with a webhook's URL can post through it. If a URL leaks, delete the webhook and make a new one.

## Send as webhook

Post a message that looks like it came from someone else: an announcer, a character, your brand. Pick the webhook, then:

* **Name for this message** and **Picture for this message**: change how it looks just this once. Leave them empty to use the webhook's own.
* **Message**: plain text, or a design from [Message Studio](https://docs.curebot.site/studio/messages.md) starting with `{embed}`. The preview beside it updates as you type.
* **Edit a message instead**: paste the link to a message this webhook sent, and cure changes it rather than posting a new one. This is the easiest way to keep a rules or info post up to date.

My AilmentAPPToday at 4:12 PM

Movie night is back

Friday at 8 PM in the cinema stage. Bring snacks.

## Incoming webhooks

An incoming webhook is a private link. Whatever another app POSTs to it, cure posts in your channel.

**1. Make one**

In **Incoming**, give it a name (like Ko-fi) and pick the channel it posts in. Press **Make**.

**2. Copy its URL**

It looks like `https://curebot.site/api/hooks/3f9a1c2b7d4e/…`. Paste it into the other app wherever it asks for a webhook URL.

**3. Choose what it posts**

Open the webhook and fill in **What to post**. Leave it empty to start; see the options below.

### What it posts

> [tab] Your own message
>
> Write the message with `{body.…}` for anything in what the app sends. If Ko-fi sends:
>
> ```json theme={null}
> { "from_name": "Ivan", "amount": "5.00", "message": "love the server!" }
> ```
>
> then this in **What to post**:
>
> ```
> ☕ **{body.from_name}** bought us a coffee ({body.amount})
> > {body.message}
> ```
>
> posts:
>
> Ko-fiAPPToday at 4:12 PM
>
> ☕ **Ivan** bought us a coffee (5.00)
>
> love the server!
>
> Nested fields use dots, like `{body.user.name}`. A [Message Studio](https://docs.curebot.site/studio/messages.md) design starting with `{embed}` works too, and `{hook.name}` is the webhook's name.

> [tab] Discord-shaped
>
> Leave **What to post** empty. If the app already sends Discord's own shape (`content` and `embeds`), cure posts it as it is. Many apps have a "Discord" option that sends exactly this.

> [tab] Anything else
>
> Leave **What to post** empty, and anything that isn't Discord-shaped is posted as formatted JSON. Handy for seeing what an app sends before you write your own message.

Each webhook can also post under its own name and picture (**Posts as** and **Picture**). Mentions in what's posted never ping anyone.

### Try it

Copy your incoming webhook's URL from the dashboard and replace the example URL below. Choose your shell; in Windows Terminal, match the profile shown on the tab.

> [tab] Bash / zsh
>
> ```bash theme={null}
> curl -X POST "https://curebot.site/api/hooks/<id>/<secret>" \
>   -H "content-type: application/json" \
>   -d '{"from_name": "Ivan", "amount": "5.00", "message": "testing"}'
> ```
>
> Use this version on macOS, Linux, WSL or Git Bash. Keep each `\` at the end of its line, with no spaces after it.

> [tab] PowerShell
>
> ```powershell theme={null}
> $request = @{
>   Method = "Post"
>   Uri = "https://curebot.site/api/hooks/<id>/<secret>"
>   ContentType = "application/json"
>   Body = '{"from_name": "Ivan", "amount": "5.00", "message": "testing"}'
> }
> Invoke-RestMethod @request
> ```
>
> This uses PowerShell's built-in HTTP command and needs no line continuation characters.

> [tab] Command Prompt
>
> ```batch theme={null}
> curl.exe -X POST "https://curebot.site/api/hooks/<id>/<secret>" ^
>   -H "content-type: application/json" ^
>   -d "{\"from_name\": \"Ivan\", \"amount\": \"5.00\", \"message\": \"testing\"}"
> ```
>
> Use this version in Windows `cmd.exe`. Keep each `^` at the end of its line, with no spaces after it.

The reply says what happened:

| Answer | Means |
| - | - |
| `200` | Posted |
| `404` | Wrong URL, or it was replaced with **New URL** |
| `403` | The webhook is turned off |
| `410` | Its channel was deleted. Pick another |
| `413` | More than 64 KB was sent |
| `429` | More than 30 posts in a minute. Slow down |
| `502` | Discord refused the message. Check cure can post in that channel |

### Keep it safe

The URL is the password. If it leaks, open the webhook and press **New URL**: the old one stops working at once. A server can have 25 incoming webhooks.

## Outgoing webhooks

An outgoing webhook sends your server's events to your own app, as JSON.

**1. Add your app's URL**

In **Outgoing**, enter an `https://` address on the public internet, and pick the events it should get.

**2. Copy the secret**

Each webhook has a secret. Your app uses it to check a request really came from cure (see below).

**3. Press Test**

cure sends a `test` event and shows what your app answered.

### Events

| Event | Sent when | `data` holds |
| - | - | - |
| `member.join` | A member joins | `user`, `memberCount`, `accountCreatedAt` |
| `member.leave` | A member leaves | `user`, `memberCount`, `joinedAt` |
| `member.ban` | A member is banned | `user`, `reason` |
| `member.unban` | A ban is lifted | `user` |
| `case.create` | A moderation case is made | `case` with `id`, `action`, `userId`, `moderatorId`, `reason` |
| `ticket.open` | A ticket opens | `ticket`, `user`, `answers` |
| `ticket.close` | A ticket closes | `ticket`, `closedBy`, `reason`, `messages` |
| `giveaway.end` | A giveaway ends | `giveaway`, `winners` |

A `user` is always `{ id, username, displayName, bot }`.

### What your app receives

A `POST` with this body:

```json theme={null}
{
  "event": "member.join",
  "guildId": "1200000000000000000",
  "sentAt": "2026-11-22T16:12:00.000Z",
  "data": {
    "user": { "id": "1300000000000000000", "username": "zerocluexo", "displayName": "in the pool", "bot": false },
    "memberCount": 192,
    "accountCreatedAt": "2021-10-24T09:30:00.000Z"
  }
}
```

and these headers:

| Header | Holds |
| - | - |
| `x-cure-event` | The event's name |
| `x-cure-signature` | `sha256=` and an HMAC of the body, made with your secret |

### Check the signature

Pass the **raw body bytes**, `x-cure-signature` header and your webhook's secret to one of these helpers. Verify before parsing JSON. Load a non-empty secret from `CURE_WEBHOOK_SECRET` at startup; use the text shown in the dashboard without Base64-decoding it.

> [tab] Node.js
>
> ```js theme={null}
> import { createHmac, timingSafeEqual } from "node:crypto";
>
> function fromCure(rawBody, header, secret) {
>   // Require raw bytes and the exact signature format.
>   if (!Buffer.isBuffer(rawBody) || typeof header !== "string" ||
>       header.length !== 71 || !/^sha256=[0-9a-f]{64}$/.test(header)) {
>     return false;
>   }
>   const expected = createHmac("sha256", secret).update(rawBody).digest();
>   const received = Buffer.from(header.slice(7), "hex");
>   // Validated hex guarantees two 32-byte buffers.
>   return timingSafeEqual(received, expected);
> }
> ```
>
> In Express, use `express.raw({ type: "application/json" })` on this route before any JSON middleware.

> [tab] Python
>
> ```python theme={null}
> import hashlib
> import hmac
> import re
>
>
> def from_cure(raw_body: bytes, header: str | None, secret: str) -> bool:
>     # Reject missing or malformed headers before decoding.
>     if not isinstance(header, str) or re.fullmatch(r"sha256=[0-9a-f]{64}", header) is None:
>         return False
>     expected = hmac.new(secret.encode("utf-8"), raw_body, hashlib.sha256).digest()
>     received = bytes.fromhex(header[7:])
>     return hmac.compare_digest(expected, received)  # Timing-safe comparison.
> ```
>
> In Flask, get the bytes with `request.get_data(as_text=False)` before parsing JSON.

> [tab] Go
>
> ```go theme={null}
> package main
>
> import (
>     "crypto/hmac"
>     "crypto/sha256"
>     "encoding/hex"
> )
>
> func fromCure(rawBody []byte, header string, secret []byte) bool {
>     if len(header) != 71 {
>         return false
>     }
>     mac := hmac.New(sha256.New, secret)
>     mac.Write(rawBody) // Original bytes, before JSON decoding.
>     expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
>     // Comparing the full header also enforces its prefix and lowercase hex format.
>     return hmac.Equal([]byte(header), []byte(expected))
> }
> ```

> [tab] Rust
>
> Add dependencies with `cargo add hmac@0.13 sha2@0.11 hex@0.4`.
>
> ```rust theme={null}
> use hmac::{Hmac, KeyInit, Mac};
> use sha2::Sha256;
>
> fn from_cure(raw_body: &[u8], header: Option<&str>, secret: &[u8]) -> bool {
>     // Validate before hex decoding; missing headers fail closed.
>     let Some(digest) = header.and_then(|h| h.strip_prefix("sha256=")) else {
>         return false;
>     };
>     if digest.len() != 64 || !digest.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'f')) {
>         return false;
>     }
>     let Ok(received) = hex::decode(digest) else { return false; };
>     let Ok(mut mac) = Hmac::<Sha256>::new_from_slice(secret) else { return false; };
>     mac.update(raw_body);
>     mac.verify_slice(&received).is_ok() // Timing-safe verification.
> }
> ```

Return `401` if verification fails. Otherwise parse JSON, validate the fields you use and run your own handler. Route using `event` in the signed body, and treat `test` as a dry run. Queue slow work before returning a `2xx` within five seconds.

Keep the secret server-side. These helpers verify authenticity, not replay protection: for sensitive actions, validate the signed `sentAt` against a short time window and atomically reject previously accepted signatures in shared storage.

### When your app doesn't answer

* Answer within **5 seconds** with any `2xx`. Anything else counts as a failure, and the dashboard shows the last answer or error.
* Failed events aren't sent again.
* After **20 failures in a row**, cure turns the webhook off. Fix your app, then turn it back on.
* Addresses on private networks (like `localhost` or `192.168.…`) are refused. A server can have 10 outgoing webhooks.


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