Add Comment
POST
https://app.smartsuite.com/api/v1/comments/?record=[Record_Id]
Creates a comment. Returns a comment object.
Example Request using SmartDoc object
curl -X POST "https://app.smartsuite.com/api/v1/comments/?record=[Record_Id]" \
-H "Authorization: Token YOUR_API_KEY" \
-H "ACCOUNT-ID: WORKSPACE_ID" \
-H "Content-Type: application/json" \
--data '{
"assigned_to": "[Member Id]",
"message": {
"data": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "[Comment Text]"
}
]
}
]
}
},
"parent_comment": "[Parent Comment Id if applicable]",
"application": "[Table_Id]",
"record": "[Record_Id]"
}'
Example Request using HTML
curl -X POST "https://app.smartsuite.com/api/v1/comments/?record=[Record_Id]" \
-H "Authorization: Token YOUR_API_KEY" \
-H "ACCOUNT-ID: WORKSPACE_ID" \
-H "Content-Type: application/json" \
--data '{
"assigned_to": "[Member Id]",
"message": {
"html": "<b>A test</b>"
},
"application": "[Table_Id]",
"record": "[Record_Id]"
}'
Request Parameter
| Param | Type | Description |
|---|---|---|
| record | string | Record Id of the record to attach comment to |
Request Body
| Param | Type | Nullable | Description |
|---|---|---|---|
| assigned_to | string | Yes | Member Id, or null for unassigned |
| message | comment content object | No | An object containing either data (a SmartDoc object) or html (an HTML string). Send an object: a bare string returns 400 ("Expected a dictionary, but got str.").
|
| parent_comment | string | Yes | Id of the comment this is a reply to; omit or null for a top-level comment. |
| application | string | No | Record's Table Id |
| record | string | No | Id of the record the comment should be associated with |
Response
Returns 201 Created with the new comment object.