Documentation Index Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Payables stored in Tesouro can have comments associated with them. Tesouro API Partners can use comments to store additional information about payables.
Webhooks are sent every time a comment is created, updated, or deleted.
Roles and permissions
To use the /comments* endpoints with an organization user token , this organization user must have a role with the comment permission.
If using a partner-level token , no special permissions are needed.
To create a comment, call 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:
curl -X POST 'https://api.sandbox.tesouro.com/v1/comments' \
-H 'X-Finops-Version: 2025-06-23' \
-H 'X-Organization-Id: ORGANIZATION_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:
{
"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."
}
To get a list of all the comments related to a specific object, call GET /comments passing the object_type and the object_id of the object to which the comments are related as query parameters:
curl -X POST 'https://api.sandbox.tesouro.com/v1/comments?object_type=payable&object_id=9d2b4c8f-2087-4738-ba91-7359683c49a4&order=asc&limit=100' \
-H 'X-Finops-Version: 2025-06-23' \
-H 'X-Organization-Id: ORGANIZATION_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN'
The successful response contains information about all the comments associated with the supplied object:
{
"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
}
See all 18 lines
To get information about a specific comment associated with a specific object, call GET /comments/{comment_id} .
To edit an existing comment, call PATCH /comments/{comment_id} . Only the creator of the comment is allowed to change it.
curl -X PATCH 'https://api.sandbox.tesouro.com/v1/comments/d95eb59f-2781-4c58-b763-4526b3b27b0d' \
-H 'X-Finops-Version: 2025-06-23' \
-H 'X-Organization-Id: ORGANIZATION_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"
}'
To delete an existing comment, call DELETE /comments/{comment_id} .