# Create Webhook

> Part of the NocoDB documentation (Product docs > Tables > Table Operations > Set Up > Webhook v2 (Deprecated)). Index of all pages: https://nocodb.com/llms.txt. Any docs page is available as Markdown by adding `.md` to its URL.

URL: https://nocodb.com/docs/product/tables/table-operations/webhook-v2-deprecated/create-webhook
Last updated: 2026-10-03

Create a legacy (v2) webhook in NocoDB, with trigger events, conditions, and custom payloads.

<Callout type="note">
  This article is about the legacy version of webhooks in NocoDB. For the latest features and improvements, refer to [Webhook v3](/docs/product/tables/table-operations/webhook).
</Callout>

## Create Webhook

### Accessing webhook page

1. In the left sidebar, click the table for the webhook.
2. In the toolbar, open `Tools`.
3. Click `Webhooks`.
4. Click `Add New Webhook`.

<img alt="Accessing webhook" src={__img0} placeholder="blur" />

### Configuring webhook

1. Enter the name of the webhook.
2. Select the event that triggers the webhook.

| Trigger                      | Details                                              |
| ---------------------------- | ---------------------------------------------------- |
| After Record Insert          | After a single record is inserted                    |
| After Record Update          | After a single record is updated                     |
| After Record Delete          | After a single record is deleted                     |
| After Multiple Record Insert | After bulk records are inserted                      |
| After Multiple Record Update | After bulk records are updated                       |
| After Multiple Record Delete | After bulk records are deleted                       |
| Manual Trigger               | You trigger the webhook manually with a button field |

3. Method & URL: Set the endpoint that the webhook calls. Supported methods are GET, POST, DELETE, PUT, HEAD, PATCH.
4. Headers & Parameters: Set the request headers and parameters (optional).
5. Condition: Set criteria. Only records that meet the criteria trigger the webhook (optional).
6. Test the webhook with a sample payload to make sure that the parameters are correct (optional).
7. Save the webhook.

<img alt="Configuring webhook" src={__img1} placeholder="blur" />

For more information about the **Manual Trigger** webhook and how to use it with the **Button** field, refer to [Button field](/docs/product/tables/fields/field-types/custom-types/button).

### Webhook with conditions

In a webhook with conditions, only records that meet the criteria trigger the webhook. For example, trigger the webhook only when `Status` is `Complete`. You can also set many conditions with the `AND` or `OR` operators. For example, trigger the webhook only when `Status` is `Complete` and `Priority` is `High`.

The webhook triggers only if the condition was not met before the record update. For example, the condition is `Status` `is` `Complete` and `Priority` `is` `High`:

| Record before update                   | Change                                 | Webhook triggers |
| -------------------------------------- | -------------------------------------- | ---------------- |
| `Status` `Complete`, `Priority` `Low`  | Change `Priority` from `Low` to `High` | Yes              |
| `Status` `Complete`, `Priority` `High` | Update any other field                 | No               |

In summary, the webhook triggers only when `Condition(old-record) = false` and `Condition(new-record) = true`.

<Callout type="info">
  Conditions do not apply to the Manual Trigger webhook.
</Callout>

### Webhook response sample

