Skip to main content

View interaction payloads

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.

There are different types of payloads that can be received when users interact with modal views:

view_submission payloads

Sent to an app's configured Request URL when a user submits a view in a modal.

Read our guide to using modals to learn how your app should process and respond to these payloads.

If you're using our Bolt SDKs, we have additional guidance on how to utilize the view_submission payload:


Properties

This is a list of some properties that can be encountered in this type of interaction payload:

Properties received in a view_submission event may differ based on the source of the interactive elements.

A check in the column means that property is included in a view_submission event sent to a function, a non-function, or both. Functions refer to workflow apps.

PropertyFunctionsNon-FunctionsDescriptionRequired?
typeIdentifies the source of the payload. The type for this interaction is view_submission.Required
teamThe workspace where the view was submitted from. Null if the app is org-installed.Required
userThe user who interacted to trigger this request.Required
viewThe source view of the modal the user submitted.Required
enterpriseThe enterprise that the installed app is a part of, if the app is either workspace-installed on an org, or org-installed.Required
api_app_idA string representing the app ID.Required
function_dataMetadata about the function execution that generated the view where this view submission took place.Required
interactivityAn interactivity object generated as a result of the view submission.Required
bot_access_tokenA workflow (just-in-time) token generated for this view submission.Required
view.state.valuesA dictionary of objects. Each object represents a block in the source view that contained stateful, interactive components. Objects are keyed by the block_id of those blocks. These objects each contain a child object. The child object is keyed by the action_id of the interactive element in the block. This final child object will contain the type and submitted value of the input block element.Optional
hashA unique value that is optionally accepted in views.update and views.publish API calls. When provided to those APIs, the hash is validated such that only the most recent view can be updated. This should be used to ensure the correct view is being updated when updates are happening asynchronously.Optional
response_urls(Deprecated for workflow apps) An array of objects that contain response_url values, used to send message responses. Each object will also contain block_id and action_id values to identify the source of the interaction. Also included is a channel_id which identifies where the response_url will publish to. response_urls is available only when the view contained block elements configured to generate a response_url.Optional

Example

This is an example view_submission payload:

{
"type": "view_submission",
"team": { ... },
"user": { ... },
"view": {
"id": "VNHU13V36",
"type": "modal",
"title": { ... },
"submit": { ... },
"blocks": [ ... ],
"private_metadata": "shhh-its-secret",
"callback_id": "modal-with-inputs",
"state": {
"values": {
"multiline": {
"mlvalue": {
"type": "plain_text_input",
"value": "This is my example inputted value"
}
},
"target_channel": {
"target_select": {
"type": "conversations_select",
"selected_conversation": "C123B12DE"
}
}
}
},
"hash": "156663117.cd33ad1f",
"response_urls": [
{
"block_id": "target_channel",
"action_id": "target_select",
"channel_id": "C123B12DE",
"response_url": "https:\/\/hooks.slack.com\/app\/ABC12312\/1234567890\/A100B100C100d100"
}
]
}
}

This was generated from the submission of this example view:

"view": {
"type": "modal",
"callback_id": "modal-with-inputs",
"title": {
"type": "plain_text",
"text": "Modal with inputs"
},
"blocks": [
{
"type": "input",
"block_id": "multiline",
"label": {
"type": "plain_text",
"text": "Enter your value"
},
"element": {
"type": "plain_text_input",
"multiline": true,
"action_id": "mlvalue"
}
},
{
"block_id": "target_channel",
"type": "input",
"optional": true,
"label": {
"type": "plain_text",
"text": "Select a channel to post the result on",
},
"element": {
"action_id": "target_select",
"type": "conversations_select",
"response_url_enabled": true,
},
}
],
"submit": {
"type": "plain_text",
"text": "Submit"
}
}

view_closed payloads

Optionally sent to an app's configured Request URL when a user dismisses a modal. To receive these payloads, the modal view must have been created with the notify_on_close argument set to true.

Read our guide to using modals to learn how your app should process and respond to these payloads.

Fields

FieldDescription
typeHelps identify the source of the payload. The type for this interaction is view_closed.
teamThe workspace that the interaction happened in.
userThe user who dismissed a modal to trigger this request.
viewThe source modal view that the user dismissed. This will include the full state of the view, excluding any input blocks in the modal.
is_clearedA boolean that represents whether or not a whole view stack was cleared.

Example

{
"type": "view_closed",
"team": {
"id": "TXXXXXX",
"domain": "coverbands"
},
"user": {
"id": "UXXXXXX",
"name": "dreamweaver"
},
"view": {...},
"api_app_id": "AXXXXXX",
"is_cleared": false
}