Skip to main content

Slack Message Types

There are various types of message content that can be sent to your users:

Text

Slack Text Message
Slack Text Message
{
type: "TEXT",
text: "Hello World!",
ephemeral: "ephemeral",
replaceOriginal: true
}
PropertyDescriptionRequired
typeTEXTY
textStringY
ephemeralSet “in_channel” or “ephemeral”; Defaults to “in_channel”N
replaceOriginalSet "true" or "false" ; Defaults to "false"N

Image

Slack Image
Slack Image
{
type: "IMAGE",
url: "http://image.png",
text: "Some title",
ephemeral: "ephemeral",
replaceOriginal: true
}
PropertyDescriptionRequired
typeIMAGEY
urlURL of the image fileY
textStringN
ephemeralSet “in_channel” or “ephemeral”; Defaults to “in_channel”N
replaceOriginalSet "true" or "false" ; Defaults to "false"N
note
  • Image must be a valid image file format, including .jpg, .jpeg, .png and .gif
  • Maximum file size is 25MB

Audio

Slack Audio
Slack Audio
{
type: "AUDIO",
url: "http://audio.mp3",
ephemeral: "ephemeral",
replaceOriginal: true
}
PropertyDescriptionRequired
typeAUDIOY
urlURL of the audio fileY
ephemeralSet “in_channel” or “ephemeral”; Defaults to “in_channel”N
replaceOriginalSet "true" or "false" ; Defaults to "false"N
note
  • Audio must be a valid audio file format, including .aac, .flac, .m4a, .m4p, .mp3, .wav, .wma
  • Maximum file size is 25MB

Video

Slack Video
Slack Video
{
type: "VIDEO",
url: "http://video.mp4",
ephemeral: "ephemeral",
replaceOriginal: true
}
PropertyDescriptionRequired
typeVIDEOY
urlURL of the video fileY
ephemeralSet “in_channel” or “ephemeral”; Defaults to “in_channel”N
replaceOriginalSet "true" or "false" ; Defaults to "false"N
note
  • Video must be a valid video file format, including .mkv, .gif, .avi, .wmv, .rmvb, .mp4, .m4v, .mpg, .mpeg, .3gp
  • Maximum file size is 25MB

File

Slack File
Slack File
{
type: "FILE",
url: "http://file.pdf",
ephemeral: "ephemeral",
replaceOriginal: true
}
PropertyDescriptionRequired
typeFILEY
urlURL of the file attachmentY
ephemeralSet “in_channel” or “ephemeral”; Defaults to “in_channel”N
replaceOriginalSet "true" or "false" ; Defaults to "false"N
note
  • File must be a valid file format, including .pdf
  • Maximum file size is 25MB

Button

Slack Button
Slack Button
Slack Button
Slack Button
{
type: "BUTTON",
text: "What can I do to help?",
buttons: [{
type: "postback",
title: "some title",
payload: "a long payload here"
}],
ephemeral: "ephemeral",
replaceOriginal: true
}
Response Object
PropertyDescriptionRequired
typeBUTTONY
textStringY
buttonsArray of buttons; only "postback" can be set as button typeY
ephemeralSet “in_channel” or “ephemeral”; Defaults to “in_channel”N
replaceOriginalSet "true" or "false" ; Defaults to "false"N
buttons Object
PropertyDescriptionRequired
typepostbackY
titleStringY
payloadCustom defined payload triggersY

Attachment

Attachment is a type of secondary content that can be added under primary content to provide further information to your users.

Slack Attachment
Slack Attachment
{
type: "ATTACHMENT",
text: "some text",
attachments: [Array of attachments objects],
ephemeral: "ephemeral",
replaceOriginal: true
}
PropertyDescriptionRequired
typeATTACHMENTY
textStringN
attachmentsArray of raw attachment JSON (Advanced implementation only)N
ephemeralSet “in_channel” or “ephemeral”; Defaults to “in_channel”N
replaceOriginalSet "true" or "false" ; Defaults to "false"N