Skip to main content

Basic Example

{
  "type": "actions",
  "elements": [
    {
      "type": "button",
      "text": "Action 1",
      "action_id": "action_1"
    }
  ]
}

Complete Example

Example Code
[
  {
    "type": "actions",
    "action_url": "https://api.example.com/handle-action",
    "block_id": "ticket_actions",
    "elements": [
      {
        "type": "button",
        "text": "Approve",
        "action_id": "approve",
        "value": "approved",
        "style": "primary"
      },
      {
        "type": "button",
        "text": "Request Changes",
        "action_id": "request_changes",
        "value": "changes_requested",
        "style": "default"
      },
      {
        "type": "button",
        "text": "Reject",
        "action_id": "reject",
        "value": "rejected",
        "style": "danger",
        "confirm": {
          "title": "Confirm Rejection",
          "text": "Are you sure you want to reject this request?",
          "confirm_text": "Reject",
          "deny_text": "Cancel"
        }
      }
    ]
  }
]

Properties

type
string
required
Identifies this as an actions blockMust be actions
elements
array
required
Array of Button blocks displayed horizontally in a row
action_url
string
required
The default endpoint URL for all buttons in this actions block. Individual buttons can override this with their own action_url.
block_id
string
required
A unique identifier for this actions block. Included in action payloads for server-side identification.

How It Works

  1. The actions block renders its child buttons in a horizontal row
  2. When a user clicks a button, the action payload is POSTed to the button’s action_url (or the parent actions block’s action_url)
  3. The server processes the action and responds with new BlockKit content
  4. The response can replace, update, or append blocks in the UI

Nesting Rules

The actions block can be placed inside: The actions block can only contain:

Usage Notes

  • Use the actions block to group related action buttons together
  • Buttons inside an actions block are displayed side-by-side horizontally
  • Set the action_url on the actions block to apply a default endpoint to all child buttons
  • Each button can override the parent action_url if it needs to POST to a different endpoint