Go to Slack

Reference: View event payloads

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

view_submission event payloads

Received when a user submits a view in a modal.

Read our guide to handling view submissions to learn how your app should process and respond to these payloads.


Fields

This is a non-exhaustive list of fields that can be encountered in this type of interaction payload:

Field Description
type Helps identify the source of the payload. The type for this interaction is view_submission.
team The workspace that the interaction happened in.
user The user who interacted to trigger this request.
view The source view of the modal that the user submitted.
view.state.values A dictionary of objects keyed with the block_ids of any user-modified input blocks from the modal view. Within each block_id object is another object keyed by the action_id of the child block element of the input block. This final child object will contain the type and submitted value of the input block element.

See the examples below to understand this better — note how the block_id and action_id of the example view correspond with the object keys in the example view_submission payload.
hash A unique value which 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.

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": {
        "multi-line": {
          "ml-value": {
            "type": "plain_text_input",
            "value": "This is my example inputted value"
          }
        }
      }
    },
    "hash": "156663117.cd33ad1f"
  }
}

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": "multi-line",
      "label": {
        "type": "plain_text",
        "text": "Enter your value"
      },
      "element": {
        "type": "plain_text_input",
        "multiline": true,
        "action_id": "ml-value"
      }
    }
  ],
  "submit": {
    "type": "plain_text",
    "text": "Submit"
  }
}

view_closed event payloads

Optionally received when a user dismisses a modal.

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

Fields

Field Description
type Helps identify the source of the payload. The type for this interaction is view_closed.
team The workspace that the interaction happened in.
user The user who dismissed a modal to trigger this request.
view The source modal view that the user dismissed. This will include the full state of the view, including any input blocks and their current values.
is_cleared A 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
}