Button Block

The button block renders one or more clickable buttons. When clicked, they fire a button_click interaction to your webhook. Requires channel mode: "interactive".

Fields

Field Type Required Description
type string Yes "button"
buttons Button[] Yes Array of button objects (1 or more)

Button Object

Field Type Required Values Default
id string Yes Unique ID within the block
label string Yes Button text
style string No "primary", "secondary", "danger" "primary"
disabled boolean No true, false false

Button Styles

Value Appearance Use case
"primary" Filled, prominent Main action
"secondary" Outlined/ghost Secondary action
"danger" Red, destructive Delete, reject, cancel

Examples

Single Action Button

{
  "type": "button",
  "buttons": [
    { "id": "approve", "label": "Approve", "style": "primary" }
  ]
}

Approve / Reject

{
  "type": "button",
  "buttons": [
    { "id": "approve", "label": "Approve", "style": "primary" },
    { "id": "reject", "label": "Reject", "style": "danger" }
  ]
}

Multi-Action Row

{
  "id": "order-actions",
  "type": "button",
  "buttons": [
    { "id": "view", "label": "View Details", "style": "secondary" },
    { "id": "process", "label": "Process", "style": "primary" },
    { "id": "cancel", "label": "Cancel", "style": "danger" }
  ]
}

Disabled Button

{
  "type": "button",
  "buttons": [
    { "id": "refunded", "label": "Refunded", "style": "secondary", "disabled": true }
  ]
}

Webhook Payload on Click

When a user clicks a button, your webhook receives:

{
  "type": "button_click",
  "card_id": "card-uuid",
  "payload": {
    "button_id": "approve",
    "label": "Approve",
    "card_state": {
      "input-block-id": "some value",
      "select-block-id": "option_1",
      "toggle-block-id": true,
      "multiselect-block-id": ["option_1", "option_2"]
    }
  }
}

card_state is always included and contains the current value of every interactive block in the card (keyed by block id) at the moment the button was pressed. Blocks without an id are omitted.

Use button_id to identify which button was clicked and trigger the appropriate action in your automation.

Button Cooldown

After a button is clicked it briefly shows a Sent indicator (≈ 3 seconds) before becoming clickable again. This prevents accidental double-submissions.

Patching

Disable a Button After Click

A common pattern is to disable a button after it's been clicked to prevent duplicate actions:

{
  "id": "my-button-block",
  "patch": {
    "buttons": [
      {
        "id": "approve",
        "patch": {
          "disabled": true,
          "label": "Approved",
          "style": "secondary"
        }
      }
    ]
  }
}

Replace All Buttons

{
  "id": "my-button-block",
  "patch": {
    "buttons": [
      { "id": "done", "label": "Done", "style": "secondary", "disabled": true }
    ]
  }
}

Note: Patching buttons without individual patch objects replaces the entire button array.