/chat.postMessage
POST
/chat.postMessage
chat
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://slack.com/api/chat.postMessage' \
--header 'token;' \
--data-urlencode 'channel='
Response Response Example
200 - response
{
"channel": "C1H9RESGL",
"message": {
"attachments": [
{
"fallback": "This is an attachment's fallback",
"id": 1,
"text": "This is an attachment"
}
],
"bot_id": "B19LU7CSY",
"subtype": "bot_message",
"text": "Here's a message for you",
"ts": "1503435956.000247",
"type": "message",
"username": "ecto1"
},
"ok": true,
"ts": "1503435956.000247"
}
Request
Header Params
token
stringÂ
required
chat:write
Body Params application/x-www-form-urlencoded
as_user
stringÂ
optional
attachments
stringÂ
optional
blocks
stringÂ
optional
channel
stringÂ
required
icon_emoji
stringÂ
optional
icon_url
. Must be used in conjunction with as_user
set to false
, otherwise ignored. See authorship below.icon_url
stringÂ
optional
as_user
set to false, otherwise ignored. See authorship below.link_names
stringÂ
optional
mrkdwn
stringÂ
optional
false
. Enabled by default.parse
stringÂ
optional
none
. See below.reply_broadcast
stringÂ
optional
thread_ts
and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false
.text
stringÂ
optional
thread_ts
stringÂ
optional
ts
value to make this message a reply. Avoid using a reply's ts
value; use its parent instead.unfurl_links
stringÂ
optional
unfurl_media
stringÂ
optional
username
stringÂ
optional
as_user
set to false, otherwise ignored. See authorship below.Responses
Modified at 2023-08-15 05:39:45