> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Sample Flow ## Article: Sample Flow ## Article Link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/sample-flow.md ## Article Content: # Sample Flows This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation. ## Redirect comments to a custom category When you install Wix Comments on a site, the system creates a default category. When a site visitor creates a comment, the system automatically assigns the comment to the default category. To redirect a new comment to a custom category: 1. Create a new category using [Create Category](https://dev.wix.com/docs/api-reference/crm/community/comments/categories/create-category.md), or identify an existing category to use. Save the `categoryId`. 2. Listen for the [Comment Created](https://dev.wix.com/docs/api-reference/crm/community/comments/comments/comment-created.md) event. When the event triggers, you'll receive the newly created comment in the payload. Extract the `id` and `revision` of the comment. 3. Call [Update Comment](https://dev.wix.com/docs/api-reference/crm/community/comments/comments/update-comment.md) with: - `id`: The ID of the comment that was just created. - `revision`: Revision number of the comment that was just created. - `contextId`: The `categoryId` of the destination category. ## Handle comments before deleting a category Deleting a category with comments orphans those comments, preventing them from loading and causing errors. Before deleting a category, you must either delete all the comments it contains or move them to another category: ### Delete comments then delete category To delete all the comments from a category and then delete the category itself: 1. Call [Bulk Delete Comment](https://dev.wix.com/docs/api-reference/crm/community/comments/comments/bulk-delete-comment.md) with a filter for all comments where `contextId` matches the category ID you intend to delete. 2. Call [Delete Category](https://dev.wix.com/docs/api-reference/crm/community/comments/categories/delete-category.md) to delete the now-empty category. ### Move comments then delete category To move all the comments out of a category and then delete the category itself: 1. Create a new category using [Create Category](https://dev.wix.com/docs/api-reference/crm/community/comments/categories/create-category.md) or identify an existing category to use. 2. Call [Bulk Move Comment By Filter](https://dev.wix.com/docs/api-reference/crm/community/comments/comments/bulk-move-comment-by-filter.md) with a filter where `contextId` matches the category ID you intend to delete. Set the destination to the new category. 3. Call [Delete Category](https://dev.wix.com/docs/api-reference/crm/community/comments/categories/delete-category.md) to delete the now-empty category. ## Retrieve all recent comments from a specific category You can retrieve recent comments written across all blog posts or product pages. Use this to display recent activity to site visitors. 1. Call [Query Category](https://dev.wix.com/docs/api-reference/crm/community/comments/categories/query-category.md) to retrieve a list of categories available for a site and find the `categoryId` for the category you want to highlight. 2. Call [List Comments By Resource](https://dev.wix.com/docs/api-reference/crm/community/comments/comments/list-comments-by-resource.md) with the `categoryId` retrieved above as the `contextId` and `commentSort.order` set to `"NEWEST_FIRST"`.