Library / SDK
slackapi/python-slack-sdk avatar
slackapi/python-slack-sdk

slack_sdk gives each Slack API its own Python package, but Events and Interactivity live in Bolt instead

Slack Developer Kit for Python

4,018 stars874 forksPythonMIT

At a glance

What is it?
slackapi/python-slack-sdk splits Slack's platform into small modules for the Web API, webhooks, Socket Mode, OAuth, SCIM and more. This article covers what each one does, what it leaves to Bolt for Python, and which legacy pieces to avoid.
Who is it for?
Install slack_sdk when you need to call the Slack Web API, verify request signatures, run Socket Mode or implement OAuth from Python 3.7 or newer. Reach for Bolt for Python instead when your app handles Events API and Interactivity, because this SDK sends you there.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 24, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • slackapi/python-slack-sdk4,018 ★ · +0
Star history
Repository2026-10-082026-11-24
slackapi/python-slack-sdk4k4k

0 Stars in the last 47 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

One package per Slack API, so you import only what the app calls

Slack's platform is a set of separate APIs, and this SDK mirrors that with a package for each one. The module list in the README is the map of the library.

slack_sdk.web calls Web API methods. slack_sdk.webhook covers Incoming Webhooks and the response_url values found in interaction payloads. slack_sdk.signature verifies incoming requests from the Slack API server. slack_sdk.socket_mode sends and receives messages over Socket Mode connections. slack_sdk.audit_logs and slack_sdk.scim reach the Audit Logs and SCIM APIs, which are admin-level surfaces. slack_sdk.oauth implements the Slack OAuth flow. slack_sdk.models builds Block Kit UI components with builders. slack_sdk.rtm wraps the RTM API.

The README says these modules are small when used independently and work together without friction. A webhook-only integration never needs to touch the OAuth or Socket Mode code, and you can import slack_sdk.webhook alone for it. Nothing in the README quantifies how small each module is.

The repository layout backs this up. Besides slack_sdk/, the top level holds docs/, tests/, integration_tests/, requirements/, scripts/ and tutorial/, plus a legacy slack/ directory. Because slack_sdk.models only builds Block Kit components and slack_sdk.web only sends requests, assembling a message and posting it are two steps from two modules.

Events API and Interactivity are not here, and the SDK says so

The list of modules has a gap that matters to anyone building a bot. If you want to use Slack's Events API and Interactivity features, the README directs you to the Bolt for Python library. slack_sdk gives you the low-level pieces, such as signature verification and Socket Mode, but it does not provide the event routing layer that decides which handler runs for which event.

That shapes the architecture of an app. A bot that responds to messages and button clicks pairs Bolt with the Web client from this SDK, while a script that only posts notifications can stop at WebClient. The README sends token and authentication details to a separate Auth Guide on docs.slack.dev, so credentials are not explained on the front page.

If you land here looking for a decorator-based handler API, you are in the wrong repository.

Sending a message needs a bot token, a channel and the right scope

The README's first example creates a WebClient from the SLACK_BOT_TOKEN environment variable and posts to a channel. It catches SlackApiError, which is raised when the response has ok set to false, and the error string is something like invalid_auth or channel_not_found.

python
import os
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError

client = WebClient(token=os.environ['SLACK_BOT_TOKEN'])

try:
    response = client.chat_postMessage(channel='#random', text="Hello world!")
    assert response["message"]["text"] == "Hello world!"
except SlackApiError as e:
    # You will get a SlackApiError if "ok" is False
    assert e.response["ok"] is False
    assert e.response["error"]  # str like 'invalid_auth', 'channel_not_found'
    print(f"Got an error: {e.response['error']}")

The example posts to a channel name, but the README recommends the channel_id wherever possible. If the bot user is not in the channel yet, invite it first, or add chat:write.public to the Bot Token Scopes to post in any public channel. Skipping that step is the usual cause of a channel_not_found error in a first script.

The assertions in the snippet are the README's way of confirming that Slack accepted the call and that the message text matches what you sent. In your own code you would replace them with logging or retries. The comment in the except branch also notes that a corresponding status code is available on the response, so you can tell an HTTP failure from an API-level one.

