Webhooks
Comments Webhooks
The Comments
component will emit webhook notifications whenever an action type
occurs on a comment.
To read more about how to setup webhooks with our SDK, click here.
List of Action Types
Action Type | Description |
---|---|
newlyAdded | When the first comment in a thread is added |
added | When a new comment is added. Not used for the first comment in a thread - see newlyAdded |
updated | When an existing comment gets updated |
deleted | When an existing comments gets deleted |
approved | When the comment is approved by the moderator. This is only applicable if you have turned on Moderator Mode. |
assigned | When a comment gets assigned to a user |
statusChanged | When a comment has its status changed (e.g. in progress, resolved, opened) |
priorityChanged | When a comment has its priority changed (e.g. P0, P1, P2 or custom set priorities) |
accessModeChanged | When a comment gets assigned to a user |
accepted | When a comment gets accepted by the moderator. This is only applicable if you have turned on Moderator Mode. |
rejected | When a comment gets rejected by the moderator. This is only applicable if you have turned on Moderator Mode. |
Processed vs Raw Formats
The Raw Format contains lot more metadata that might not be very useful for your notification processing.
In the Processed Format, we will automatically populate who should get what type of notification so that you dont have to write that logic. Eg: If someone was previously tagged on a comment, then they should receive an update notification vs if someone if tagged in this thread, then they should receive a notification that they were tagged in a comment. We recommend using this so that you dont have to maintain the logic on your end.
Processed format
Field | Type | Required | Description |
---|---|---|---|
from | User | Yes | The user who added, updated or deleted the target Comment. |
commentText | string | Optional | text for the added, updated or deleted Comment. This is empty when entire CommentAnnotation is deleted. |
toContactsTagged | UserContact[] | Optional | List of user contacts that are tagged to the target Comment. |
toContactsUpdated | UserContact[] | Optional | List of user contacts that are on the target CommentAnnotation. This excludes all the user contacts that are on the target Comment. |
pageTitle | string | Yes | Title of the page on which the target CommentAnnotation is present. |
pageUrl | string | Yes | Full URL of the page on which the target CommentAnnotation is present. |
actionType | string | Yes | This can have 5 values: added, updated, deleted, resolved, approved |
targetAnnotationId | Comment | Optional | The ID of the target annotation |
targetComment | Comment | Optional | The target Comment object on which the event happened. This field will not be present if the event was at CommentAnnotation level. Eg: deleted the entire comment annotation, resolved comment, approved comment. |
targetCommentId | string | Optional | The ID of the target Comment |
Raw format
Field | Type | Required | Description |
---|---|---|---|
commentAnnotation | CommentAnnotation | Yes | The target CommentAnnotation object on which the event happened. |
targetComment | Comment | Optional | The target Comment object on which the event happened. This field will not be present if the event was at CommentAnnotation level. Eg: deleted the entire comment annotation, resolved comment, approved comment. |
actionType | string | Yes | This can have 5 values: added, updated, deleted, resolved, approved |
notificationSource | string | Yes | Indicates the source of the notification |
actionUser | string | Yes | Contains information about the user who performed the action, including their name, email, and user ID. |
metadata | string | Yes | This field contains additional metadata related to the annotation, such as the API key, client document ID, document ID, and information about various locations where the annotation is associated with a web page. |
Was this page helpful?