# Using Webhooks

{% hint style="info" %}
Replace `[prefix]` with your server's prefix.
{% endhint %}

## Creating a Webhook

This command will create a webhook managed by serenity. Using these, you can send embed/text through that webhook.

{% hint style="warning" %}
You **cannot** use webhooks that already exist to send content, they have to be created and managed by serenity.
{% endhint %}

Running this command will provide you with a unique code for that webhook. Keep this a secret, that code can be used to send content through the webhook. You cannot send content via webhook without that identifier.

{% hint style="danger" %}
If you pass the code to someone else, they can **bypass** the @role, @everyone permission by discord.
{% endhint %}

```
// Syntax
[prefix]webhook create [channel] [name]
// Example
;webhook create #general AI
```

<figure><img src="/files/uKIYbWTTFofr5DBbQkao" alt=""><figcaption></figcaption></figure>

## Sending Content via Webhook

Utilizing the `[prefix]webhook` send command, you can send embed/raw text via your webhook.

```
// Syntax
[prefix]webhook send [code] [script]
// Example
;webhook send rmszccn7 {embed}{description: stuff}
```

<figure><img src="/files/fDBmWQzWvtmMOoqy5oNH" alt=""><figcaption></figcaption></figure>

## Editing a Webhook

Do you want to change your webhooks profile? You can modify the name and avatar of a webhook by using `[prefix]webhook edit`

```
// Syntax
[prefix]webhook edit name [code] [name]
[prefix]webhook edit avatar [code] [attachment/image url]

// Example
;webhook edit name rmszccn7 cool webhook
```

<figure><img src="/files/8y8ASGTgEhB4dMgdVWQk" alt=""><figcaption></figcaption></figure>

## Delete a Webhook

Running this command, deletes a serenity-managed webhook in your server.

{% hint style="info" %}
You **cannot** delete normally created webhooks via this command!
{% endhint %}

```
// Syntax
[prefix]webhook delete [code]

// Example
;webhook delete rmszccn7
```

<figure><img src="/files/oL6CFcFgdJPW4rZiQrvn" alt=""><figcaption></figcaption></figure>


---

# 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.serenity.wtf/embeds/using-webhooks.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.
