[metadata]
description: Sends a message to a channel.
docsearch:docusaurus_tag: docs-default-current
docsearch:language: en
docsearch:version: current
docusaurus_locale: en
docusaurus_tag: docs-default-current
docusaurus_version: current
generator: Docusaurus v3.10.2
google-site-verification: d1jXBEojz0KFbjvsojJJ77KWTOf_8sIb3T32nAQY0ak
og:description: Sends a message to a channel.
og:locale: en
og:title: chat.postMessage method | Slack Developer Docs
og:url: https://docs.slack.dev/reference/methods/chat.postMessage
twitter:card: summary_large_image
viewport: width=device-width, initial-scale=1.0

[canonical-links]
https://docs.slack.dev/reference/methods/chat.postMessage

[document-links]
/
/tools/bolt-js
/tools/bolt-python
/tools/java-slack-sdk/guides/getting-started-with-bolt
/tools/slack-cli
All learning resources: https://slack.dev/learn
All tools: /tools/
App Home: /surfaces/app-home
App manifest: /reference/app-manifest
Audit Logs API: /reference/audit-logs-api
Block Kit Builder: https://app.slack.com/block-kit-builder/
Block Kit blocks: /reference/block-kit/blocks
Block Kit: /reference/block-kit
Block kit blocks: /reference/block-kit/blocks
Blog: https://slack.dev/blog
Bolt frameworks: /tools/#bolt
Changelog: /changelog
Changelog: https://docs.slack.dev/changelog
Code samples & tutorials: /samples/
Dev Program: https://api.slack.com/developer-program
Developer newsletter: https://slack.dev/newsletter
Developer program: https://api.slack.com/developer-program
Docs: /
Events: /reference/events
Guides: /
Interaction payloads: /reference/interaction-payloads
LLM? Read llms.txt: https://docs.slack.dev/llms.txt
Learning paths: https://slack.dev/learning-paths/
Legal Holds API: /reference/legal-holds-api-reference
MANAGE APPS: https://api.slack.com/apps
Mentioning Users: /messaging/formatting-message-text#mentioning-users
Methods: /reference/methods
Next chat.scheduleMessage: /reference/methods/chat.scheduleMessage
Objects: /reference/objects
October 2017: /changelog/2017-10-keeping-up-with-the-jsons
Overview: /reference/methods
Previous chat.postEphemeral: /reference/methods/chat.postEphemeral
Privacy: https://slack.com/trust/privacy/privacy-policy
Reference: /reference
Reference: /reference/
Resource library: https://slack.dev/resource-library
SCIM API: /reference/scim-api/scim-api
Samples: /samples
Scopes: /reference/scopes
Slack CLI: /tools/slack-cli/
Slack Connect API: /reference/slack-connect-api-reference
Slack SDKs: /tools/#sdks
Slack Status API: /reference/slack-status-api
Slack certifications: https://trailheadacademy.salesforce.com/all-offerings#f-assetType=Certification&f-products=Slack&f-siteLanguage=en_US
Slack community: https://slack.dev/community
Slack events: https://slack.dev/events
Slack marketplace: https://slack.com/marketplace
Special rate limits apply.: /apis/web-api/rate-limits
Status: https://slack-status.com/
Support: https://docs.slack.dev/developer-support
Terms: https://slack.com/terms-of-service/api
Test tokens: /legacy/legacy-custom-integrations/legacy-custom-integrations-tokens
Tools: /tools
Trailhead: https://trailhead.salesforce.com/
Types: /reference/types
Views: /reference/views
Web API: /apis/web-api/
Workshops: https://slack.dev/workshops
Your Privacy Choices: https://www.salesforce.com/form/other/privacy-request/
Your apps: https://api.slack.com/apps
a message: /messaging
admin: /reference/methods/admin.analytics.getFile
api: /reference/methods/api.test
apps: /reference/methods/apps.activities.list
assistant: /reference/methods/assistant.search.context
attachments: /messaging/formatting-message-text
auth: /reference/methods/auth.revoke
block: /reference/block-kit/blocks
blocks: /reference/methods/blocks.validate
bookmarks: /reference/methods/bookmarks.add
bot_messages: /reference/events/message/bot_message
bots: /reference/methods/bots.info
calls: /reference/methods/calls.add
canvases: /reference/methods/canvases.access.delete
chat.appendStream: /reference/methods/chat.appendStream
chat.delete: /reference/methods/chat.delete
chat.deleteScheduledMessage: /reference/methods/chat.deleteScheduledMessage
chat.getPermalink: /reference/methods/chat.getPermalink
chat.meMessage: /reference/methods/chat.meMessage
chat.postEphemeral: /reference/methods/chat.postEphemeral
chat.postMessage: /reference/methods/chat.postMessage
chat.scheduleMessage: /reference/methods/chat.scheduleMessage
chat.scheduledMessages.list: /reference/methods/chat.scheduledMessages.list
chat.startStream: /reference/methods/chat.startStream
chat.stopStream: /reference/methods/chat.stopStream
chat.unfurl: /reference/methods/chat.unfurl
chat.update: /reference/methods/chat.update
chat: /reference/methods/chat.appendStream
chat:write.customize: /reference/scopes/chat.write.customize
chat:write.public: /reference/scopes/chat.write.public
chat:write: /reference/scopes/chat.write
conversations.list: /reference/methods/conversations.list
conversations: /reference/methods/conversations.acceptSharedInvite
dialog: /reference/methods/dialog.open
dnd: /reference/methods/dnd.endDnd
emoji: /reference/methods/emoji.list
entity: /reference/methods/entity.acknowledgeCommentAction
files: /reference/methods/files.comments.delete
formatting spec: /messaging/formatting-message-text
functions: /reference/methods/functions.completeError
https://bsky.app/profile/slack.dev
https://www.linkedin.com/company/tiny-spec-inc/
https://www.youtube.com/channel/UCY3YECgeBcLCzIrFLP4gblw
lists: /reference/methods/slackLists.access.delete
message guidelines: /concepts/app-design
migration: /reference/methods/migration.exchange
oauth: /reference/methods/oauth.access
openid: /reference/methods/openid.connect.token
pins: /reference/methods/pins.add
rate limiting: /apis/web-api/rate-limits
reactions: /reference/methods/reactions.add
read the Rate Limit documentation: /apis/web-api/rate-limits
reminders: /reference/methods/reminders.add
rtm: /reference/methods/rtm.connect
search: /reference/methods/search.all
shortcut: /interactivity/implementing-shortcuts
slash command: /interactivity/implementing-slash-commands
stars: /reference/methods/stars.add
team: /reference/methods/team.accessLogs
the whole concept of usernames on Slack: /changelog/2017-09-the-one-about-usernames
threading message: /messaging#threading
tooling: /reference/methods/tooling.tokens.rotate
truncate messages: /changelog/2018-truncating-really-long-messages
unfurling links in messages: /messaging/unfurling-links-in-messages
uploading a snippet instead: /reference/methods/files.upload
usergroups: /reference/methods/usergroups.create
users.list: /reference/methods/users.list
users: /reference/methods/users.conversations
views: /reference/methods/views.open
workflows: /reference/methods/workflows.featured.add

