Facts
application/x-www-form-urlencoded application/json Arguments
Required arguments
tokenstringRequiredxxxx-xxxxxxxxx-xxxxcommentsarrayRequiredArray of comments to present to the user. See the comment schema for the full list of properties.
trigger_idstringRequiredA reference to the original user action that initiated the request
Optional arguments
cursorstringOptionalApp supplied cursor used for pagination, will be sent in the next request for comments
can_post_commentbooleanOptionalIndicates whether the user has permissions to post comments
delete_action_idstringOptionalThe block action id that will be sent when a delete request is initiated for a comment.
user_auth_requiredbooleanOptionalSet to true (or 1) to indicate that the user must authenticate to see the comments data.
0user_auth_urlstringOptionalA custom URL to which users are directed for authentication if required.
https://example.com/onboarding?user_id=xxxerrorOptionalUsage info
This method returns the comments to display in the comments tab of a Work Objects flexpane. Call it in response to the entity_comments_requested event.
Example:
{
"comments": [
// comment from an authenticated Slack user
{
"sender": {
"user_id": "U123456789"
},
"timestamp": 1741164235,
"id": "comment-unique-identifier-001",
"url": "your.app/item/1/comment/1",
"can_edit": true,
"can_delete": true,
"can_reply": true,
"reply_count": 2,
"reply_users": [
{ "user_id": "U234567890" },
{ "text": "External User", "icon": { "url": "..." } }
],
"latest_reply_ts": 1741165000,
"last_edit_ts": 1741164300,
// comment with blocks
"comment": {
"blocks": {
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Check out these different block types with paragraph breaks between them:\n\n"
}
]
}
]
}
}
},
// example comment from a user who is not an authenticated Slack user
{
"sender": {
"text": "UserFirstName UserLastName",
"icon": {
"alt_text": "Summary of image's content",
"url": "..." // publicly-accessible URL to an image
},
"url": "your.app/user/userId",
"email": "firstname.lastname@domain.com"
},
"timestamp": 1741164358,
"id": "comment-unique-identifier-002",
"url": "your.app/item/1/comment/2",
"thread_root_id": "comment-unique-identifier-001", // this is a reply to comment-001
// comment with plain text
"comment": {
"value": "Plain text comment",
"format": "markdown"
}
}
],
"can_post_comment": true,
"delete_action_id": "your-delete-action-id",
"trigger_id": "1234567890123.1234567890123.abcdef01234567890abcdef012345689",
"error": ""
}
Comment schema
| Property | Type | Description | Required? |
|---|---|---|---|
comments | List<Comment> | List of comments to be presented to the flexpane. | Required |
can_post_comment | boolean | Used to denote whether the user has posting permissions. Hides the composer if false. | Required |
trigger_id | string | Used to validate API interaction. | Required |
comments[].comment | object | The comment content. Provide one of comment.blocks or comment.value. | Required |
comments[].id | string | A unique ID sourced from your app and associated with the comment. It will be used if editing a comment. | Required |
comments[].sender | User | Same User type used in a Work Object's fields. | Required |
comments[].timestamp | integer | Epoch timestamp in seconds. | Required |
delete_action_id | string | A string identifier for the delete action ID that will be sent in the block_actions payload when the user clicks the delete button in the UI. This will send the comment.id as the value. | Optional |
user_auth_required | boolean | Set to true to indicate that the user must authenticate with your service before comments can be loaded. When true, user_auth_url is required. Defaults to false. Refer to authenticating users. | Optional |
user_auth_url | string | The URL to which the user is directed to authenticate. Required when user_auth_required is true. | Optional |
comments[].can_delete | boolean | If present and true, renders the delete button on that comment. When true, delete_action_id should also be present, otherwise the delete button will render but do nothing when clicked. Empty strings are not supported. | Optional |
comments[].can_edit | boolean | If present and true, indicates that the comment is editable in the user's flexpane. | Optional |
comments[].can_reply | boolean | If present and true, allows users to reply to this comment in a thread. | Optional |
comments[].comment.blocks | Rich text block | A rich text block containing the comment content. | Optional |
comments[].comment.format | string | If set to "markdown", the comment.value will be formatted as markdown. | Optional |
comments[].comment.value | string | Plain or markdown string containing the comment content. This will be used if blocks is not present on the comment object. | Optional |
comments[].cursor | string | Pagination cursor associated with this comment's position in the list. | Optional |
comments[].last_edit_ts | integer | Epoch timestamp in seconds of the last edit to this comment. | Optional |
comments[].latest_reply_ts | integer | Epoch timestamp in seconds of the most recent reply in the thread. | Optional |
comments[].reply_count | integer | Number of replies in the thread under this comment. | Optional |
comments[].reply_users | List<User> | Up to two users who have replied to this comment thread. Same User type as sender. | Optional |
comments[].thread_root_id | string | The id of the parent comment. If present, this comment is a threaded reply. | Optional |
comments[].url | string | URL which directs to the comment. | Optional |
Response
Errors
This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok parameter in the response.
access_deniedAccess to a resource specified in the request is denied.
accesslimitedAccess to this method is limited on the current network
account_inactiveAuthentication token is for a deleted user or workspace when using a bot token.
deprecated_endpointThe endpoint has been deprecated.
ekm_access_deniedAdministrators have suspended the ability to post a message.
enterprise_is_restrictedThe method cannot be called from an Enterprise.
fatal_errorThe server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.
internal_errorThe server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.
invalid_app_idApp ID is not a valid format
invalid_arg_nameThe method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
invalid_argumentsThe method was called with invalid arguments.
invalid_array_argThe method was passed an array as an argument. Please only input valid strings.
invalid_authInvalid token provided
invalid_authSome aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.
invalid_charsetThe method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
invalid_form_dataThe method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
invalid_post_typeThe method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
invalid_trigger_idTrigger id is not valid
method_deprecatedThe method has been deprecated.
method_not_foundwhen the API isn't available to the caller
missing_delete_action_iddelete_action_id is required when any comment is marked can_delete
missing_post_typeThe method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
missing_scopeThe token used is not granted the specific scope permissions required to complete this request.
no_permissionThe workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
not_allowed_token_typeThe token type used in this request is not allowed.
not_authedNo authentication token provided.
org_login_requiredThe workspace is undergoing an enterprise migration and will not be available until migration is complete.
ratelimitedThe request has been ratelimited. Refer to the Retry-After header for when to retry the request.
request_timeoutThe method was called via a POST request, but the POST data was either missing or truncated.
service_unavailableThe service is temporarily unavailable
team_access_not_grantedThe token used is not granted the specific workspace access required to complete this request.
team_added_to_orgThe workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
token_expiredAuthentication token has expired
token_revokedAuthentication token is for a deleted user or workspace or the app has been removed when using a user token.
two_factor_setup_requiredTwo factor setup is required.
user_auth_url_missingUser auth url is required if user_auth_required is true
