Input block
Welcome to the new home of Slack developer docs!
We're still building and not all features are available quite yet. Enjoy this peek into the future!
Not ready for the future? Return to the past at api.slack.com.
Fields
Field | Type | Description | Required? |
---|---|---|---|
type | String | The type of block. For an input block, type is always input . | Required |
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. | Required |
element | Object | A block element. See above for full list. | Required |
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. | Optional |
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 . | Optional |
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. | Optional |
optional | Boolean | A boolean that indicates whether the input element may be empty when a user submits the modal. Defaults to false . | Optional |
Usage info
Read our guides to collecting input in modals or in Home tabs to learn how input blocks pass information to your app.
Example
An input block containing a plain-text input element:
{
"type": "input",
"element": {
"type": "plain_text_input"
},
"label": {
"type": "plain_text",
"text": "Label",
"emoji": true
}
}