Slack. Web. Chat
(SlackKit v0.25.0-alpha.0)
View Source
Summary
Functions
Appends text to an existing streaming conversation.
Deletes a message.
Deletes a pending scheduled message from the queue.
Retrieve a permalink URL for a specific extant message
Share a me message into a channel.
Sends an ephemeral message to a user in a channel.
Sends a message to a channel.
Schedules a message to be sent to a channel.
Starts a new streaming conversation.
Stops a streaming conversation.
Provide custom unfurl behavior for user-posted URLs
Updates a message.
Functions
Appends text to an existing streaming conversation.
Required Params
channel- An encoded ID that represents a channel, private group, or DMmarkdown_text- Accepts message text formatted in markdown. Limit this field to 12,000 characters. This text is what will be appended to the message received so far. ex:**This is bold text**ts- The timestamp of the streaming message.
Optional Params
chunks- Array of streaming chunks.
Errors the API can return:
invalid_metadata_format- Invalid metadata format providedtoken_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.channel_type_not_supported- Channel type not supportedinvalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.stopped_by_user- The streaming message was stopped by the user and no further appends are accepted.invalid_chunks- Chunks submitted with this message are not valid.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.rate_limited- Application has posted too many messages, read the Rate Limit documentation for more informationinvalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.slack_connect_canvas_sharing_blocked- Admin has disabled Canvas File sharing in all Slack Connect communicationsrestricted_action_read_only_channel- Cannot post any message into a read-only channel.invalid_blocks- Blocks submitted with this message are not valid.restricted_action- A workspace preference prevents the authenticated user from posting.invalid_metadata_schema- Invalid metadata schema providedfatal_error- The 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.no_text- No message text provideddeprecated_endpoint- The endpoint has been deprecated.message_not_owned_by_app- The message is not owned by the app.slack_connect_file_link_sharing_blocked- Admin has disabled Slack File sharing in all Slack Connect communicationsmetadata_must_be_sent_from_app- Message metadata can only be posted or updated using an app-level tokenratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Your message couldn’t be sent because your admins have disabled sending messages to this channel.service_unavailable- The service is temporarily unavailablemessages_tab_disabled- Messages tab for the app is disabled.as_user_not_supported- Theas_userparameter does not function with workspace apps.not_in_channel- Cannot post user messages to a channel they are not in.team_access_not_granted- The token used is not granted the specific workspace access required to complete this request.msg_blocks_too_many- Max blocks exceeded, blocks are limited to 50 per message.invalid_arguments- The method was called with invalid arguments.duplicate_message_not_found- No duplicate message exists associated withclient_msg_id.msg_blocks_too_long- Blocks submitted with this message are too long.message_limit_exceeded- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspacesinvalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.team_not_found- This error occurs if, when using an org-wide token, thechannel_nameis passed instead of thechannel_id.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.slack_connect_lists_sharing_blocked- Admin has disabled Lists sharing in all Slack Connect communicationschannel_not_found- Value passed forchannelwas invalid.too_many_contact_cards- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.too_many_attachments- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message.team_added_to_org- The 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.message_not_found- Message not foundmissing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networktoken_expired- Authentication token has expiredmessage_not_in_streaming_state- The message is not in the streaming state.invalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.is_archived- Channel has been archived.method_deprecated- The method has been deprecated.duplicate_channel_not_found- Channel associated withclient_msg_idwas invalid.restricted_action_thread_locked- Cannot post replies to a thread that has been locked by admins.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.restricted_action_non_threadable_channel- Cannot post thread replies into a non_threadable channel.invalid_auth- Some 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.messaging_processing_failed- Failed to process the message.restricted_action_thread_only_channel- Cannot post top-level messages into a thread-only channel.metadata_too_large- Metadata exceeds size limit
Deletes a message.
Required Params
channel- Channel containing the message to be deleted.ts- Timestamp of the message to be deleted. ex:"1405894322.002768"
Optional Params
as_user- (Legacy) Pass true to delete the message as the authed user withchat:write:userscope. Bot users in this context are considered authed users. See legacyas_userparameter below. ex:true
Errors the API can return:
cant_delete_message- Authenticated user does not have permission to delete this message.token_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.invalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.invalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.fatal_error- The 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.deprecated_endpoint- The endpoint has been deprecated.ratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Administrators have suspended the ability to post a message.service_unavailable- The service is temporarily unavailableteam_access_not_granted- The token used is not granted the specific workspace access required to complete this request.invalid_arguments- The method was called with invalid arguments.invalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.channel_not_found- Value passed forchannelwas invalid.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.team_added_to_org- The 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.message_not_found- No message exists with the requested timestamp.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networktoken_expired- Authentication token has expiredinvalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.method_deprecated- The method has been deprecated.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.invalid_auth- Some 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.
Deletes a pending scheduled message from the queue.
Required Params
channel- The channel the scheduled_message is posting to ex:C123456789scheduled_message_id-scheduled_message_idreturned from call to chat.scheduleMessage ex:Q1234ABCD
Optional Params
as_user- Pass true to delete the message as the authed user withchat:write:userscope. Bot users in this context are considered authed users. If unused or false, the message will be deleted withchat:write:botscope. ex:true
Errors the API can return:
bad_token- The providedtokenwas invalid.token_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.invalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.invalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.fatal_error- The 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.deprecated_endpoint- The endpoint has been deprecated.ratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Administrators have suspended the ability to post a message.service_unavailable- The service is temporarily unavailableteam_access_not_granted- The token used is not granted the specific workspace access required to complete this request.invalid_arguments- The method was called with invalid arguments.invalid_array_arg- The method was passed an array as an argument. Please only input valid strings.invalid_scheduled_message_id- Thescheduled_message_idpassed is either an invalid ID, or the scheduled message it's referencing has already been sent or deleted.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.channel_not_found- Thechannelpassed is either an invalid ID or does not exist.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.team_added_to_org- The 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.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networktoken_expired- Authentication token has expiredinvalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.method_deprecated- The method has been deprecated.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.invalid_auth- Some 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.
Retrieve a permalink URL for a specific extant message
Required Params
channel- The ID of the conversation or channel containing the messagemessage_ts- A message'stsvalue, uniquely identifying it within a channel
Errors the API can return:
access_denied- Access to a resource specified in the request is denied.accesslimited- Access to this method is limited on the current networkaccount_inactive- Authentication token is for a deleted user or workspace when using abottoken.channel_not_found- Value passed forchannelwas invalid.deprecated_endpoint- The endpoint has been deprecated.ekm_access_denied- Administrators have suspended the ability to post a message.enterprise_is_restricted- The method cannot be called from an Enterprise.fatal_error- The 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_error- The 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_arg_name- The 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_arguments- The method was called with invalid arguments.invalid_array_arg- The method was passed an array as an argument. Please only input valid strings.invalid_auth- Some 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_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.invalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.message_not_found- The message identified bymessage_tscould not be found.method_deprecated- The method has been deprecated.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.missing_scope- The token used is not granted the specific scope permissions required to complete this request.no_permission- The 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_type- The token type used in this request is not allowed.not_authed- No authentication token provided.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.ratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.service_unavailable- The service is temporarily unavailableteam_access_not_granted- The token used is not granted the specific workspace access required to complete this request.team_added_to_org- The 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_expired- Authentication token has expiredtoken_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.two_factor_setup_required- Two factor setup is required.
Share a me message into a channel.
Required Params
channel- Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.text- Text of the message to send. ex:Hello world
Errors the API can return:
token_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.invalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.rate_limited- Application has posted too many messages, read the Rate Limit documentation for more informationinvalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.fatal_error- The 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.no_text- No message text provideddeprecated_endpoint- The endpoint has been deprecated.ratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Administrators have suspended the ability to post a message.service_unavailable- The service is temporarily unavailablenot_in_channel- Cannot post user messages to a channel they are not in.team_access_not_granted- The token used is not granted the specific workspace access required to complete this request.invalid_arguments- The method was called with invalid arguments.invalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.channel_not_found- Value passed forchannelwas invalid.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.team_added_to_org- The 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.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networkmsg_too_long- Message text is too longtoken_expired- Authentication token has expiredinvalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.is_archived- Channel has been archived.method_deprecated- The method has been deprecated.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.invalid_auth- Some 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.
Sends an ephemeral message to a user in a channel.
Required Params
channel- Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.user-idof the user who will receive the ephemeral message. The user should be in the channel specified by thechannelargument. ex:U0BPQUNTA
Optional Params
as_user- (Legacy) Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false. ex:trueattachments- A JSON-based array of structured attachments, presented as a URL-encoded string. Thetextfield is not enforced as required when usingblocksorattachments. ex:[{"pretext": "pre-hello", "text": "text-world"}]blocks- A JSON-based array of structured blocks, presented as a URL-encoded string. The usage of thetextfield changes depending on whether you're usingblocks. Thetextfield is not enforced as required when usingblocksorattachments. However, we highly recommended that you includetextto provide a fallback when usingblocks, as described above. ex:[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]icon_emoji- Emoji to use as the icon for this message. Overridesicon_url. ex::chart_with_upwards_trend:icon_url- URL to an image to use as the icon for this message. ex:http://lorempixel.com/48/48link_names- Find and link channel names and usernames. You can specify values forparseandlink_namesto change formatting behavior. ex:truemarkdown_text- Accepts message text formatted in markdown. This argument should not be used in conjunction withblocksortext. Limit this field to 12,000 characters. ex:**This is bold text**parse- Change how messages are treated. Defaults tonone. See below.
Acceptable values: none full mrkdwn false. You can specify values for parse and link_names to change formatting behavior. ex: full
text- How this field works and whether it is required depends on other fields you use in your API call. See below for more detail. The usage of thetextfield changes depending on whether you're usingblocks. Thetextfield is not enforced as required when usingblocksorattachments. However, we highly recommended that you includetextto provide a fallback when usingblocks, as described above. ex:Hello worldthread_ts- Provide another message'stsvalue to post this message in a thread. Avoid using a reply'stsvalue; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread.username- Set your bot's user name. ex:My Bot
Errors the API can return:
token_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.invalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.invalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.invalid_blocks- Blocks submitted with this message are not validrestricted_action- A workspace preference prevents the authenticated user from posting.fatal_error- The 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.no_text- No message text providedcannot_reply_to_message- This message type cannot have thread replies.invalid_attachments- Attachments that contain blocks are not validdeprecated_endpoint- The endpoint has been deprecated.ratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Administrators have suspended the ability to post a message.service_unavailable- The service is temporarily unavailablemessages_tab_disabled- Messages tab for the app is disabled.not_in_channel- Cannot post user messages to a channel they are not in.team_access_not_granted- The token used is not granted the specific workspace access required to complete this request.user_not_in_channel- Intended recipient is not in the specified channel.invalid_arguments- The method was called with invalid arguments.message_limit_exceeded- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspacesinvalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.invalid_blocks_format- Theblocksis not a valid JSON object or doesn't match the Block Kit syntax.channel_not_found- Value passed forchannelwas invalid.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.too_many_attachments- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message.team_added_to_org- The 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.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networkmsg_too_long- Message text is too longmarkdown_text_conflict- Markdown text cannot be used in conjunction withblocksortextargument.token_expired- Authentication token has expiredinvalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.is_archived- Channel has been archived.method_deprecated- The method has been deprecated.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.invalid_auth- Some 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.
Sends a message to a channel.
Required Params
channel- An encoded ID or channel name that represents a channel, private group, or IM channel to send the message to. See below for more details.
Optional Params
as_user- (Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic apps. See legacyas_userparameter below. ex:trueattachments- A JSON-based array of structured attachments, presented as a URL-encoded string. Thetextfield is not enforced as required when usingblocksorattachments. ex:[{"pretext": "pre-hello", "text": "text-world"}]blocks- A JSON-based array of structured blocks, presented as a URL-encoded string. The usage of thetextfield changes depending on whether you're usingblocks. Thetextfield is not enforced as required when usingblocksorattachments. However, we highly recommended that you includetextto provide a fallback when usingblocks, as described above. It is expected behavior that screen readers will default to the top-leveltextfield of your post, and will not read the content of any interiorblocksin the underlying structure of the message. do not include a top-leveltextfield if the message hasblocks, and allow Slack attempt to build it for you by appending content from supportedblocksto be read by the screen reader. ex:[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]current_draft_last_updated_ts- This field represents the timestamp of the draft's last update at the time this API is called. If the current message is a draft, this field can be provided to ensure synchronization with the server. ex:1524523204.000192icon_emoji- Emoji to use as the icon for this message. Overridesicon_url. ex::chart_with_upwards_trend:icon_url- URL to an image to use as the icon for this message. ex:http://lorempixel.com/48/48link_names- Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead. ex:truemarkdown_text- Accepts message text formatted in markdown. This argument should not be used in conjunction withblocksortext. Limit this field to 12,000 characters. ex:**This is bold text**metadata- JSON object with event_type and event_payload fields, presented as a URL-encoded string. You can also provide Work Object entity metadata using this parameter. Metadata you post to Slack is accessible to any app or user who is a member of that workspace. ex:{"event_type": "task_created", "event_payload": { "id": "11223", "title": "Redesign Homepage"}}mrkdwn- Disable Slack markup parsing by setting tofalse. Enabled by default. The behavior ofparseis different for text formatted withmrkdwn. By default, or whenparseis set tonone,mrkdwnformatting is implemented. To ignoremrkdwnformatting, setparsetofull. ex:falseparse- Change how messages are treated. See below. The behavior ofparseis different for text formatted withmrkdwn. By default, or whenparseis set tonone,mrkdwnformatting is implemented. To ignoremrkdwnformatting, setparsetofull. ex:fullreply_broadcast- Used in conjunction withthread_tsand indicates whether reply should be made visible to everyone in the channel or conversation. Defaults tofalse. ex:truetext- How this field works and whether it is required depends on other fields you use in your API call. See below for more detail. The usage of thetextfield changes depending on whether you're usingblocks. Thetextfield is not enforced as required when usingblocksorattachments. However, we highly recommended that you includetextto provide a fallback when usingblocks, as described above. It is expected behavior that screen readers will default to the top-leveltextfield of your post, and will not read the content of any interiorblocksin the underlying structure of the message. do not include a top-leveltextfield if the message hasblocks, and allow Slack attempt to build it for you by appending content from supportedblocksto be read by the screen reader. ex:Hello worldthread_ts- Provide another message'stsvalue to make this message a reply. Avoid using a reply'stsvalue; use its parent instead.unfurl_links- Pass true to enable unfurling of primarily text-based content. If you want to suppress link unfurls in messages containing Block Kit blocks, setunfurl_linksandunfurl_mediato false. ex:trueunfurl_media- Pass false to disable unfurling of media content. If you want to suppress link unfurls in messages containing Block Kit blocks, setunfurl_linksandunfurl_mediato false. ex:falseusername- Set your bot's user name. ex:My Bot
Errors the API can return:
invalid_metadata_format- Invalid metadata format provided.token_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.invalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.draft_already_sent- The draft has already been sent.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.rate_limited- Application has posted too many messages, read the Rate Limit documentation for more information.invalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.slack_connect_canvas_sharing_blocked- Admin has disabled Canvas File sharing in all Slack Connect communications.restricted_action_read_only_channel- Cannot post any message into a read-only channel.invalid_blocks- Blocks submitted with this message are not valid.restricted_action- A workspace preference prevents the authenticated user from posting.invalid_metadata_schema- Invalid metadata schema provided.fatal_error- The 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.no_text- No message text provided.cannot_reply_to_message- This message type cannot have thread replies.deprecated_endpoint- The endpoint has been deprecated.draft_has_conflict- The client draft version is out of sync with the server draft version.slack_connect_file_link_sharing_blocked- Admin has disabled Slack File sharing in all Slack Connect communications.metadata_must_be_sent_from_app- Message metadata can only be posted or updated using an app-level token.ratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Your message couldn’t be sent because your admins have disabled sending messages to this channel.service_unavailable- The service is temporarily unavailabledraft_not_found- The draft was not found.messages_tab_disabled- Messages tab for the app is disabled.as_user_not_supported- Theas_userparameter does not function with workspace apps.not_in_channel- Cannot post user messages to a channel they are not in.team_access_not_granted- The token used is not granted the specific workspace access required to complete this request.draft_already_deleted- The draft has already been deleted.invalid_arguments- The method was called with invalid arguments.duplicate_message_not_found- No duplicate message exists associated withclient_msg_id.msg_blocks_too_long- Blocks submitted with this message are too long.message_limit_exceeded- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces.invalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.team_not_found- This error occurs if, when using an org-wide token, thechannel_nameis passed instead of thechannel_id.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.invalid_blocks_format- Theblocksis not a valid JSON object or doesn't match the Block Kit syntax.slack_connect_lists_sharing_blocked- Admin has disabled Lists sharing in all Slack Connect communications.channel_not_found- Value passed forchannelwas invalid.too_many_contact_cards- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.too_many_attachments- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message.team_added_to_org- The 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.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networkmarkdown_text_conflict- Markdown text cannot be used in conjunction withblocksortextargument.token_expired- Authentication token has expiredattachment_payload_limit_exceeded- Attachment payload size is too long.invalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.is_archived- Channel has been archived.method_deprecated- The method has been deprecated.duplicate_channel_not_found- Channel associated withclient_msg_idwas invalid.restricted_action_thread_locked- Cannot post replies to a thread that has been locked by admins.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.missing_file_data- Attempted to share a file but some required data was missing.restricted_action_non_threadable_channel- Cannot post thread replies into a non_threadable channel.invalid_auth- Some 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.restricted_action_thread_only_channel- Cannot post top-level messages into a thread-only channel.metadata_too_large- Metadata exceeds size limit.
Schedules a message to be sent to a channel.
Required Params
channel- Channel, private group, or DM channel to send message to. Can be an encoded ID, or a name. See below for more details.post_at- Unix timestamp representing the future time the message should post to Slack. ex:299876400
Optional Params
as_user- Set totrueto post the message as the authed user, instead of as a bot. Defaults to false. Cannot be used by new Slack apps. See chat.postMessage. ex:trueattachments- A JSON-based array of structured attachments, presented as a URL-encoded string. ex:[{"pretext": "pre-hello", "text": "text-world"}]blocks- A JSON-based array of structured blocks, presented as a URL-encoded string. ex:[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]link_names- Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead. ex:truemarkdown_text- Accepts message text formatted in markdown. This argument should not be used in conjunction withblocksortext. Limit this field to 12,000 characters. ex:**This is bold text**metadata- JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace. ex:{"event_type": "task_created", "event_payload": { "id": "11223", "title": "Redesign Homepage"}}parse- Change how messages are treated. See chat.postMessage.
Acceptable values: none full ex: full
reply_broadcast- Used in conjunction withthread_tsand indicates whether reply should be made visible to everyone in the channel or conversation. Defaults tofalse. ex:truetext- How this field works and whether it is required depends on other fields you use in your API call. See below for more detail. ex:Hello worldthread_ts- Provide another message'stsvalue to make this message a reply. Avoid using a reply'stsvalue; use its parent instead.unfurl_links- Pass true to enable unfurling of primarily text-based content. ex:trueunfurl_media- Pass false to disable unfurling of media content. ex:false
Errors the API can return:
invalid_time- value passed forpost_timewas invalid.time_too_far- value passed forpost_timewas too far into the future.invalid_metadata_format- Invalid metadata format providedtoken_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.invalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.rate_limited- Application has posted too many messages, read the Rate Limit documentation for more informationinvalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.restricted_action_read_only_channel- Cannot post any message into a read-only channel.invalid_blocks- Blocks submitted with this message are not validrestricted_action- A workspace preference prevents the authenticated user from posting.invalid_metadata_schema- Invalid metadata schema providedfatal_error- The 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.restricted_too_many- Too many messages were scheduled in the channel for a given period. See usage info for additional detailsno_text- No message text provideddeprecated_endpoint- The endpoint has been deprecated.slack_connect_file_link_sharing_blocked- Admin has disabled Slack File sharing in all Slack Connect communicationsmetadata_must_be_sent_from_app- Message metadata can only be posted or updated using an app-level tokenratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Administrators have suspended the ability to post a message.service_unavailable- The service is temporarily unavailablenot_in_channel- Cannot post user messages to a channel they are not in.team_access_not_granted- The token used is not granted the specific workspace access required to complete this request.invalid_arguments- The method was called with invalid arguments.message_limit_exceeded- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspacesinvalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.invalid_blocks_format- Theblocksis not a valid JSON object or doesn't match the Block Kit syntax.channel_not_found- Value passed forchannelwas invalid.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.too_many_attachments- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message.team_added_to_org- The 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.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networkmsg_too_long- Message text is too longinvalid_token- The passed token is invalid or not supported by this method.markdown_text_conflict- Markdown text cannot be used in conjunction withblocksortextargument.token_expired- Authentication token has expiredinvalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.is_archived- Channel has been archived.method_deprecated- The method has been deprecated.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.restricted_action_non_threadable_channel- Cannot post thread replies into a non_threadable channel.invalid_auth- Some 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.time_in_past- value passed forpost_timewas in the past.restricted_action_thread_only_channel- Cannot post top-level messages into a thread-only channel.metadata_too_large- Metadata exceeds size limit
Starts a new streaming conversation.
Required Params
channel- An encoded ID that represents a channel thread or DM.thread_ts- Provide another message'stsvalue to reply to. Streamed messages should always be replies to a user request. ex:1721609600.123456
Optional Params
chunks- Array of streaming chunks.icon_emoji- Emoji to use as the icon for this message. Overridesicon_url. ex::chart_with_upwards_trend:icon_url- Image URL to use as the icon for this message. ex:http://lorempixel.com/48/48markdown_text- Accepts message text formatted in markdown. Limit this field to 12,000 characters. ex:**This is bold text**recipient_team_id- The encoded ID of the team the user receiving the streaming text belongs to. Required when streaming to channels. ex:T0123456789recipient_user_id- The encoded ID of the user to receive the streaming text. Required when streaming to channels.task_display_mode- Specifies how tasks are displayed in the message. Atimelinedisplays individual tasks with text in sequential order,plandisplays all tasks together, with the first tasks's placement determining the placement of the rest of the tasks, anddensecollapses consecutive tool calls into a single summarized task card. ex:planusername- The bot's username to display. ex:My Bot
Errors the API can return:
invalid_metadata_format- Invalid metadata format providedtoken_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.channel_type_not_supported- Channel type not supportedinvalid_arg_name- The 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.missing_recipient_team_id- Missing recipient team ID.two_factor_setup_required- Two factor setup is required.invalid_chunks- Chunks submitted with this message are not valid.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.rate_limited- Application has posted too many messages, read the Rate Limit documentation for more informationinvalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.slack_connect_canvas_sharing_blocked- Admin has disabled Canvas File sharing in all Slack Connect communicationsrestricted_action_read_only_channel- Cannot post any message into a read-only channel.invalid_blocks- Blocks submitted with this message are not validrestricted_action- A workspace preference prevents the authenticated user from posting.invalid_metadata_schema- Invalid metadata schema providedfatal_error- The 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.no_text- No message text provideddeprecated_endpoint- The endpoint has been deprecated.slack_connect_file_link_sharing_blocked- Admin has disabled Slack File sharing in all Slack Connect communicationsmetadata_must_be_sent_from_app- Message metadata can only be posted or updated using an app-level tokenratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Your message couldn’t be sent because your admins have disabled sending messages to this channel.service_unavailable- The service is temporarily unavailablemessages_tab_disabled- Messages tab for the app is disabled.not_in_channel- Cannot post user messages to a channel they are not in.user_not_found- User not found.team_access_not_granted- The token used is not granted the specific workspace access required to complete this request.msg_blocks_too_many- Max blocks exceeded, blocks are limited to 50 per message.invalid_arguments- The method was called with invalid arguments.duplicate_message_not_found- No duplicate message exists associated withclient_msg_id.msg_blocks_too_long- Blocks submitted with this message are too long.message_limit_exceeded- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspacesinvalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.team_not_found- This error occurs if, when using an org-wide token, thechannel_nameis passed instead of thechannel_id.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.invalid_blocks_format- Theblocksis not a valid JSON object or doesn't match the Block Kit syntax.slack_connect_lists_sharing_blocked- Admin has disabled Lists sharing in all Slack Connect communicationschannel_not_found- Value passed forchannelwas invalid.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.team_added_to_org- The 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.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networktoken_expired- Authentication token has expiredinvalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.is_archived- Channel has been archived.method_deprecated- The method has been deprecated.duplicate_channel_not_found- Channel associated withclient_msg_idwas invalid.missing_recipient_user_id- Missing recipient user ID.restricted_action_thread_locked- Cannot post replies to a thread that has been locked by admins.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.restricted_action_non_threadable_channel- Cannot post thread replies into a non_threadable channel.invalid_auth- Some 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.messaging_processing_failed- Failed to process the message.restricted_action_thread_only_channel- Cannot post top-level messages into a thread-only channel.metadata_too_large- Metadata exceeds size limit
Stops a streaming conversation.
Required Params
channel- An encoded ID that represents a channel, private group, or DMts- The timestamp of the streaming message.
Optional Params
blocks- A list of blocks that will be rendered at the bottom of the finalized message. Theblocksarray has a limit of 50, which is a separate limit from theblockssent via thechunksparameter. Therefore you can have 50blockssent via thechunksparameter and 50blockssent via thechat.stopStreamAPI method'sblocksarray, for 100 blocks total. Note that any blocks in theblocksarray will be rendered after anything passed viachunksormarkdown_textwhen the stream is completed.chunks- Array of streaming chunks. Theblocksarray has a limit of 50, which is a separate limit from theblockssent via thechunksparameter. Therefore you can have 50blockssent via thechunksparameter and 50blockssent via thechat.stopStreamAPI method'sblocksarray, for 100 blocks total. Note that any blocks in theblocksarray will be rendered after anything passed viachunksormarkdown_textwhen the stream is completed.markdown_text- Accepts message text formatted in markdown. Limit this field to 12,000 characters. Note that any blocks in theblocksarray will be rendered after anything passed viachunksormarkdown_textwhen the stream is completed. ex:**This is bold text**metadata- JSON object with event_type and event_payload fields, presented as a URL-encoded string. Metadata you post to Slack is accessible to any app or user who is a member of that workspace. ex:{"event_type": "task_created", "event_payload": { "id": "11223", "title": "Redesign Homepage"}}
Errors the API can return:
invalid_metadata_format- Invalid metadata format providedtoken_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.channel_type_not_supported- Channel type not supported.invalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.invalid_chunks- Chunks submitted with this message are not valid.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.rate_limited- Application has posted too many messages, read the Rate Limit documentation for more informationinvalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.slack_connect_canvas_sharing_blocked- Admin has disabled Canvas File sharing in all Slack Connect communicationsrestricted_action_read_only_channel- Cannot post any message into a read-only channel.invalid_blocks- Blocks submitted with this message are not valid.restricted_action- A workspace preference prevents the authenticated user from posting.invalid_metadata_schema- Invalid metadata schema providedfatal_error- The 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.no_text- No message text providedcannot_reply_to_message- This message type cannot have thread replies.deprecated_endpoint- The endpoint has been deprecated.message_not_owned_by_app- The message is not owned by the app.slack_connect_file_link_sharing_blocked- Admin has disabled Slack File sharing in all Slack Connect communicationsmetadata_must_be_sent_from_app- Message metadata can only be posted or updated using an app-level tokenratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Your message couldn’t be sent because your admins have disabled sending messages to this channel.service_unavailable- The service is temporarily unavailablemessages_tab_disabled- Messages tab for the app is disabled.as_user_not_supported- Theas_userparameter does not function with workspace apps.not_in_channel- Cannot post user messages to a channel they are not in.team_access_not_granted- The token used is not granted the specific workspace access required to complete this request.msg_blocks_too_many- Max blocks exceeded, blocks are limited to 50 per message.invalid_arguments- The method was called with invalid arguments.duplicate_message_not_found- No duplicate message exists associated withclient_msg_id.msg_blocks_too_long- Blocks submitted with this message are too long.message_limit_exceeded- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspacesinvalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.team_not_found- This error occurs if, when using an org-wide token, thechannel_nameis passed instead of thechannel_id.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.slack_connect_lists_sharing_blocked- Admin has disabled Lists sharing in all Slack Connect communicationschannel_not_found- Value passed forchannelwas invalid.too_many_contact_cards- Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.too_many_attachments- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message.team_added_to_org- The 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.message_not_found- The message was not found.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networktoken_expired- Authentication token has expiredattachment_payload_limit_exceeded- Attachment payload size is too long.message_not_in_streaming_state- The message is not in a streaming state.invalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.is_archived- Channel has been archived.method_deprecated- The method has been deprecated.duplicate_channel_not_found- Channel associated withclient_msg_idwas invalid.restricted_action_thread_locked- Cannot post replies to a thread that has been locked by admins.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.missing_file_data- Attempted to share a file but some required data was missing.restricted_action_non_threadable_channel- Cannot post thread replies into a non_threadable channel.invalid_auth- Some 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.restricted_action_thread_only_channel- Cannot post top-level messages into a thread-only channel.metadata_too_large- Metadata exceeds size limit
Provide custom unfurl behavior for user-posted URLs
Optional Params
channel- Channel ID of the message. Bothchannelandtsmust be provided together, orunfurl_idandsourcemust be provided together. Required for public channels. Bothunfurl_idandsourcemust be provided together, orchannelandtsmust be provided together. The first time this method is executed with a particulartsandchannel(orunfurl_idandsource) combination, the validunfurlsattachments you provide will be attached to the message. Subsequent attempts with the sametsandchannelvalues will modify the same attachments, rather than adding more. Thetsvalue you supply must correspond to a message in the specifiedchannel.source- The source of the link to unfurl. The source may either becomposer, when the link is inside the message composer, orconversations_history, when the link has been posted to a conversation.
Acceptable values: composer conversations_history. Both unfurl_id and source must be provided together, or channel and ts must be provided together. The first time this method is executed with a particular ts and channel (or unfurl_id and source) combination, the valid unfurls attachments you provide will be attached to the message. ex: composer
ts- Timestamp of the message to add unfurl behavior to. Required for public channels. Bothunfurl_idandsourcemust be provided together, orchannelandtsmust be provided together. The first time this method is executed with a particulartsandchannel(orunfurl_idandsource) combination, the validunfurlsattachments you provide will be attached to the message. Subsequent attempts with the sametsandchannelvalues will modify the same attachments, rather than adding more. Thetsvalue you supply must correspond to a message in the specifiedchannel.unfurl_id- The ID of the link to unfurl. Bothunfurl_idandsourcemust be provided together, orchannelandtsmust be provided together. Bothunfurl_idandsourcemust be provided together, orchannelandtsmust be provided together. The first time this method is executed with a particulartsandchannel(orunfurl_idandsource) combination, the validunfurlsattachments you provide will be attached to the message. ex:Uxxxxxxx-909b5454-75f8-4ac4-b325-1b40e230bbd8unfurls- URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments. Required for public channels. The first time this method is executed with a particulartsandchannel(orunfurl_idandsource) combination, the validunfurlsattachments you provide will be attached to the message.user_auth_blocks- Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Or, you can send an ephemeral message to that user by providing a simple string-baseduser_auth_messagevalue or JSON array of blocks usinguser_auth_blocks. Using both properties shows theuser_auth_messagein a notification and theuser_auth_blocksin the ephemeral message.user_auth_message- Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons,Not noworNever ask me again. Or, you can send an ephemeral message to that user by providing a simple string-baseduser_auth_messagevalue or JSON array of blocks usinguser_auth_blocks. Using both properties shows theuser_auth_messagein a notification and theuser_auth_blocksin the ephemeral message. Specifyinguser_auth_urloruser_auth_messagewill automatically implyuser_auth_requiredbeing set totrue. If bothuser_auth_urlanduser_auth_messageare provided,user_auth_messagetakes precedence.user_auth_required- Set totrueor1to indicate the user must install your Slack app to trigger unfurls for this domain. Specifyinguser_auth_urloruser_auth_messagewill automatically implyuser_auth_requiredbeing set totrue.user_auth_url- Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded. Specifyinguser_auth_urloruser_auth_messagewill automatically implyuser_auth_requiredbeing set totrue. If bothuser_auth_urlanduser_auth_messageare provided,user_auth_messagetakes precedence. ex:https://example.com/onboarding?user_id=xxx
Errors the API can return:
invalid_metadata_format- Themetadataparameter cannot be JSON-decoded into the expected format.cannot_find_message- Thetsvalue in the request does not match a message.token_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.missing_ts- The request is missing thetsparameterinvalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.invalid_unfurl_id- The unfurl ID is invalid.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.invalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.cannot_find_service- A record of your app being allowed to unfurl for this workspace could not be found.fatal_error- The 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.deprecated_endpoint- The endpoint has been deprecated.cannot_find_channel- The specified channel could not be located for this token.ratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Administrators have suspended the ability to post a message.service_unavailable- The service is temporarily unavailableteam_access_not_granted- The token used is not granted the specific workspace access required to complete this request.invalid_arguments- The method was called with invalid arguments.invalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.invalid_unfurls_format- Theunfurlsparameter cannot be JSON-decoded into a map of URLs to attachments.team_added_to_org- The 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.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networkcannot_unfurl_url- The URL cannot be unfurled. This error may be returned if you haven't acknowledged alink_sharedevent tied to the same URL. It is also returned when the domain appears in a workspace's administrative blocklists.missing_source- The request is missing thesourceparameter.token_expired- Authentication token has expiredmissing_unfurls- The request is missing theunfurlsparameter.cannot_unfurl_message- The URL cannot be unfurled because the URL provided does not appear in the message.cannot_auth_user- The current user cannot be authenticated.invalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.missing_unfurl_id- The request is missing theunfurl_idparameter.method_deprecated- The method has been deprecated.cannot_parse_attachment- The providedunfurlsargument could not be parsed or understood.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.cannot_prompt- The current user has already interacted with and dismissed a prompt for this application.invalid_auth- Some 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_source- The unfurl source is invalid.missing_channel- The request is missing thechannelparameter
Updates a message.
Required Params
channel- Channel containing the message to be updated. For direct messages, ensure that this value is a DM ID (starts withD) instead of a User ID (starts with eitherUorW).ts- Timestamp of the message to be updated. ex:"1405894322.002768"
Optional Params
as_user- Pass true to update the message as the authed user. Bot users in this context are considered authed users. ex:trueattachments- A JSON-based array of structured attachments, presented as a URL-encoded string. Similarly, theattachmentsfield is required when not presentingtext. ex:[{"pretext": "pre-hello", "text": "text-world"}]blocks- A JSON-based array of structured blocks, presented as a URL-encoded string. This method will behave differently depending on whetherblocksortextis supplied. Slack will always try to render the message usingblocks, and usetextonly for notifications. If you don't includeblocks, the message's previousblockswill only be retained if thetextargument is not provided. If thetextargument is provided andblocksare not provided, theblockswill be removed, and the providedtextwill be used for message rendering. Ifblocksare used and a message is being updated, theeditedflag will not be displayed on the message (the flag will be displayed on the message if usingtext). ex:[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]file_ids- Array of new file ids that will be sent with this message. ex:F013GKY52QK,F013GL22D0T or ["F013GKY52QK","F013GL22D0T"]link_names- Find and link channel names and usernames. Defaults tonone. If you do not specify a value for this field, the original value set for the message will be overwritten with the default,none. ex:truemarkdown_text- Accepts message text formatted in markdown. This argument should not be used in conjunction withblocksortext. Limit this field to 12,000 characters. ex:**This is bold text**metadata- JSON object with event_type and event_payload fields, presented as a URL-encoded string. If you don't include this field, the message's previousmetadatawill be retained. To remove previousmetadata, include an empty object for this field. Metadata you post to Slack is accessible to any app or user who is a member of that workspace. ex:{"event_type": "task_created", "event_payload": { "id": "11223", "title": "Redesign Homepage"}}parse- Change how messages are treated. Defaults toclient, unlikechat.postMessage. Accepts eithernoneorfull. If you do not specify a value for this field, the original value set for the message will be overwritten with the default,client. ex:nonereply_broadcast- Broadcast an existing thread reply to make it visible to everyone in the channel or conversation. ex:truetext- How this field works and whether it is required depends on other fields you use in your API call. See below for more detail. This method will behave differently depending on whetherblocksortextis supplied. Slack will always try to render the message usingblocks, and usetextonly for notifications. If you don't includeblocks, the message's previousblockswill only be retained if thetextargument is not provided. If thetextargument is provided andblocksare not provided, theblockswill be removed, and the providedtextwill be used for message rendering. Ifblocksare used and a message is being updated, theeditedflag will not be displayed on the message (the flag will be displayed on the message if usingtext). Similarly, theattachmentsfield is required when not presentingtext. ex:Hello worldunfurled_attachments- A JSON-based array of structured attachments, presented as a URL-encoded string. ex:[{"pretext": "pre-hello", "text": "text-world"}]
Errors the API can return:
edit_window_closed- The message cannot be edited due to the team message edit settingsmax_file_sharing_exceeded- Exceeded max allowed files shared.invalid_metadata_format- Invalid metadata format providedtoken_revoked- Authentication token is for a deleted user or workspace or the app has been removed when using ausertoken.invalid_arg_name- The 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.two_factor_setup_required- Two factor setup is required.invalid_form_data- The method was called via aPOSTrequest withContent-Typeapplication/x-www-form-urlencodedormultipart/form-data, but the form data was either missing or syntactically invalid.invalid_post_type- The method was called via aPOSTrequest, but the specifiedContent-Typewas invalid. Valid types are:application/jsonapplication/x-www-form-urlencodedmultipart/form-datatext/plain.slack_connect_canvas_sharing_blocked- Admin has disabled sharing of canvas links in all Slack Connect messages.invalid_blocks- The blocks were invalid for the requesting user.invalid_metadata_schema- Invalid metadata schema providedfatal_error- The 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.no_text- No message text providedslack_connect_blocked_file_type- Files with certain extensions are blocked from being uploaded in all Slack Connect messages.invalid_attachments- The attachments were invalid.deprecated_endpoint- The endpoint has been deprecated.cant_update_message- Authenticated user does not have permission to update this message.slack_connect_file_link_sharing_blocked- Admin has disabled Slack file sharing in all Slack Connect messages.metadata_must_be_sent_from_app- Message metadata can only be posted or updated using an app-level tokenfile_share_limit_reached- The file has reached the share limit.ratelimited- The request has been ratelimited. Refer to theRetry-Afterheader for when to retry the request.ekm_access_denied- Administrators have suspended the ability to post a message.service_unavailable- The service is temporarily unavailableslack_connect_clip_sharing_blocked- Admin has disabled Clip uploads in Slack Connect channels.streaming_state_conflict- The message is currently streaming text and cannot be edited.as_user_not_supported- Theas_userparameter does not function with workspace apps.posting_to_channel_denied- The user does not have permission to share files in this channel.team_access_not_granted- The token used is not granted the specific workspace access required to complete this request.update_failed- Internal update failure.no_dual_broadcast_content_update- Can't broadcast an old reply and update the content at the same time.invalid_arguments- The method was called with invalid arguments.message_limit_exceeded- Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces.unable_to_share_files- Sharing the files failed.invalid_array_arg- The method was passed an array as an argument. Please only input valid strings.request_timeout- The method was called via aPOSTrequest, but thePOSTdata was either missing or truncated.team_not_found- Team associated with the message and channel could not be found.account_inactive- Authentication token is for a deleted user or workspace when using abottoken.invalid_blocks_format- Theblocksarray is not a valid JSON object or doesn't match the Block Kit syntax.slack_connect_file_upload_sharing_blocked- Admin has disabled file uploads in all Slack Connect messages.channel_not_found- Value passed forchannelwas invalid.file_is_deleted- The file is deleted.external_channel_migrating- The channel is in the process of migrating and so the message cannot be updated at this time.not_authed- No authentication token provided.internal_error- The 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.enterprise_is_restricted- The method cannot be called from an Enterprise.no_permission- The 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.access_denied- Access to a resource specified in the request is denied.too_many_attachments- Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message.team_added_to_org- The 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.message_not_found- No message exists with the requested timestamp.missing_scope- The token used is not granted the specific scope permissions required to complete this request.missing_post_type- The method was called via aPOSTrequest and included a data payload, but the request did not include aContent-Typeheader.accesslimited- Access to this method is limited on the current networkmsg_too_long- Message text is too long. Thetextfield cannot exceed 4,000 characters.markdown_text_conflict- Markdown text cannot be used in conjunction withblocksortextargument.token_expired- Authentication token has expiredfile_deleted- File to share deleted.cant_broadcast_message- Unable to broadcast this message.invalid_charset- The method was called via aPOSTrequest, but thecharsetspecified in theContent-Typeheader was invalid. Valid charset names are:utf-8iso-8859-1.method_deprecated- The method has been deprecated.file_not_found- One or more of the provided file IDs could not be found.blocked_file_type- Admin has disabled uploading this type of file.is_inactive- The message cannot be edited within a frozen, archived or deleted channel.not_allowed_token_type- The token type used in this request is not allowed.org_login_required- The workspace is undergoing an enterprise migration and will not be available until migration is complete.invalid_auth- Some 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.block_mismatch- Rich-text blocks cannot be replaced with non-rich-text blocksmetadata_too_large- Metadata exceeds size limit