---
title: "Comments webhook"
description: "Enable and manage webhooks for Comments in Tiptap to receive notifications on thread and comment activities. More in the docs!"
canonical_url: "https://tiptap.dev/docs/comments/integrate/webhook"
---

# Comments webhook

Enable and manage webhooks for Comments in Tiptap to receive notifications on thread and comment activities. More in the docs!

Set up and manage webhooks to improve your Comments integration. Common use cases for Comments webhooks include:

- Sending notifications when a thread is created, resolved, updated, or deleted.
- Notifying users when comments are added, updated, or deleted.
- In conjunction with the [mention extension](https://tiptap.dev/docs/editor/extensions/nodes/mention.md), sending emails or notifications to users when they are mentioned in comments.

* **1. Activate trial or subscribe**

  Start a [free trial](https://cloud.tiptap.dev/v2?trial=true) or [subscribe to the Team plan](https://cloud.tiptap.dev/v2/billing) in your account.
* **2. Start Document server**

  Configure your [Comments webhook](https://cloud.tiptap.dev/v2/configuration/document-server) after starting your [Environment](https://cloud.tiptap.dev/v2/configuration/document-server).

## Enable comment events

For accounts created after March 1, 2024, Comments webhooks are enabled by default. Otherwise, you could still be using an older version of the webhook system and need to manually upgrade:

1. In case you’ve previously implemented Collaboration webhooks, check the `type` and `trigger` fields when processing incoming webhooks. ([Documentation](https://tiptap.dev/docs/collaboration/core-concepts/webhooks.md))
2. Navigate to your [Collaboration settings](https://cloud.tiptap.dev/v2/configuration/document-server).
3. In the Webhooks section, click **Upgrade**.

This upgrade is necessary to accommodate the introduction of multiple new events being routed to the same webhook endpoint, distinguished by a new `type` and `trigger` field.

## Configure webhooks

To configure webhooks for Comments notifications:

1. Navigate to the [Collaboration settings](https://cloud.tiptap.dev/v2/configuration/document-server) in your account.
2. In the Webhooks section, add your desired endpoint URL.

After adding your URL, the webhook is immediately live. You'll start receiving notifications for the specified events without any delay.

## Webhook events

Comments webhooks trigger notifications for a variety of events related to threads and comments within the Comments extension. These events are triggered immediately as soon as their associated action occur within the comments.

- `comment.added`
- `comment.updated`
- `comment.deleted`
- `thread.created` (only triggered if the thread is created without a first comment, usually via our 'create thread' API. When using the official Tiptap extensions, you'll only see `comment.added`)
- `thread.resolved`
- `thread.updated`
- `thread.deleted`

## Example payloads

Below are example payloads for different types of webhook events:

### Thread/comment created

```json
{
  "trigger": "comment.added",
  "thread": {
    "id": "128ba3a9-c684-4956-8c9f-fe5dc147c7e5",
    "createdAt": "2024-03-02T22:17:51.304Z",
    "comments": [
      {
        "id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76",
        "createdAt": "2024-03-02T22:17:51.307Z",
        "updatedAt": "2024-03-02T22:17:51.307Z",
        "data": {
          "userName": "Cyndi Lauper",
          "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
        },
        "content": "Threaderstellungskommentar"
      }
    ],
    "updatedAt": "2024-03-02T22:17:51.305Z"
  },
  "comment": {
    "id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76",
    "createdAt": "2024-03-02T22:17:51.307Z",
    "updatedAt": "2024-03-02T22:17:51.307Z",
    "data": {
      "userName": "Cyndi Lauper",
      "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
    },
    "content": "Threaderstellungskommentar"
  },
  "selection": [
    {
      "type": "text",
      "text": "in my opinion",
      "marks": [
        {
          "type": "inlineThread",
          "attrs": {
            "data-thread-id": "128ba3a9-c684-4956-8c9f-fe5dc147c7e5"
          }
        }
      ]
    }
  ],
  "appName": "",
  "user": "",
  "name": "documentName",
  "type": "THREAD"
}
```

### Comment updated

```json
{
  "trigger": "comment.updated",
  "thread": [
    {
      "id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76",
      "createdAt": "2024-03-02T22:17:51.307Z",
      "updatedAt": "2024-03-02T22:18:04.246Z",
      "data": {
        "userName": "Cyndi Lauper",
        "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
      },
      "content": "Threaderstellungskommentar (bearbeitet)"
    }
  ],
  "comment": {
    "id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76",
    "createdAt": "2024-03-02T22:17:51.307Z",
    "updatedAt": "2024-03-02T22:18:04.246Z",
    "data": {
      "userName": "Cyndi Lauper",
      "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
    },
    "content": "Threaderstellungskommentar (bearbeitet)"
  },
  "selection": [
    {
      "type": "text",
      "text": "in my opinion",
      "marks": [
        {
          "type": "inlineThread",
          "attrs": {
            "data-thread-id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76"
          }
        }
      ]
    }
  ],
  "appName": "",
  "user": "",
  "name": "documentName",
  "type": "THREAD"
}
```

### Comment deleted

```json
{
  "trigger": "comment.deleted",
  "thread": {
    "id": "128ba3a9-c684-4956-8c9f-fe5dc147c7e5",
    "createdAt": "2024-03-02T22:17:51.304Z",
    "comments": [
      {
        "id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76",
        "createdAt": "2024-03-02T22:17:51.307Z",
        "updatedAt": "2024-03-02T22:18:04.246Z",
        "data": {
          "userName": "Cyndi Lauper",
          "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
        },
        "content": "Threaderstellungskommentar (bearbeitet)"
      }
    ],
    "updatedAt": "2024-03-02T22:17:51.305Z"
  },
  "comment": {
    "id": "1841e650-2202-42b6-a868-907fee42ccf7",
    "createdAt": "2024-03-02T22:18:20.974Z",
    "updatedAt": "2024-03-02T22:18:20.975Z",
    "data": {
      "userName": "Cyndi Lauper",
      "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
    },
    "content": "Zweites Kommentar, selber Thread"
  },
  "selection": [], // selection is not sent for deleted comments
  "appName": "",
  "user": "",
  "name": "documentName",
  "type": "THREAD"
}
```

### Thread deleted

```json
{
  "trigger": "thread.deleted",
  "thread": {
    "id": "128ba3a9-c684-4956-8c9f-fe5dc147c7e5",
    "createdAt": "2024-03-02T22:17:51.304Z",
    "comments": [
      {
        "id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76",
        "createdAt": "2024-03-02T22:17:51.307Z",
        "updatedAt": "2024-03-02T22:18:04.246Z",
        "data": {
          "userName": "Cyndi Lauper",
          "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
        },
        "content": "Threaderstellungskommentar (bearbeitet)"
      }
    ],
    "updatedAt": "2024-03-02T22:18:52.050Z",
    "resolvedAt": null
  },
  "selection": [], // selection is not sent for deleted threads
  "appName": "",
  "user": "",
  "name": "documentName",
  "type": "THREAD"
}
```

### Thread resolved

```json
{
  "trigger": "thread.resolved",
  "thread": {
    "id": "128ba3a9-c684-4956-8c9f-fe5dc147c7e5",
    "createdAt": "2024-03-02T22:17:51.304Z",
    "comments": [
      {
        "id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76",
        "createdAt": "2024-03-02T22:17:51.307Z",
        "updatedAt": "2024-03-02T22:18:04.246Z",
        "data": {
          "userName": "Cyndi Lauper",
          "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
        },
        "content": "Threaderstellungskommentar (bearbeitet)"
      }
    ],
    "updatedAt": "2024-03-02T22:18:48.531Z",
    "resolvedAt": "2024-03-02T22:18:48.531Z"
  },
  "selection": [
    {
      "type": "text",
      "text": "in my opinion",
      "marks": [
        {
          "type": "inlineThread",
          "attrs": {
            "data-thread-id": "128ba3a9-c684-4956-8c9f-fe5dc147c7e5"
          }
        }
      ]
    }
  ],
  "appName": "",
  "user": "",
  "name": "documentName",
  "type": "THREAD"
}
```

### Thread updated (i.e., Unresolved)

```json
{
  "trigger": "thread.updated",
  "thread": {
    "id": "128ba3a9-c684-4956-8c9f-fe5dc147c7e5",
    "createdAt": "2024-03-02T22:17:51.304Z",
    "comments": [
      {
        "id": "0259e4cb-43ad-4eb2-a7e9-a7a7d5207a76",
        "createdAt": "2024-03-02T22:17:51.307Z",
        "updatedAt": "2024-03-02T22:18:04.246Z",
        "data": {
          "userName": "Cyndi Lauper",
          "userAvatar": "https://api.dicebear.com/7.x/lorelei/svg?seed=Cyndi Lauper"
        },
        "content": "Threaderstellungskommentar (bearbeitet)"
      }
    ],
    "updatedAt": "2024-03-02T22:18:52.050Z",
    "resolvedAt": null
  },
  "selection": [
    {
      "type": "text",
      "text": "in my opinion",
      "marks": [
        {
          "type": "inlineThread",
          "attrs": {
            "data-thread-id": "128ba3a9-c684-4956-8c9f-fe5dc147c7e5"
          }
        }
      ]
    }
  ],
  "appName": "",
  "user": "",
  "name": "documentName",
  "type": "THREAD"
}
```
