# Alert Invites

**Premium only.** Get notified when a member reaches a specific number of invites. You can receive alerts both in Discord and via external webhooks.

***

## Setup

### Add an Alert

```
/alert-invites add <amount>
```

When any member reaches the specified invite count, a notification will be sent.

### Manage Alerts

| Command                                  | Description                             |
| ---------------------------------------- | --------------------------------------- |
| :star2: `/alert-invites add <amount>`    | Add an invite alert at a specific count |
| :star2: `/alert-invites remove <amount>` | Remove an invite alert                  |
| :star2: `/alert-invites list`            | List all configured alerts              |

***

## Webhook Integration

Send real-time HTTP notifications to your own server when an alert triggers. Perfect for integration with external dashboards, notification systems, or custom bots.

### Webhook Commands

| Command                                       | Description                 |
| --------------------------------------------- | --------------------------- |
| :star2: `/alert-invites webhook url <url>`    | Set a custom webhook URL    |
| :star2: `/alert-invites webhook secret`       | View your webhook secret    |
| :star2: `/alert-invites webhook reset-secret` | Reset your webhook secret   |
| :star2: `/alert-invites webhook test`         | Send a test webhook request |

### Webhook Payload

When an alert triggers, a `POST` request is sent to your configured URL with the following JSON body:

```json
{
  "guild_id": "123456789012345678",
  "member_id": "987654321098765432",
  "invites": 50,
  "alert_amount": 50,
  "timestamp": "2024-01-15T12:00:00Z"
}
```

### Webhook Security

Each webhook is secured with a **secret key**. The secret is included in the request headers so you can verify the authenticity of incoming requests:

```
X-Webhook-Secret: your-secret-key
```

* Use `/alert-invites webhook secret` to view your current secret
* Use `/alert-invites webhook reset-secret` to generate a new secret if compromised
* Use `/alert-invites webhook test` to send a test request and verify your endpoint

{% hint style="warning" %}
Always validate the `X-Webhook-Secret` header on your server to ensure requests are coming from InviteCount.
{% endhint %}

***

## Example

Set up alerts at 10, 50, and 100 invites:

```
/alert-invites add 10
/alert-invites add 50
/alert-invites add 100
```

When any member reaches 10, 50, or 100 total invites, you'll be notified in the logging channel and via your webhook (if configured).

{% hint style="info" %}
Alert Invites requires an active premium subscription. See [Premium](/reference/premium.md) for details.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.invite-count.xyz/features/alerts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
