Chat

Chat Post Ephemeral

POST
/chat.postEphemeral

Sends an ephemeral message to a user in a channel.

Authorization

slackAuth chat:write:user, chat:write:bot
AuthorizationBearer <token>

In: header

Scope: chat:write:user, chat:write:bot

Header Parameters

token*string

Authentication token. Requires scope: chat:write

Content-Type*"application/x-www-form-urlencoded"

Value in

  • "application/x-www-form-urlencoded"

Request Body

application/x-www-form-urlencoded

as_user?boolean

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.

attachments?string

A JSON-based array of structured attachments, presented as a URL-encoded string.

blocks?string

A JSON-based array of structured blocks, presented as a URL-encoded string.

channel*string

Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.

icon_emoji?string

Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.

icon_url?string

URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.

link_names?boolean

Find and link channel names and usernames.

parse?string

Change how messages are treated. Defaults to none. See below.

text?string

How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.

thread_ts?string

Provide another message's ts value to post this message in a thread. Avoid using a reply's ts value; use its parent's value instead. Ephemeral messages in threads are only shown if there is already an active thread.

user*string

id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.

username?string

Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below.

Response Body

application/json

application/json

curl -X POST "https://example.com/chat.postEphemeral" \  -H "token: string" \  -H "Content-Type: application/x-www-form-urlencoded" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'channel=string&user=string'
{  "message_ts": "string",  "ok": "True"}