<Tabs items={['After Insert', 'After Update', 'After Delete', "After Bulk Insert", "After Bulk Update", "After Bulk Delete", "Manual Trigger"]}>
  <Tab value="After Insert">
    ```bash
    {
        "type" : "records.after.insert",
        "id": "9dac1c54-b3be-49a1-a676-af388145fa8c",
        "data": {
            "table_id": "md_xzru7dcqrecc60",
            "table_name": "Film",
            "view_id": "vw_736wrpoas7tr0c",
            "view_name": "Film",
            "records": [
                {
                    "FilmId": 1011,
                    "Title": "FOO",
                    "Language": {
                        "LanguageId": 1,
                        "Name": "English"
                    },
                }
            ]
        }
    }
    ```
  </Tab>

  <Tab value="After Update">
    ```bash
        {
            "type": "records.after.update",
            "id": "6a6ebfe4-b0b5-434e-b5d6-5212adbf82fa",
            "data": {
                "table_id": "md_xzru7dcqrecc60",
                "table_name": "Film",
                "view_id": "vw_736wrpoas7tr0c",
                "view_name": "Film",
                "previous_records": [
                    {
                        "FilmId": 1,
                        "Title": "ACADEMY DINOSAUR",
                        "Description": "A Epic Drama of a Feminist in The Canadian Rockies",
                        "Actor List": [
                            {
                                "ActorId": 10,
                                "FirstName": "CHRISTIAN"
                            }
                        ],
                    }
                ],
                 "records": [
                    {
                        "FilmId": 1,
                        "Title": "ACADEMY DINOSAUR (Edited)",
                        "Actor List": [
                            {
                                "ActorId": 10,
                                "FirstName": "CHRISTIAN"
                            }
                        ],
                    }
                 ]
            }
        }
    ```
  </Tab>

  <Tab value="After Delete" label="After Delete">
    ```bash
        {
            "type": "records.after.delete",
            "id": "e593079f-70e5-4965-8944-5ff7aeed005c",
            "data": {
                "table_id": "md_xzru7dcqrecc60",
                "table_name": "Film",
                "view_id": "vw_736wrpoas7tr0c",
                "view_name": "Film",
                "records": [
                    {
                        "FilmId": 1010,
                        "Title": "ALL-EDITED",
                        "Language": {
                            "LanguageId": 1,
                            "Name": "English"
                        },
                    }
                ]
            }
        }
    ```
  </Tab>

  <Tab value="After Bulk Insert" label="After Bulk Insert">
    ```bash
    {
        "type": "records.after.bulkInsert",
        "id": "f8397b06-a399-4a3a-b6b0-6d1c0c2f7578",
        "data": {
            "table_id": "md_xzru7dcqrecc60",
            "table_name": "Film",
            "view_id": "vw_3fq2e9q8drkblw",
            "view_name": "GridView",
            "records_inserted": 2
        }
    }
    ```
  </Tab>

  <Tab value="After Bulk Update" label="After Bulk Update">
    ```bash
    {
        "type": "records.after.bulkUpdate",
        "id": "e983cea5-8e38-438e-96a0-048751f6830b",
        "data": {
            "table_id": "md_xzru7dcqrecc60",
            "table_name": "Film",
            "view_id": "vw_3fq2e9q8drkblw",
            "view_name": "Sheet-1",
            "previous_records": [
                [
                    {
                        "FilmId": 1005,
                        "Title": "Q",
                        "Language": {
                            "LanguageId": 1,
                            "Name": "English"
                        },
                    },
                    {
                        "FilmId": 1004,
                        "Title": "P",
                        "Language": {
                            "LanguageId": 1,
                            "Name": "English"
                        }
                    }
                ]
            ],
            "records": [
                [
                    {
                        "FilmId": 1005,
                        "Title": "Q-EDITED",
                        "Language": {
                            "LanguageId": 1,
                            "Name": "English"
                        }
                    },
                    {
                        "FilmId": 1004,
                        "Title": "P-EDITED",
                        "Language": {
                            "LanguageId": 1,
                            "Name": "English"
                        }
                    }
                ]
            ]
        }
    }
    ```
  </Tab>

  <Tab value="After Bulk Delete" label="After Bulk Delete">
    ```bash
        {
            "type": "records.after.bulkDelete",
            "id": "e7f1f4e5-7052-4ca2-9355-241ceb836f43",
            "data": {
                "table_id": "md_xzru7dcqrecc60",
                "table_name": "Film",
                "view_id": "vw_3fq2e9q8drkblw",
                "view_name": "Sheet-1",
                "records": [
                    [
                        {
                            "FilmId": 1022,
                            "Title": "x",
                            "Language": {
                                "LanguageId": 1,
                                "Name": "English"
                            },
                        },
                        {
                            "FilmId": 1023,
                            "Title": "x",
                            "Language": {
                                "LanguageId": 1,
                                "Name": "English"
                            },
                        }
                    ]
                ]
            }
        }
    ```
  </Tab>

  <Tab value="Manual Trigger" label="Manual Trigger">
    ```bash
    {
        "type": "records.manual.trigger",
        "id": "551a2010-d658-4185-a050-cf3fca56a5a9",
        "data": {
            "table_id": "mzo4r3zrbcph43i",
            "table_name": "Features",
            "rows": [
                {
                    "Id": 1,
                    "Title": "dstala",
                    "CreatedAt": "2024-08-12 11:56:15+00:00",
                    "UpdatedAt": "2024-08-12 11:56:48+00:00",
                    "Button": {
                        "type": "url",
                        "label": "Button",
                        "url": "https://github.com/dstala"
                    },
                }
            ]
        }
    }
    ```
  </Tab>
</Tabs>

### Webhook with custom payload

You can set a custom payload for your webhook in the `Body` tab. Use [handlebar syntax](https://handlebarsjs.com/guide/#simple-expressions) to get and change the data.

Use `{{ json event }}` to get the event data. This is a sample response:

```json
{
  "type": "records.after.insert",
  "id": "0698517a-d83a-4e72-bf7a-75f46b704ad1",
  "data": {
    "table_id": "m969t01blwprpef",
    "table_name": "Table-2",
    "view_id": "vwib3bvfxdqgymun",
    "view_name": "Table-2",
    "rows": [
      {
        "Id": 1,
        "Tags": "Sample Text",
        "CreatedAt": "2024-04-11T10:40:20.998Z",
        "UpdatedAt": "2024-04-11T10:40:20.998Z"
      }
    ]
  }
}
```

#### Discord Webhook

You can set a Discord webhook to send messages to a Discord channel. The Discord request body must contain content, embeds, or attachments. If it does not, the request fails. This is an example of a Discord webhook payload. For more details, refer to the [Discord webhooks guide](https://birdie0.github.io/discord-webhooks-guide/discord_webhook.html).

```json
{
  "content": "Hello, this is a webhook message",
  "embeds": [
    {
      "title": "Webhook",
      "description": "This is a webhook message",
      "color": 16711680
    }
  ]
}
```

To send the complete event data to Discord, use this payload:

```
{
  "content" : {{ json ( json event ) }}
}
```

You can also change the payload as necessary. For example, to send only the `Title` field to Discord, use this payload. The Discord channel shows the value of `content`.

```
{
   "content": "{{ event.data.rows.[0].Title }}"
}
```

## Environment Variables

In the self-hosted version, you can set these environment variables to change how webhooks work:

| Variable                | Description                             | Default |
| ----------------------- | --------------------------------------- | ------- |
| NC\_ALLOW\_LOCAL\_HOOKS | Allow webhooks to call localhost links. | false   |

For more details, refer to [environment variables](/docs/self-hosting/environment-variables).

---

## Related pages

- [Actions on Webhook](https://nocodb.com/docs/product/tables/table-operations/webhook-v2-deprecated/actions-on-webhook.md): Enable, disable, edit, duplicate, and delete legacy (v2) webhooks in NocoDB.
