Connectors
Messages · Channels · Users
provider="slack"

Connect Slack

Let your Python automations post, read channels and look up people as the Slack user who runs them, through your own Slack app.

· Setup essentials; a full guide is on its way

The slack preset signs people in with a user token, so a run acts as the person who started it: messages are posted as them, and they only see the channels they're in.

Declare the connection

from callables import Connection, Group

slack = Connection("slack", provider="slack", scopes=["chat:write", "channels:read"])
team = Group("slack", title="Slack", connections=[slack])

Call the Slack Web API with slack.token:

import requests


@team.deploy(title="Post a message")
def post(channel: str, text: str) -> str:
    """Posts a message as you."""
    resp = requests.post("https://slack.com/api/chat.postMessage",
                         headers={"Authorization": f"Bearer {slack.token}"},
                         json={"channel": channel, "text": text}).json()
    if not resp.get("ok"):
        raise RuntimeError(f"Slack said: {resp.get('error')}")
    return f"Posted to {channel}."

Slack answers HTTP 200 even when a call fails, so check ok in the response.

Set up the Slack app

  1. At api.slack.com/apps, click Create New App → From scratch, and pick your workspace.
  2. Under OAuth & Permissions → Redirect URLs, add https://callables.app/connections/callback.
  3. On the same page, add your scopes under User Token Scopes (not Bot Token Scopes), matching scopes in your code.
  4. From Basic Information, copy the Client ID and Client Secret into your project's secrets as SLACK_CLIENT_ID and SLACK_CLIENT_SECRET, or the names you give client_id=Secret(...) and client_secret=Secret(...).
You want toUser token scope
Post messageschat:write
List public channelschannels:read
Read public channel historychannels:history
Look up peopleusers:read, users:read.email

Testing locally

Slack expects redirect URLs to use https, so call connect's http://localhost address may be refused. If it is, test from the web app, or put a user token you already have in .env as SLACK_ACCESS_TOKEN: call local uses it directly.

A full step-by-step Slack guide is on its way. Until then, the connections docs cover how connections work.

Run your scripts on each person's own account

Declare a connection, push, and share. Everyone connects once and every run uses their account.

Read the connections docs

Other connectors