Skip to main content

Modal views

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.

Modal view objects are used within the following Web API methods:

Non-standard characters (including characters with diacritics) within view objects are converted and sent in unicode format when you receive the view callback payloads.

Preserving input entry in views

Data entered or selected in input blocks can be preserved while updating views. The new view that you use with views.update should contain the same input blocks and elements with identical block_id and action_id values.

FieldTypeDescriptionRequired?
typeStringThe type of view. Set to modal for modals.Required
titleObjectThe title that appears in the top-left of the modal. Must be a plain_text text element with a max length of 24 characters.Required
blocksArrayAn array of blocks that defines the content of the view. Max of 100 blocks.Required
closeObjectA plain_text element that defines the text displayed in the close button at the bottom-right of the view. Max length of 24 characters.Optional
submitObjectA plain_text element that defines the text displayed in the submit button at the bottom-right of the view. submit is required when an input block is within the blocks array. Max length of 24 characters.Optional
private_metadataStringA string that will be sent to your app in view_submission and block_actions events. Max length of 3000 characters.Optional
callback_idStringAn identifier to recognize interactions and submissions of this particular view. Don't use this to store sensitive information (use private_metadata instead). Max length of 255 characters.Optional
clear_on_closeBooleanWhen set to true, clicking on the close button will clear all views in a modal and close it. Defaults to false.Optional
notify_on_closeBooleanIndicates whether Slack will send your request URL a view_closed event when a user clicks the close button. Defaults to false.Optional
external_idStringA custom identifier that must be unique for all views on a per-team basis.Optional
submit_disabledBooleanWhen set to true, disables the submit button until the user has completed one or more inputs. This property is for configuration modals.
{
"type": "modal",
"title": {
"type": "plain_text",
"text": "Modal title"
},
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "It's Block Kit...but _in a modal_"
},
"block_id": "section1",
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "Click me"
},
"action_id": "button_abc",
"value": "Button value",
"style": "danger"
}
},
{
"type": "input",
"label": {
"type": "plain_text",
"text": "Input label"
},
"element": {
"type": "plain_text_input",
"action_id": "input1",
"placeholder": {
"type": "plain_text",
"text": "Type in here"
},
"multiline": false
},
"optional": false
}
],
"close": {
"type": "plain_text",
"text": "Cancel"
},
"submit": {
"type": "plain_text",
"text": "Save"
},
"private_metadata": "Shhhhhhhh",
"callback_id": "view_identifier_12"
}