Building Interactive Slack Messages with Block Kit: A Practical Guide
Learn how to create a Slack Block Kit message with a text section and a button, understand payload limits, and avoid common pitfalls.
27 Jan 2026, 14:34 UTC

Useful answer
Slack Block Kit lets you compose rich, interactive messages using a JSON structure called blocks. A minimal example contains a section block with formatted text and an actions block that holds a button. When the button is clicked, Slack sends an interactive payload to your request URL, which you must verify before acting on the action.
Worked configuration
The following JSON payload can be sent with chat.postMessage or returned via a response_url. Replace placeholders with your own values.
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Welcome to the demo*\nClick the button below to record your choice."
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Choose A",
"emoji": true
},
"style": "primary",
"action_id": "choose_a",
"value": "option_a"
}
]
}
]
}
To send it, make an authenticated POST to https://slack.com/api/chat.postMessage with a bearer token and the JSON as the request body. The response includes a ts timestamp if successful.
Limits
- Maximum 50 blocks per message.
- Total JSON payload must be ≤ 30 000 characters (≈30 KB).
- Individual text fields in section, context, etc., are limited to 3000 characters.
- Only certain interactive components (button, static_select, overflow, datepicker, etc.) may appear inside an actions block.
- Each
action_idmust be unique within the payload; duplicate IDs cause the button to be ignored.
Common mistakes
- Omitting the
typefield on a block or element – Slack returns a validation error. - Using the same
action_idfor multiple buttons – only the first receives an action. - Exceeding the block count or payload size – Slack replies with HTTP 400 and an error like
invalid_blocksorrequest_too_large. - Failing to verify the request signature on incoming
block_actionsevents – opens the endpoint to spoofed interactions. - Using plain text instead of
mrkdwnwhen you need formatting such as bold or links.
Verification
You can check that the message was accepted by using Slack’s API tester or a curl command:
curl -X POST -H "Authorization: Bearer xoxb‑YOUR‑TOKEN" \\\n -H "Content-Type: application/json" \\\n -d '{"channel":"C01ABCD2EFG","blocks":[{"type":"section","text":{"type":"mrkdwn","text":"Test"}}]}' \\\n https://slack.com/api/chat.postMessage
Look for "ok":true and a ts field in the JSON response.
For interactive buttons, set up an endpoint that receives block_actions events, compute the HMAC SHA256 signature using your signing secret, and compare it to the X‑Slack‑Signature header. Return HTTP 200 with an empty body when the signature matches.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.