Skip to main content

Quick Start

Install slackblocks and build your first valid Block Kit message. The language selector in the top navigation controls the instructions and examples on this page.

Install the package

Python 3.10 or newer is required.

pip install slackblocks

Build a message

from slackblocks import Message, SectionBlock

message = Message(
channel="#general",
text="Hello from slackblocks!",
blocks=[SectionBlock("Hello, world!")],
)

print(message.json())

Message validates the payload as it is constructed and renders it as Slack-compatible JSON. The text value is the plain-text fallback Slack uses for notifications and accessibility.

Where to go next

slackblocks constructs payloads but does not send HTTP requests. Continue with Sending Messages to connect the payload to Slack, or explore Using Blocks to build richer layouts.

For package-manager alternatives and environment details, see Installation.