Blocks are a series of components that can be combined to create visually rich and compellingly interactive messages.
Read our guide to building block layouts to learn where and how to use these blocks. You can include up to 50 blocks in each message, and 100 blocks in modals or Home tabs.
This page describes the JSON payloads that your app can use to generate each block. Select the block you'd like to build:
Block type | Available in surfaces | Compatible block elements |
---|---|---|
Actions block | Modals Home tabs | Many. See below. |
Context block | Modals Home tabs | Image |
Divider block | Modals Home tabs | None. |
File block | None. | |
Header block | Modals Home tabs | None. |
Image block | Modals Home tabs | None. |
Input block | Modals Home tabs | Many. See below. |
Rich text block | Modals Home tabs | None. |
Section block | Modals Home tabs | Many. See below. |
Video block | Modals Home tabs | None. |
Holds multiple interactive elements.
Available in surfaces | Compatible block elements |
---|---|
Modals Home tabs | Button Checkboxes Date picker Datetime picker Multi-select menus Overflow menu Radio buttonRich text input Select menu Time picker Workflow buttons |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For an actions block, type is always actions . |
Yes |
elements |
Object[] | An array of interactive element objects - buttons, select menus, overflow menus, or date pickers. There is a maximum of 25 elements in each action block. | Yes |
block_id |
String | A unique identifier for a block. If not specified, a block_id will be generated. You can use this block_id when you receive an interaction payload to identify the source of the action. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id . |
No |
An actions block with a select menu and a button:
View this block in Block Kit Builder
{
"type": "actions",
"block_id": "actions1",
"elements": [
{
"type": "static_select",
"placeholder":{
"type": "plain_text",
"text": "Which witch is the witchiest witch?"
},
"action_id": "select_2",
"options": [
{
"text": {
"type": "plain_text",
"text": "Matilda"
},
"value": "matilda"
},
{
"text": {
"type": "plain_text",
"text": "Glinda"
},
"value": "glinda"
},
{
"text": {
"type": "plain_text",
"text": "Granny Weatherwax"
},
"value": "grannyWeatherwax"
},
{
"text": {
"type": "plain_text",
"text": "Hermione"
},
"value": "hermione"
}
]
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Cancel"
},
"value": "cancel",
"action_id": "button_1"
}
]
}
An actions block with a datepicker, an overflow, and a button:
View this block in Block Kit Builder
{
"type": "actions",
"block_id": "actionblock789",
"elements": [
{
"type": "datepicker",
"action_id": "datepicker123",
"initial_date": "1990-04-28",
"placeholder": {
"type": "plain_text",
"text": "Select a date"
}
},
{
"type": "overflow",
"options": [
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-0"
},
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-1"
},
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-2"
},
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-3"
},
{
"text": {
"type": "plain_text",
"text": "*this is plain_text text*"
},
"value": "value-4"
}
],
"action_id": "overflow"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Click Me"
},
"value": "click_me_123",
"action_id": "button"
}
]
}
Displays contextual info, which can include both images and text.
Available in surfaces | Compatible block elements |
---|---|
Modals Home tabs | Image |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For a context block, type is always context . |
Yes |
elements |
Object[] | An array of image elements and text objects. Maximum number of items is 10. | Yes |
block_id |
String | A unique identifier for a block. If not specified, one will be generated. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id . |
No |
View this block in Block Kit Builder
{
"type": "context",
"elements": [
{
"type": "image",
"image_url": "https://image.freepik.com/free-photo/red-drawing-pin_1156-445.jpg",
"alt_text": "images"
},
{
"type": "mrkdwn",
"text": "Location: **Dogpatch**"
}
]
}
Visually separates pieces of info inside of a message.
A content divider, like an <hr>
, to split up different blocks inside of a message. The divider block is nice and neat, requiring only a type
.
Available in surfaces | Compatible block elements |
---|---|
Modals Home tabs | None |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For a divider block, type is always divider . |
Yes |
block_id |
String | A unique identifier for a block. If not specified, one will be generated. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id . |
No |
View this block in Block Kit Builder
{
"type": "divider"
}
Displays a remote file.
You can't add this block to app surfaces directly, but it will show up when retrieving messages that contain remote files.
If you want to add remote files to messages, follow our guide.
Available in surfaces | Compatible block elements |
---|---|
None |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For a file block, type is always file . |
Yes |
external_id |
String | The external unique ID for this file. | Yes |
source |
String | At the moment, source will always be remote for a remote file. |
Yes |
block_id |
String | A unique identifier for a block. If not specified, one will be generated. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id . |
No |
{
"type": "file",
"external_id": "ABCD1",
"source": "remote",
}
Displays a larger-sized text block.
A header
is a plain-text block that displays in a larger, bold font. Use it to delineate between different groups of content in your app's surfaces.
Available in surfaces | Compatible block elements |
---|---|
Modals Home tabs | None |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For this block, type will always be header . |
Yes |
text |
Object | The text for the block, in the form of a plain_text text object. Maximum length for the text in this field is 150 characters. |
Yes |
block_id |
String | A unique identifier for a block. If not specified, one will be generated. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id . |
No |
View this block in Block Kit Builder
{
"type": "header",
"text": {
"type": "plain_text",
"text": "A Heartfelt Header"
}
}
Displays an image.
An image block, designed to make those cat photos really pop. Supported file types include png
, jpg
, jpeg
, and gif
.
Available in surfaces | Compatible block elements |
---|---|
Modals Home tabs | None |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For an image block, type is always image . |
Yes |
alt_text |
String | A plain-text summary of the image. This should not contain any markup. Maximum length for this field is 2000 characters. | Yes |
image_url |
String | The URL for a publicly hosted image. You must provide either an image_url or slack_file . Maximum length for this field is 3000 characters. |
No |
slack_file |
Object | A Slack image file object that defines the source of the image. | No |
title |
Object | An optional title for the image in the form of a text object that can only be of type: plain_text . Maximum length for the text in this field is 2000 characters. |
No |
block_id |
String | A unique identifier for a block. If not specified, one will be generated. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id . |
No |
The following three examples show different ways to get the following result:
An image block using image_url
:
View this block in Block Kit Builder
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Please enjoy this photo of a kitten"
},
"block_id": "image4",
"image_url": "http://placekitten.com/500/500",
"alt_text": "An incredibly cute kitten."
}
An image block using slack_file
with a url
:
View this block in Block Kit Builder
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Please enjoy this photo of a kitten"
},
"block_id": "image4",
"slack_file": {
"url": "https://files.slack.com/files-pri/T0123456-F0123456/xyz.png"
},
"alt_text": "An incredibly cute kitten."
}
An image block using slack_file
with a id
:
View this block in Block Kit Builder
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Please enjoy this photo of a kitten"
},
"block_id": "image4",
"slack_file": {
"id": "F0123456",
},
"alt_text": "An incredibly cute kitten."
}
Collects information from users via block elements.
Read our guides to collecting input in modals or in Home tabs to learn how input blocks pass information to your app.
Available in surfaces | Compatible block elements |
---|---|
Modals Home tabs | Checkboxes Date picker Datetime picker Email input File input Multi-select menus Number input Plain-text input Radio button Rich text input Select menu Time picker URL input |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For an input block, type is always input . |
Yes |
label |
Object | A label that appears above an input element in the form of a text object that must have type of plain_text . Maximum length for the text in this field is 2000 characters. |
Yes |
element |
Object | A block element. See above for full list. | Yes |
dispatch_action |
Boolean | A boolean that indicates whether or not the use of elements in this block should dispatch a block_actions payload. Defaults to false . This field is incompatible with the file_input block element. If dispatch_action is set to true and a file_input block element is provided, an unsupported type error will be raised. |
No |
block_id |
String | A unique identifier for a block. If not specified, one will be generated. Maximum length for this field is 255 characters. block_id should be unique for each message or view and each iteration of a message or view. If a message or view is updated, use a new block_id . |
No |
hint |
Object | An optional hint that appears below an input element in a lighter grey. It must be a text object with a type of plain_text . Maximum length for the text in this field is 2000 characters. |
No |
optional |
Boolean | A boolean that indicates whether the input element may be empty when a user submits the modal. Defaults to false . |
No |
An input block containing a plain-text input element:
View this block in Block Kit Builder
{
"type": "input",
"element": {
"type": "plain_text_input"
},
"label": {
"type": "plain_text",
"text": "Label",
"emoji": true
}
}
Displays formatted, structured representation of text.
It is also the output of the Slack client's WYSIWYG message composer, so all messages sent by end-users will have this format. Use this block to include user-defined formatted text in your Block Kit payload. While it is possible to format text with mrkdwn
, rich_text
is strongly preferred and allows greater flexibility.
You might encounter a rich_text
block in a message payload, as a built-in type in workflow apps, or as output of the rich_text_input
block element.
Available in surfaces | Compatible block elements |
---|---|
Modals Home tabs | None |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For a rich text block, type is always rich_text . |
Yes |
elements |
Object[] | An array of rich text objects - rich_text_section , rich_text_list , rich_text_preformatted , and rich_text_quote . See your specific desired element below for more details. |
Yes |
block_id |
String | A unique identifier for a block. If not specified, one will be generated. Maximum length for this field is 255 characters. block_id should be unique for each message or view and each iteration of a message or view. If a message or view is updated, use a new block_id . |
No |
Rich text blocks can be deeply nested. For instance: a rich_text_list
can contain a rich_text_section
which can contain bold style text. More details on how that works is shown in the examples.
Sub-elements are what comprise the elements
array in a rich text block. There are four available rich text object sub-elements.: rich_text_section
, rich_text_list
, rich_text_preformatted
, and rich_text_quote
. Because many of the elements include a section block, the details of that element are listed first, followed by the others.
rich_text_section
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of sub-element; in this case, rich_text_section . |
Yes |
elements |
Object [] | An array of rich text elements. | Yes |
rich_text_section
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Hello there, I am a basic rich text block!"
}
]
}
]
},
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Hello there, "
},
{
"type": "text",
"text": "I am a bold rich text block!",
"style": {
"bold": true
}
}
]
}
]
},
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Hello there, "
},
{
"type": "text",
"text": "I am an italic rich text block!",
"style": {
"italic": true
}
}
]
}
]
},
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Hello there, "
},
{
"type": "text",
"text": "I am a strikethrough rich text block!",
"style": {
"strike": true
}
}
]
}
]
}
rich_text_list
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of sub-element; in this case, rich_text_list . |
Yes |
style |
String | Either bullet or ordered , the latter meaning a numbered list. |
Yes |
elements |
Object [] | An array of rich_text_section objects containing two properties: type , which is "rich_text_section", and elements , which is an array of rich text element objects. |
Yes |
indent |
Number | Number of pixels to indent the list. | No |
offset |
Number | Number of pixels to offset the list. | No |
border |
Number | Number of pixels of border thickness. | No |
rich_text_list
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"block_id": "block1",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "My favorite Slack features (in no particular order):"
}
]
},
{
"type": "rich_text_list",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Huddles"
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Canvas"
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Developing with Block Kit"
}
]
}
],
"style": "bullet",
"indent": 0,
"border": 1
},
],
}
Let's say we want to create a nested list, for example something that looks like this:
Breakfast foods I enjoy:
To create that in rich text, create three instances of rich_text_list
, the middle one using the indent
property to indent the types of eggs into that sub-list.
View this block in Block Kit Builder
{
"type": "rich_text",
"block_id": "block1",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Breakfast foods I enjoy:"
}
]
},
{
"type": "rich_text_list",
"style": "bullet",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Hashbrowns"
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Eggs"
}
]
}
]
},
{
"type": "rich_text_list",
"style": "bullet",
"indent": 1,
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Scrambled"
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Over easy"
}
]
}
]
},
{
"type": "rich_text_list",
"style": "bullet",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Pancakes, extra syrup"
}
]
}
]
}
]
}
rich_text_preformatted
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of the sub-element; in this case, rich_text_preformatted . |
Yes |
elements |
Object [] | An array of rich text elements. | Yes |
border |
Number | Number of pixels of border thickness. | No |
The following are the properties of the link
object option in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case "link". | Yes |
url |
String | The link's url. | Yes |
text |
String | The text shown to the user (instead of the url). If no text is provided, the url is used. | No |
unsafe |
Boolean | Indicates whether the link is safe. | No |
style |
Object | An object containing two boolean properties: bold and italic . |
No |
rich_text_preformatted
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_preformatted",
"elements": [
{
"type": "text",
"text": "{\n \"object\": {\n \"description\": \"this is an example of a json object\"\n }\n}"
},
],
"border": 0
}
]
}
rich_text_quote
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of the sub-element; in this case, rich_text_quote . |
Yes |
elements |
Object [] | An array of rich text elements. | Yes |
border |
Number | Number of pixels of border thickness. | No |
rich_text_quote
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"block_id": "Vrzsu",
"elements": [
{
"type": "rich_text_quote",
"elements": [
{
"type": "text",
"text": "What we need is good examples in our documentation."
}
]
},
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Yes - I completely agree, Luke!"
}
]
}
]
}
For the rich text elements that have a field of elements
, the following types are possible.
broadcast
The following are the properties of the broadcast
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case, "broadcast". | Yes |
range |
String | The range of the broadcast; value can be here , channel , or everyone . Using here notifies only the active members of a channel; channel notifies all members of a channel; everyone notifies every person in the #general channel. |
Yes |
broadcast
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "broadcast",
"range": "everyone"
}
]
}
]
}
color
The following are the properties of the color
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case, "color". | Yes |
value |
String | The hex value for the color. | Yes |
color
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "color",
"value": "#F405B3"
}
]
}
]
}
channel
The following are the properties of the channel
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case, "channel". | Yes |
channel_id |
String | The ID of the channel to be mentioned. | Yes |
style |
Object | An object of six optional boolean properties that dictate style: bold , italic , strike , highlight , client_highlight , and unlink . |
No |
channel
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "channel",
"channel_id": "C123ABC456"
}
]
}
]
}
date
The following are the properties of the date
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case "date". | Yes |
timestamp |
Number | A Unix timestamp for the date to be displayed in seconds. | Yes |
format |
String | A template string containing curly-brace-enclosed tokens to substitute your provided timestamp . See details below. |
Yes |
url |
String | URL to link the entire format string to. |
No |
fallback |
String | Text to display in place of the date should parsing, formatting or displaying fail. | No |
The following are the template strings allowed by the format
property of the date
element type.
{day_divider_pretty}
: Shows today
, yesterday
or tomorrow
if applicable. Otherwise, if the date is in current year, uses the {date_long}
format without the year. Otherwise, falls back to using the {date_long}
format.{date_num}
: Shows date as YYYY-MM-DD.{date_slash}
: Shows date as DD/MM/YYYY (subject to locale preferences).{date_long}
: Shows date as a long-form sentence including day-of-week, e.g. Monday, December 23rd, 2013
.{date_long_full}
: Shows date as a long-form sentence without day-of-week, e.g. August 9, 2020
.{date_long_pretty}
: Shows yesterday
, today
or tomorrow
, otherwise uses the {date_long}
format.{date}
: Same as {date_long_full}
but without the year.{date_pretty}
: Shows today
, yesterday
or tomorrow
if applicable, otherwise uses the {date}
format.{date_short}
: Shows date using short month names without day-of-week, e.g. Aug 9, 2020
.{date_short_pretty}
: Shows today
, yesterday
or tomorrow
if applicable, otherwise uses the {date_short}
format.{time}
: Depending on user preferences, shows just the time-of-day portion of the timestamp using either 12 or 24 hour clock formats, e.g. 2:34 PM
or 14:34
.{time_secs}
: Depending on user preferences, shows just the time-of-day portion of the timestamp using either 12 or 24 hour clock formats, including seconds, e.g. 2:34:56 PM
or 14:34:56
.{ago}
: A human-readable period of time, e.g. 3 minutes ago
, 4 hours ago
, 2 days ago
.date
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "date",
"timestamp": 1720710212,
"format": "{date_num} at {time}",
"fallback": "timey"
}
]
}
]
}
emoji
The following are the properties of the emoji
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case, "emoji". | Yes |
name |
String | The name of the emoji; i.e. "wave" or "wave::skin-tone-2". | Yes |
unicode |
String | Represents the unicode code point of the emoji, where applicable. | No |
emoji
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "emoji",
"name": "basketball"
},
{
"type": "text",
"text": " "
},
{
"type": "emoji",
"name": "snowboarder"
},
{
"type": "text",
"text": " "
},
{
"type": "emoji",
"name": "checkered_flag"
}
]
}
]
}
link
The following are the properties of the link
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case "link". | Yes |
url |
String | The link's url. | Yes |
text |
String | The text shown to the user (instead of the url). If no text is provided, the url is used. | No |
unsafe |
Boolean | Indicates whether the link is safe. | No |
style |
Object | An object containing four boolean properties: bold , italic , strike , and code . |
No |
link
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "link",
"url": "https://api.slack.com"
}
]
}
]
}
text
The following are the properties of the text
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case, "text". | Yes |
text |
String | The text shown to the user. | Yes |
style |
Object | An object containing four boolean fields, none of which are required: bold , italic , strike , and code . |
No |
text
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Hello there, "
},
{
"type": "text",
"text": "I am a bold rich text block!",
"style": {
"bold": true
}
}
]
}
]
}
user
The following are the properties of the user
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case, "user". | Yes |
user_id |
String | The ID of the user to be mentioned. | Yes |
style |
Object | An object of six optional boolean properties that dictate style: bold , italic , strike , highlight , client_highlight , and unlink . |
No |
user
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "user",
"user_id": "U123ABC456"
}
]
}
]
}
usergroup
The following ar the properties of the usergroup
object type in the elements
array.
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of object; in this case "usergroup". | Yes |
usergroup_id |
String | The ID of the user group to be mentioned. | Yes |
style |
Object | An object of six optional boolean properties that dictate style: bold , italic , strike , highlight , client_highlight , and unlink . |
No |
usergroup
exampleView this block in Block Kit Builder
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "usergroup",
"usergroup_id": "G123ABC456"
}
]
}
]
}
Displays text, possibly alongside block elements.
A section
can be used as a text block, in combination with text fields, or side-by-side with certain block elements.
Available in Surfaces | Compatible block elements |
---|---|
Modals Home tabs | Button Checkboxes Date picker Image Multi-select menus Overflow menu Radio button Select menu Time picker Workflow buttons |
Field | Type | Description | Required? |
---|---|---|---|
type |
String | The type of block. For a section block, type will always be section . |
Yes |
text |
Object | The text for the block, in the form of a text object. Minimum length for the text in this field is 1 and maximum length is 3000 characters. This field is not required if a valid array of fields objects is provided instead. |
Preferred |
block_id |
String | A unique identifier for a block. If not specified, one will be generated. You can use this block_id when you receive an interaction payload to identify the source of the action. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id . |
No |
fields |
Object[] | Required if no text is provided. An array of text objects. Any text objects included with fields will be rendered in a compact format that allows for 2 columns of side-by-side text. Maximum number of items is 10. Maximum length for the text in each item is 2000 characters. Click here for an example. |
Maybe |
accessory |
Object | One of the compatible element objects noted above. Be sure to confirm the desired element works with section . |
No |
expand |
Boolean | Whether or not this section block's text should always expand when rendered. If false or not provided, it may be rendered with a 'see more' option to expand and show the full text. For AI Assistant apps, this allows the app to post long messages without users needing to click 'see more' to expand the message. | No |
A text section block:
View this block in Block Kit Builder
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "A message *with some bold text* and _some italicized text_."
}
}
A section block containing text fields:
View this block in Block Kit Builder
{
"type": "section",
"text": {
"text": "A message *with some bold text* and _some italicized text_.",
"type": "mrkdwn"
},
"fields": [
{
"type": "mrkdwn",
"text": "High"
},
{
"type": "plain_text",
"emoji": true,
"text": "Silly"
}
]
}
A section block containing a datepicker element:
View this block in Block Kit Builder
{
"type": "section",
"text": {
"text": "*Haley* has requested you set a deadline for finding a house",
"type": "mrkdwn"
},
"accessory": {
"type": "datepicker",
"action_id": "datepicker123",
"initial_date": "1990-04-28",
"placeholder": {
"type": "plain_text",
"text": "Select a date"
}
}
}
Displays an embedded video player.
A video
block is designed to embed videos in all app surfaces (e.g. link unfurls, messages, modals, App Home) — anywhere you can put blocks! To use the video block within your app, you must have the links.embed:write
scope.
The metadata received in the block payload will be used to construct the description, provider, and title of the video in all clients. Developers have the flexibility to leave non-mandatory fields null and use other blocks to format this content.
links.embed:write
scope for both user and bot tokens.video_url
has to be included in the unfurl domains specified in your app.video_url
should be publicly accessible, unless the app relies on information received from the Events API payloads to make a decision on whether the viewer(s) of the content should have access. If so, the service could create a unique URL accessible only via Slack.video_url
must be compatible with an embeddable iFrame.video_url
must return a 2xx code OR 3xx with less than 5 redirects and an eventual 2xx.video_url
must not point to any Slack-related domain.Available in surfaces | Compatible block elements |
---|---|
Modals Home tabs | None |
Property | Type | Description | Required? |
---|---|---|---|
type |
string | The type of block. For a video block, type will always be video . |
Yes |
alt_text |
string | A tooltip for the video. Required for accessibility | Yes |
author_name |
string | Author name to be displayed. Must be less than 50 characters. | No |
block_id |
string | A unique identifier for a block. If not specified, one will be generated. Maximum length for this field is 255 characters. block_id should be unique for each message and each iteration of a message. If a message is updated, use a new block_id . |
No |
description |
Object | Description for video in the form of a text object that must have type of plain_text . text within must be less than 200 characters. |
Preferred |
provider_icon_url |
string | Icon for the video provider, e.g. YouTube icon. | No |
provider_name |
string | The originating application or domain of the video, e.g. YouTube. | No |
title |
Object | Video title in the form of a text object that must have type of plain_text . text within must be less than 200 characters. |
Yes |
title_url |
string | Hyperlink for the title text. Must correspond to the non-embeddable URL for the video. Must go to an HTTPS URL. | Preferred |
thumbnail_url |
string | The thumbnail image URL | Yes |
video_url |
string | The URL to be embedded. Must match any existing unfurl domains within the app and point to a HTTPS URL. | Yes |
View this block in Block Kit Builder
{
"type": "video",
"title": {
"type": "plain_text",
"text": "Use the Events API to create a dynamic App Home",
"emoji": true
},
"title_url": "https://www.youtube.com/watch?v=8876OZV_Yy0",
"description": {
"type": "plain_text",
"text": "Slack sure is nifty!",
"emoji": true
},
"video_url": "https://www.youtube.com/embed/8876OZV_Yy0?feature=oembed&autoplay=1",
"alt_text": "Use the Events API to create a dynamic App Home",
"thumbnail_url": "https://i.ytimg.com/vi/8876OZV_Yy0/hqdefault.jpg",
}