[structured-data]
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","item":"https://docs.slack.dev/reference/methods","name":"Methods","position":1},{"@type":"ListItem","item":"https://docs.slack.dev/reference/methods/chat.postMessage","name":"chat.postMessage","position":2}]}

[content]
chat.postMessage method | Slack Developer Docs
reference
Skip to main content
Guides
Reference
Samples
Tools
Changelog
Dev Program
MANAGE APPS
Reference
App manifest
Block Kit
Events
Interaction payloads
Methods
Overview
admin
api
apps
assistant
auth
blocks
bookmarks
bots
calls
canvases
chat
chat.appendStream
chat.delete
chat.deleteScheduledMessage
chat.getPermalink
chat.meMessage
chat.postEphemeral
chat.postMessage
chat.scheduleMessage
chat.scheduledMessages.list
chat.startStream
chat.stopStream
chat.unfurl
chat.update
conversations
dialog
dnd
emoji
entity
files
functions
lists
migration
oauth
openid
pins
reactions
reminders
rtm
search
stars
team
tooling
usergroups
users
views
workflows
Objects
Scopes
Types
Slack Connect API
Views
Audit Logs API
Legal Holds API
SCIM API
Slack Status API
Methods
chat
chat.postMessage
On this page
chat.postMessage
method
Docs
Call generator
Facts
​
Description
Sends a message to a channel.
Method Access
HTTP
Slack CLI
JavaScript
Python
Java
POST https://slack.com/api/chat.postMessage
slack api chat.postMessage
app.client.chat.postMessage
app.client.chat_postMessage
app.client().chatPostMessage
Scopes
Bot token:
chat:write
User token:
chat:write
Content types
application/x-www-form-urlencoded
application/json
Rate Limits
Special rate limits apply.
Arguments
​
Required arguments
token
string
Required
Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.
Example:
xxxx-xxxxxxxxx-xxxx
channel
string
Required
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 arguments
as_user
boolean
Optional
(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
legacy
as_user
parameter
below.
Example:
true
attachments
Optional
A JSON-based array of structured attachments, presented as a URL-encoded string.
Example:
[{"pretext": "pre-hello", "text": "text-world"}]
blocks
Optional
A JSON-based array of structured blocks, presented as a URL-encoded string.
Example:
[{"type": "section", "text": {"type": "plain_text", "text": "Hello world"}}]
current_draft_last_updated_ts
string
Optional
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.
Example:
1524523204.000192
icon_emoji
Optional
Emoji to use as the icon for this message. Overrides
icon_url
.
Example:
:chart_with_upwards_trend:
icon_url
Optional
URL to an image to use as the icon for this message.
Example:
http://lorempixel.com/48/48
link_names
boolean
Optional
Find and link user groups. No longer supports linking individual users; use syntax shown in
Mentioning Users
instead.
Example:
true
markdown_text
string
Optional
Accepts message text formatted in markdown. This argument should not be used in conjunction with
blocks
or
text
. Limit this field to 12,000 characters.
Example:
**This is bold text**
metadata
Optional
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.
Example:
{"event_type": "task_created", "event_payload": { "id": "11223", "title": "Redesign Homepage"}}
mrkdwn
boolean
Optional
Disable Slack markup parsing by setting to
false
. Enabled by default.
Default:
true
Example:
false
parse
Optional
Change how messages are treated. See
below
.
Example:
full
reply_broadcast
boolean
Optional
Used in conjunction with
thread_ts
and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to
false
.
Example:
true
text
Optional
How this field works and whether it is required depends on other fields you use in your API call.
See below
for more detail.
Example:
Hello world
thread_ts
Optional
Provide another message's
ts
value to make this message a reply. Avoid using a reply's
ts
value; use its parent instead.
unfurl_links
boolean
Optional
Pass true to enable unfurling of primarily text-based content.
Example:
true
unfurl_media
boolean
Optional
Pass false to disable unfurling of media content.
Example:
false
username
Optional
Set your bot's user name.
Example:
My Bot
Usage info
​
This method posts
a message
to a public channel, private channel, or direct message (DM, or IM) conversation.
Consider reviewing our
message guidelines
, especially if you're using attachments or message buttons.
The
text
,
blocks
and
attachments
fields
​
The usage of the
text
field changes depending on whether you're using
blocks
. If you're using
blocks
, this is used as a fallback string to display in notifications. If you aren't, this is the main body text of the message. It can be formatted as plain text, or with
mrkdwn
.
The
text
field is not enforced as required when using
blocks
or
attachments
. However, we highly recommended that you include
text
to provide a fallback when using
blocks
, as described above.
Accessibility considerations
​
It is expected behavior that screen readers will default to the top-level
text
field of your post, and will not read the content of any interior
blocks
in the underlying structure of the message. Therefore, to make an accessible app, you must either:
include all necessary content for screen reader users in the top-level
text
field of your message, or
do not include a top-level
text
field if the message has
blocks
, and allow Slack attempt to build it for you by appending content from supported
blocks
to be read by the screen reader.
JSON POST support
​
When POSTing with
application/x-www-form-urlencoded
data, the optional
attachments
argument should contain a JSON-encoded array of
attachments
.
Send JSON!
As of
October 2017
, it's possible to send a well-formatted
application/json
POST body to
chat.postMessage
and other
Web API
write methods. No need to carefully URL-encode your JSON
attachments
and present all other fields as URL encoded key
:value
pairs; just send JSON instead.
Formatting messages
​
Messages are formatted as described in the
formatting spec
. The formatting behavior will change depending on the value of
parse
.
By default, URLs will be hyperlinked. Set
parse
to
none
to remove the hyperlinks.
The behavior of
parse
is different for text formatted with
mrkdwn
. By default, or when
parse
is set to
none
,
mrkdwn
formatting is implemented. To ignore
mrkdwn
formatting, set
parse
to
full
.
Unfurling content
​
By default, we unfurl all links in any messages posted by users and Slack apps. We also unfurl links to media-based content within
Block kit blocks
.
If you want to suppress link unfurls in messages containing
Block Kit blocks
, set
unfurl_links
and
unfurl_media
to false.
For more detailed information about link unfurling, refer to
unfurling links in messages
.
Truncating content
​
For best results, limit the number of characters in the
text
field to 4,000 characters. Ideally, messages should be short and human-readable. Slack will
truncate messages
containing more than 40,000 characters. If you need to post longer messages, please consider
uploading a snippet instead
.
If using
blocks
, the limit and truncation of characters will be determined by the specific type of
block
.
Threads and replies
​
Provide a
thread_ts
value for the posted message to act as a reply to a parent message. Sparingly, set
reply_broadcast
to
true
if your reply is important enough for everyone in the channel to receive.
See
threading message
for a more in-depth look at message threading.
Channels
​
You
must
specify a public channel, private channel, or an IM channel with the
channel
argument. Each one behaves slightly differently based on the authenticated user's permissions and additional arguments, as discussed in the sections below.
Post to a public channel
​
Pass the channel name or the channel's ID (
C123456
) to the
channel
parameter and the message will be posted to that channel. The channel's ID can be retrieved through the
conversations.list
API method.
Post to a private channel
​
As long as the authenticated user is a member of the private channel, pass the channel's ID (
C123456
) to the
channel
parameter and the message will be posted to that channel. The private channel's ID can be retrieved through the
conversations.list
API method.
Post to a multi-person direct message channel
​
As long as the authenticated user is a member of the multi-person direct message (a "private group" or MPIM), you can pass the group's ID (
G123456
) and the message will be posted to that group. The private group's ID can be retrieved through the
conversations.list
API method.
Post to a direct message channel
​
Posting to direct messages (also known as DMs or IMs) can be a little more complex, depending on what you actually want to accomplish.
If you want your app's bot user to start a 1:1 conversation with another user in a workspace, provide the user's ID as the
channel
value and a direct message conversation will be opened if it isn't open already. Resultant messages and associated direct message objects will have a direct message ID you can use from that point forward, if you'd rather.
Bot users
cannot
post to a direct message conversation between two users using
chat.postMessage
. If your app was involved in the conversation, then it would be a multi-person direct message instead. Apps can post to direct message conversations between users when a
shortcut
or
slash command
belonging to that app is used in the conversation.
You will receive a
channel_not_found
error if your app doesn't have permission to enter into a DM with the intended user.
Passing a "username" as a
channel
value is deprecated, along with
the whole concept of
usernames
on Slack
.
Please
always
use channel-like IDs instead to make sure your message gets to where it's going.
Getting a user's ID
​
A list of user IDs can be retrieved via the
users.list
API method.
Begin a conversation in a user's App Home
​
Start a conversation with users in your
App Home
.
With the
chat:write
scope enabled, call
chat.postMessage
and pass a user's ID (
U123456
) as the value of
channel
to post to that user's App Home channel. You can use their direct message channel ID (as found with
conversations.open
, for instance) instead.
Rate limiting
​
chat.postMessage
has special
rate limiting
conditions. It will generally allow an app to post 1 message per second to a specific channel. There are limits governing your app's relationship with the entire workspace above that, limiting posting to several hundred messages per minute. Generous burst behavior is also granted.
Channel membership
​
New Slack apps do
not
begin life with the ability to post in all public channels.
For your new Slack app to gain the ability to post in all public channels, request the
chat:write.public
scope.
Sending messages as other entities
​
Apps can publish messages that appear to have been created by a user in the conversation. The message will be attributed to the user and show their profile photo beside it.
This is a powerful ability and must only be used when the user themselves gives permission to do so. For this reason, this ability is only available when an app has requested and been granted an additional scope —
chat:write.customize
.
Your app should only use this feature in response to an inciting user action. It should never be unexpected or surprising to a user that a message was posted on their behalf, and it should be heavily signposted in advance.
To modify the appearance of the app, make calls to
chat.postMessage
while providing any of the following parameters:
username
to specify the username for the published message.
icon_url
to specify a URL to an image to use as the profile photo alongside the message.
icon_emoji
to specify an emoji (using colon shortcodes, eg.
:white_check_mark:
) to use as the profile photo alongside the message.
If the
channel
parameter is set to a User ID (beginning with
U
), the message will appear in that user's direct message channel with Slack (the system user,
USLACK
). To post a message to that user's direct message channel with the app, use the DM ID (beginning with
D
) instead.
The
chat.delete
method has no accommodations for impersonation. If a message is sent impersonating another user, you will not be able to call
chat.delete
to delete that same message.
Response
​
Response including the "timestamp ID" (
ts
) and the channel-like thing where the message was posted. It also includes the complete message object, as parsed by our servers. This may differ from the provided arguments as our servers sanitize links, attachments, and other properties. Your message may mutate.
{
"ok"
:
true
,
"channel"
:
"C123ABC456"
,
"ts"
:
"1503435956.000247"
,
"message"
:
{
"text"
:
"Here's a message for you"
,
"username"
:
"ecto1"
,
"bot_id"
:
"B123ABC456"
,
"attachments"
:
[
{
"text"
:
"This is an attachment"
,
"id"
:
1
,
"fallback"
:
"This is an attachment's fallback"
}
]
,
"type"
:
"message"
,
"subtype"
:
"bot_message"
,
"ts"
:
"1503435956.000247"
}
}
Typical error response if too many attachments are included
{
"ok"
:
false
,
"error"
:
"too_many_attachments"
}
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.
Error
Description
access_denied
Access to a resource specified in the request is denied.
accesslimited
Access to this method is limited on the current network
account_inactive
Authentication token is for a deleted user or workspace when using a
bot
token.
app_access_restricted
The user does not have permission to use this app.
as_user_not_supported
The
as_user
parameter does not function with workspace apps.
attachment_payload_limit_exceeded
Attachment payload size is too long.
cannot_reply_to_message
This message type cannot have thread replies.
channel_not_found
Value passed for
channel
was invalid.
deprecated_endpoint
The endpoint has been deprecated.
draft_already_deleted
The draft has already been deleted.
draft_already_sent
The draft has already been sent.
draft_has_conflict
The client draft version is out of sync with the server draft version.
draft_not_found
The draft was not found.
duplicate_channel_not_found
Channel associated with
client_msg_id
was invalid.
duplicate_message_not_found
No duplicate message exists associated with
client_msg_id
.
ekm_access_denied
Your message couldn’t be sent because your admins have disabled sending messages to this channel.
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_blocks
Blocks submitted with this message are not valid.
invalid_blocks_format
The
blocks
is not a valid JSON object or doesn't match the Block Kit syntax.
invalid_charset
The 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_data
The 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_metadata_format
Invalid metadata format provided.
invalid_metadata_schema
Invalid metadata schema provided.
invalid_post_type
The 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
.
is_archived
Channel has been archived.
markdown_text_conflict
Markdown text cannot be used in conjunction with
blocks
or
text
argument.
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.
messages_tab_disabled
Messages tab for the app is disabled.
metadata_must_be_sent_from_app
Message metadata can only be posted or updated using an app-level token.
metadata_too_large
Metadata exceeds size limit.
method_deprecated
The method has been deprecated.
missing_file_data
Attempted to share a file but some required data was missing.
missing_post_type
The method was called via a
POST
request and included a data payload, but the request did not include a
Content-Type
header.
missing_scope
The token used is not granted the specific scope permissions required to complete this request.
msg_blocks_too_long
Blocks submitted with this message are too long.
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.
no_text
No message text provided.
not_allowed_token_type
The token type used in this request is not allowed.
not_authed
No authentication token provided.
not_in_channel
Cannot post user messages to a channel they are not in.
org_login_required
The workspace is undergoing an enterprise migration and will not be available until migration is complete.
rate_limited
Application has posted too many messages,
read the Rate Limit documentation
for more information.
ratelimited
The request has been ratelimited. Refer to the
Retry-After
header for when to retry the request.
request_timeout
The method was called via a
POST
request, but the
POST
data was either missing or truncated.
restricted_action
A workspace preference prevents the authenticated user from posting.
restricted_action_non_threadable_channel
Cannot post thread replies into a non_threadable channel.
restricted_action_read_only_channel
Cannot post any message into a read-only channel.
restricted_action_thread_locked
Cannot post replies to a thread that has been locked by admins.
restricted_action_thread_only_channel
Cannot post top-level messages into a thread-only channel.
send_on_behalf_not_allowed
Cannot send on behalf of the provided user.
service_unavailable
The service is temporarily unavailable
slack_connect_canvas_sharing_blocked
Admin has disabled Canvas File sharing in all Slack Connect communications.
slack_connect_file_link_sharing_blocked
Admin has disabled Slack File sharing in all Slack Connect communications.
slack_connect_lists_sharing_blocked
Admin has disabled Lists sharing in all Slack Connect communications.
team_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.
team_not_found
This error occurs if, when using an org-wide token, the
channel_name
is passed instead of the
channel_id
.
token_expired
Authentication token has expired
token_revoked
Authentication token is for a deleted user or workspace or the app has been removed when using a
user
token.
too_many_attachments
Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message.
too_many_contact_cards
Too many contact_cards were provided with this message. A maximum of 10 contact cards are allowed on a message.
two_factor_setup_required
Two factor setup is required.
Legacy concerns
​
Information in the section below applies only to classic apps.
This feature works differently for classic apps.
Legacy authorship
​
Classic apps using the umbrella
bot
scope can't request additional scopes to adjust message authorship.
Legacy
as_user
parameter
​
For classic apps, the best way to control the authorship of a message was to be explicit with the legacy
as_user
parameter. If you didn't use the
as_user
parameter,
chat.postMessage
would guess the most appropriate
as_user
interpretation based on the kind of token you were using. If
as_user
was not provided at all, the value was inferred based on the scopes granted to the caller: If the caller
could
post with
as_user
passed as
false
, then that was how the method behaved; otherwise, the method behaved as if
as_user
were passed as
true
. When the
as_user
parameter was set to
false
, messages were posted as "
bot_messages
", with message authorship attributed to the user name and icons associated with the classic app.
Effect on identity
​
Token types provide varying default identity values for
username
,
icon_url
, and
icon_emoji
.
Test tokens
inherits the icon and username of the token owner.
Slack App user token with
chat:write:user
inherits the icon and username of the token owner.
Slack App bot user token inherits Slack App's icon and app's bot username.
Legacy identity rules in DMs
​
If using
icon_url
,
icon_emoji
, or
username
with
chat.postMessage
and a direct message, some special rules apply to ensure the receiver is crystal clear about who is sending the message:
If the legacy
as_user
argument was false:
Pass the DM channel's ID (
D123456
) as the value of
channel
to post to that DM channel
as the app, bot, or user associated with the token
. You can change the icon and username that go with the message using the
icon_url
and
username
parameters. The IM channel's ID can be retrieved through the
conversations.list
API method.
If the legacy
as_user
parameter was true:
Pass the DM channel's ID (
D123456
) or a user's ID (
U123456
) as the value of
channel
to post to that DM channel
as the app, bot, or user associated with the token
. The IM channel's ID can be retrieved through the
conversations.list
API method. When
as_user
is true, the caller may
not
manipulate the icon and username on the message.
Previous
chat.postEphemeral
Next
chat.scheduleMessage
Copy as markdown
Facts
Arguments
Usage info
The
text
,
blocks
and
attachments
fields
Formatting messages
Threads and replies
Channels
Begin a conversation in a user's App Home
Rate limiting
Channel membership
Sending messages as other entities
Response
Errors
Legacy concerns
Legacy authorship
.
Tools
Slack CLI
Bolt frameworks
Slack SDKs
Block Kit Builder
Developer program
Code samples & tutorials
LLM? Read llms.txt
All tools
Learn
Learning paths
Workshops
Slack certifications
Trailhead
Resource library
All learning resources
Community
Slack community
Slack events
Resources
Docs
Blog
Slack marketplace
Developer newsletter
Manage Apps
Your apps
Status
Privacy
Terms
Cookie Preferences
Support
Changelog
Your Privacy Choices
© 2026 Slack Technologies, LLC, a Salesforce company. All rights reserved. Various trademarks held by their respective owners.
