> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.monite.com/v-2024-05-25/accounts-payable/payables/comments/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server. # Comments ## Overview [Payables](./index) stored in Monite can have comments associated with them. Monite API Partners can use comments to store additional information about payables. [Webhooks](../../references/webhooks/index) are sent every time a comment is created, updated, or deleted. ## Roles and permissions \[#permissions] To use the `/comments*` endpoints with an [entity user token](../../entities/users#get-entity-user-token), this entity user must have a [role](../../entities/users#create-role) with the `comment` permission. If using a [partner-level token](../../get-started/credentials#generate-partner-token), no special permissions are needed. ## Create a comment \[#create] To create a comment, call [`POST /comments`](/api/comments/post-comments) with the request body containing the comment text and the ID of the payable object to which the comment is related. The `object_type` field must be set to `"payable"`. If the comment is a reply to another user, you can include the `reply_to_entity_user_id` field: ```sh curl -X POST 'https://api.sandbox.monite.com/v1/comments' \ -H 'X-Monite-Version: 2024-05-25' \ -H 'X-Monite-Entity-Id: ENTITY_ID' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "text": "Comment about a payable.", "reply_to_entity_user_id": "6e8b3d61-edc6-41d5-94ff-e3980606dc0f", "object_type": "payable", "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" }' ``` The successful response contains information about the newly created comment and the object to which the comment is related: ```json { "id": "d95eb59f-2781-4c58-b763-4526b3b27b0d", "created_at": "2023-09-06T07:10:53.879Z", "updated_at": "2023-09-06T07:10:53.879Z", "created_by_entity_user_id": "9fabf3e8-76bd-400e-85cc-776d42e71c07", "entity_id": "ba2ee5e3-b29d-4594-942c-d962ae9765ed", "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "object_type": "payable", "reply_to_entity_user_id": "6e8b3d61-edc6-41d5-94ff-e3980606dc0f", "status": "active", "text": "Comment about a payable." } ``` ## List all comments \[#list-all] To get a list of all the comments related to a specific object, call [`GET /comments`](/api/comments/get-comments) passing the `object_type` and the `object_id` of the object to which the comments are related as query parameters: ```sh curl -X POST 'https://api.sandbox.monite.com/v1/comments?object_type=payable&object_id=9d2b4c8f-2087-4738-ba91-7359683c49a4&order=asc&limit=100' \ -H 'X-Monite-Version: 2024-05-25' \ -H 'X-Monite-Entity-Id: ENTITY_ID' \ -H 'Authorization: Bearer ACCESS_TOKEN' ``` The successful response contains information about all the comments associated with the supplied object: ```json { "data": [ { "id": "d95eb59f-2781-4c58-b763-4526b3b27b0d", "created_at": "2023-09-06T07:10:53.879Z", "updated_at": "2023-09-06T07:10:53.879Z", "created_by_entity_user_id": "9fabf3e8-76bd-400e-85cc-776d42e71c07", "entity_id": "ba2ee5e3-b29d-4594-942c-d962ae9765ed", "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "object_type": "payable", "reply_to_entity_user_id": "6e8b3d61-edc6-41d5-94ff-e3980606dc0f", "status": "active", "text": "Comment about a payable." } ], "prev_pagination_token": null, "next_pagination_token": null } ``` ## Retrieve a comment \[#retrieve] To get information about a specific comment associated with a specific object, call [`GET /comments/{comment_id}`](/api/comments/get-comments-id). ## Edit a comment \[#edit] To edit an existing comment, call [`PATCH /comments/{comment_id}`](/api/comments/patch-comments-id). Only the creator of the comment is allowed to change it. ```sh curl -X PATCH 'https://api.sandbox.monite.com/v1/comments/d95eb59f-2781-4c58-b763-4526b3b27b0d' \ -H 'X-Monite-Version: 2024-05-25' \ -H 'X-Monite-Entity-Id: ENTITY_ID' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "text": "Updated comment about a payable.", "reply_to_entity_user_id": "9fabf3e8-76bd-400e-85cc-776d42e71c07" }' ``` ## Delete a comment \[#delete] To delete an existing comment, call [`DELETE /comments/{comment_id}`](/api/comments/delete-comments-id). > Learn how to associate comments with payables.