Claude
Skills
Sign in
Back

slack

Included with Lifetime
$97 forever

Slack API for messages and channels. Use when user mentions "Slack", "slack.com", shares a Slack link, "send to Slack", "Slack channel", or asks about workspace.

Backend & APIs

What this skill does


## Troubleshooting

If requests fail, run `zero doctor check-connector --env-name SLACK_TOKEN` or `zero doctor check-connector --url https://slack.com/api/chat.postMessage --method POST`

## Messages

### Send Message

```bash
curl -s -X POST "https://slack.com/api/chat.postMessage" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"text\": \"Hello, World\"}"
```

### Send with Block Kit

```bash
curl -s -X POST "https://slack.com/api/chat.postMessage" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"text\": \"Fallback text\", \"blocks\": [{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"*Alert:* Something happened\"}}, {\"type\": \"section\", \"fields\": [{\"type\": \"mrkdwn\", \"text\": \"*Status:*\\nActive\"}, {\"type\": \"mrkdwn\", \"text\": \"*Priority:*\\nHigh\"}]}]}"
```

Block Kit Builder: https://app.slack.com/block-kit-builder

### Reply in Thread

```bash
curl -s -X POST "https://slack.com/api/chat.postMessage" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"thread_ts\": \"<message-ts>\", \"text\": \"Thread reply\"}"
```

### Update Message

```bash
curl -s -X POST "https://slack.com/api/chat.update" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"ts\": \"<message-ts>\", \"text\": \"Updated message\"}"
```

### Delete Message

```bash
curl -s -X POST "https://slack.com/api/chat.delete" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"ts\": \"<message-ts>\"}"
```

### Schedule Message

```bash
curl -s -X POST "https://slack.com/api/chat.scheduleMessage" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"text\": \"Scheduled message\", \"post_at\": 1735689600}"
```

`post_at` is a Unix timestamp. Must be within 120 days.

### List Scheduled Messages

```bash
curl -s -X POST "https://slack.com/api/chat.scheduledMessages.list" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\"}"
```

### Delete Scheduled Message

```bash
curl -s -X POST "https://slack.com/api/chat.deleteScheduledMessage" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"scheduled_message_id\": \"<scheduled-id>\"}"
```

### Send Ephemeral Message

Only visible to the specified user.

```bash
curl -s -X POST "https://slack.com/api/chat.postEphemeral" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"user\": \"<user-id>\", \"text\": \"Only you can see this\"}"
```

### Get Permalink

```bash
curl -s "https://slack.com/api/chat.getPermalink?channel=<channel-id>&message_ts=<message-ts>" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

## Channels (Conversations)

Slack uses a unified "conversations" API for public channels, private channels, DMs, and group DMs.

### List Channels

```bash
curl -s "https://slack.com/api/conversations.list?types=public_channel&limit=100" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

`types`: `public_channel`, `private_channel`, `mpim` (group DM), `im` (DM). Comma-separated for multiple.

### Get Channel Info

```bash
curl -s "https://slack.com/api/conversations.info?channel=<channel-id>" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

### Get Channel History

```bash
curl -s "https://slack.com/api/conversations.history?channel=<channel-id>&limit=20" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

Params: `latest`, `oldest` (Unix timestamps), `inclusive`, `limit` (max 1000), `cursor`.

### Get Thread Replies

```bash
curl -s "https://slack.com/api/conversations.replies?channel=<channel-id>&ts=<thread-ts>&limit=50" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

### List Channel Members

```bash
curl -s "https://slack.com/api/conversations.members?channel=<channel-id>&limit=100" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

### Create Channel

```bash
curl -s -X POST "https://slack.com/api/conversations.create" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"name\": \"project-updates\", \"is_private\": false}"
```

### Invite Users to Channel

```bash
curl -s -X POST "https://slack.com/api/conversations.invite" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"users\": \"<user-id-1>,<user-id-2>\"}"
```

### Remove User from Channel

```bash
curl -s -X POST "https://slack.com/api/conversations.kick" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"user\": \"<user-id>\"}"
```

### Join Channel

```bash
curl -s -X POST "https://slack.com/api/conversations.join" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\"}"
```

### Leave Channel

```bash
curl -s -X POST "https://slack.com/api/conversations.leave" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\"}"
```

### Set Channel Topic

```bash
curl -s -X POST "https://slack.com/api/conversations.setTopic" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"topic\": \"New topic text\"}"
```

### Set Channel Purpose

```bash
curl -s -X POST "https://slack.com/api/conversations.setPurpose" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"purpose\": \"Channel purpose text\"}"
```

### Rename Channel

```bash
curl -s -X POST "https://slack.com/api/conversations.rename" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"name\": \"new-channel-name\"}"
```

### Archive Channel

```bash
curl -s -X POST "https://slack.com/api/conversations.archive" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\"}"
```

### Unarchive Channel

```bash
curl -s -X POST "https://slack.com/api/conversations.unarchive" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\"}"
```

### Mark Channel as Read

```bash
curl -s -X POST "https://slack.com/api/conversations.mark" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"channel\": \"<channel-id>\", \"ts\": \"<message-ts>\"}"
```

### Open DM

```bash
curl -s -X POST "https://slack.com/api/conversations.open" \
  --header "Authorization: Bearer $SLACK_TOKEN" \
  --header "Content-Type: application/json" \
  -d "{\"users\": \"<user-id>\"}"
```

Returns a channel ID for the DM. Use multiple comma-separated user IDs for group DM.

## Users

### List Users

```bash
curl -s "https://slack.com/api/users.list?limit=100" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

### Get User Info

```bash
curl -s "https://slack.com/api/users.info?user=<user-id>" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

### Look Up User by Email

```bash
curl -s "https://slack.com/api/users.lookupByEmail?email=<user-email>" \
  --header "Authorization: Bearer $SLACK_TOKEN"
```

### Get User Pr
Files: 1
Size: 19.5 KB
Complexity: 23/100
Category: Backend & APIs

Related in Backend & APIs