File uploads take a path in the API call

The README says the file upload process was changed to be much easier. You include a path to the file directly in the API call and upload it that way.

The upload example uses the same WebClient setup, the same SLACK_BOT_TOKEN variable and the same SlackApiError handling as the message example. The README gives no parameter list for uploads, so read the Web client guide on docs.slack.dev before relying on a particular argument.

The practical limit is the one that applies to any token. The bot can only upload to places it has been invited, and a rejected upload comes back as a SlackApiError whose error string you must log, since the exception message alone may not tell you the cause.

Async clients and network options are listed, with the detail left to the docs

The table of contents shows two more areas that the front page only names. Async usage has two entries, WebClient as a script and WebClient in a framework, which refer to the AsyncWebClient class. Advanced Options covers SSL, Proxy and DNS performance, followed by an Example.

If your app runs inside an event loop, such as a web framework, the async client is the one to use, so a blocking call does not stall other requests. Corporate networks that route through a proxy or inspect TLS are why SSL and Proxy options exist.

The README gives no parameter names under these headings, so none are claimed here. The full guides are at docs.slack.dev/tools/python-slack-sdk, which is also the project's homepage.

Python 3.7 is the floor, and slackclient is the library to migrate off

pyproject.toml sets requires-python to 3.7 or higher. The classifiers list CPython and PyPy and Python 3.7 through 3.15, and the development status is Production/Stable. Install with:

bash
$ pip install slack_sdk

The package name uses an underscore, slack_sdk. The older slackclient project on PyPI is in maintenance mode, and slack_sdk is its successor. The README points to a v3 migration guide so an app keeps working after the update. The wheel is built universal, and the package finder includes both slack* and slack_sdk*, which is why the repository still contains a slack/ directory next to slack_sdk/.

Optional dependencies come from requirements/optional.txt. The lint config uses ruff with a line length of 125 and selects the E, W, F and D rule families.

The project keywords are slack, slack-api, web-api, slack-rtm, websocket, chat, chatbot and chatops, and the build backend is setuptools. Version numbers come from slack_sdk.version.__version__, so the number reported at runtime is the same one PyPI shows.

Releases arrive about monthly, and the tutorial centers on the Web and RTM APIs

The release feed shows v3.44.1 on 2026-09-03, v3.45.0 on 2026-10-01 and v3.46.0 on 2026-10-30. The repository is not archived and the last push was 2026-10-24. Pin an exact version in production, since minor versions arrive roughly every month.

The getting started tutorial in the tutorial/ folder builds a basic Slack app in under ten minutes. It needs general programming knowledge and Python basics, and it focuses on interacting with the Web API and the RTM API.

Support and development sections exist in the README, and the repository carries integration_tests/, tests/, scripts/ and an AGENTS.md. The license is MIT.

Editorial conclusion

Install slack_sdk when you need to call the Slack Web API, verify request signatures, run Socket Mode or implement OAuth from Python 3.7 or newer. Reach for Bolt for Python instead when your app handles Events API and Interactivity, because this SDK sends you there. If you still run slackclient, plan the migration to v3 now, and check the RTM and tutorial material before copying it, since both lean on the older real-time API.

Frequently asked questions

Is there a Slack API for Python?

Yes. slack_sdk is the Python SDK, with modules such as slack_sdk.web for Web API methods, slack_sdk.webhook, slack_sdk.socket_mode and slack_sdk.oauth. Install it with pip install slack_sdk.

Can I build a Slack bot using Python with slack_sdk?

Yes. Create a WebClient with a bot token and call chat_postMessage to send messages. For Events API and Interactivity features, the README points to the Bolt for Python library.

Is there an API for Slack?

Slack offers several APIs, including the Web API, Incoming Webhooks, Socket Mode, Audit Logs and SCIM. This SDK provides a package for each of them.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. slackapi/python-slack-sdk on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/slackapi-python-slack-sdk.svg)](https://hysenlabs.com/projects/slackapi-python-slack-sdk)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/slackapi-python-slack-sdk.svg)](https://hysenlabs.com/projects/slackapi-python-slack-sdk)

Was this useful?