> For the complete documentation index, see [llms.txt](https://peanut1120.gitbook.io/webhook-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://peanut1120.gitbook.io/webhook-api/master.md).

# Webhook API

## Send Webhook Request

<mark style="color:blue;">`GET`</mark> `https://nutauth.cf/api/db/:id`

This endpoint will send a request to your webhook.

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| id   | string | ID of the webhook |

{% tabs %}
{% tab title="200 Webhook sent" %}

```
{"message":"success"}
```

{% endtab %}

{% tab title="404 Could not find a webhook entry with that ID" %}

```
{    "message": "Invalid Webhook ID"}
```

{% endtab %}
{% endtabs %}

## Create Webhook&#x20;

<mark style="color:green;">`POST`</mark> `https://nutauth.cf/api/db`

Allows you to create a webhook

#### Request Body

| Name        | Type   | Description                                   |
| ----------- | ------ | --------------------------------------------- |
| description | string | If you selected embed type, input description |
| footer      | string | If you selected embed type, input footer      |
| title       | string | If you selected embed type, input title       |
| content     | string | If you chose text, input the text here        |
| type        | string | Two types; embed or text                      |
| webhook     | string | The webhook URL                               |

{% tabs %}
{% tab title="200 Returns the ID of the webhook as well as the code, please note them all down." %}

```
{"message":"success","id":id,"code":code}
```

{% endtab %}
{% endtabs %}

## Update Webhook

<mark style="color:orange;">`PUT`</mark> `https://nutauth.cf/api/db/:id`

You can update content for text type webhook ids

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| id   | string | ID of the webhook |

#### Request Body

| Name    | Type   | Description                               |
| ------- | ------ | ----------------------------------------- |
| webhook | string | The updated webhook                       |
| content | string | The updated content                       |
| code    | string | The code given to you in the post request |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Delete your webhook

<mark style="color:red;">`DELETE`</mark> `https://nutauth.cf/api/db/:id`

Here you can delete the webhook from the DB.

#### Path Parameters

| Name | Type   | Description       |
| ---- | ------ | ----------------- |
| id   | string | ID of the webhook |

#### Headers

| Name | Type   | Description               |
| ---- | ------ | ------------------------- |
| code | string | The code for your webhook |

{% tabs %}
{% tab title="200 " %}

```
{"message":"success"}
```

{% endtab %}
{% endtabs %}

## Example Text type request

```javascript
{
    "type":"text",
    "content":"Hello,World",
    "webhook":"discordwebhook.com"
}
```

## Example Embed type request

```javascript
{
    "type":"embed",
    "title":"Test Title",
    "description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "footer":"Integer viverra scelerisque fringilla."
    "webhook":"discordwebhook.com"
}
```
