# Slack API for channels, files and threads

Schedule Slack channel updates, Block Kit headers, CTA buttons, 10-file external uploads and threaded replies via one REST API.

Building Slack publishing across customer workspaces usually means managing OAuth v2 bot tokens, implementing the three-step files.getUploadURLExternal flow, joining public channels before sharing files, formatting Block Kit blocks and tracking channel:ts pairs for replies and analytics. PostSyncer handles every step behind one REST API.

**REST API:** https://postsyncer.com/api/v1 · **MCP server:** https://postsyncer.com/mcp · **Docs:** https://postsyncer.com/docs/platforms/slack

## Example Slack request

```bash
curl -X POST "https://postsyncer.com/api/v1/posts" \
  -H "Authorization: Bearer $POSTSYNCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 4815,
    "schedule_type": "schedule",
    "schedule_for": {
      "date": "2026-12-11",
      "time": "09:00",
      "timezone": "America/Los_Angeles"
    },
    "content": [
      {
        "text": "The new *Ethiopia Guji* lot is roasted and live across all Halden Coffee locations.",
        "media": [
          "https://cdn.postsyncer.com/examples/latte-art.jpg"
        ]
      },
      {
        "text": "Tasting notes: jasmine, stone fruit and honey. Wholesale bags ship Monday."
      }
    ],
    "accounts": [
      {
        "id": 16410,
        "settings": {
          "channel_id": "C01ANNOUNCE",
          "title": "Autumn Harvest Launch",
          "username": "Roastery Updates",
          "icon_emoji": ":coffee:",
          "unfurl_links": true,
          "unfurl_media": true,
          "reply_broadcast": false,
          "cta_label": "View Menu",
          "cta_url": "https://example.com/guji"
        }
      }
    ]
  }'
```

```json
{
  "id": 81510,
  "status": "SCHEDULED",
  "platforms": [
    {
      "account_id": 16410,
      "platform": "slack",
      "status": "PENDING",
      "settings": {
        "channel_id": "C01ANNOUNCE",
        "title": "Autumn Harvest Launch"
      }
    }
  ],
  "skipped_accounts": [],
  "needs_media": []
}
```

## Quick start

1. **Connect a Slack workspace via OAuth or connect link.** Generate a 7-day connect link via POST /api/v1/accounts/connect-links (provider: slack) or connect inside PostSyncer. Each connected Slack workspace is stored as one account with encrypted bot tokens.

2. **Discover target channels and save optional defaults.** Call GET /api/v1/accounts/{account}/slack/channels to list the workspace’s public channels, and the private channels the app was invited to when the key belongs to the person who connected Slack. Pass channel_id per post or save a default channel_id via PUT /api/v1/accounts/{account}/defaults.

3. **Schedule messages, files, buttons and threaded replies.** Send POST /api/v1/posts with Slack mrkdwn copy, Block Kit header/CTA settings, custom bot display identity, up to 10 media/document files and multi-item thread replies.

## Slack endpoints

- `GET /api/v1/accounts/{account}/slack/channels` (`accounts:read`): List a connected workspace’s public channels, and its private ones for the person who connected it.

- `POST /api/v1/posts` (`posts:create / schedule / publish`): Schedule or publish Slack channel messages, Block Kit headers/CTAs, multi-file uploads and threaded replies.

- `POST /api/v1/accounts/connect-links` (`accounts:create`): Create a 7-day OAuth connect link so workspace admins authorize Slack without a PostSyncer login.

- `DELETE /api/v1/posts/{id}` (`posts:delete`): Cancel scheduled posts, or delete a published message with its thread replies, replies sent from PostSyncer and files.

- `GET /api/v1/analytics/posts/{id}` (`analytics:read`): Read emoji reactions (likes) and thread replies (comments) of published Slack posts, on paid plans.

## Slack media and text specs

- **Photos & GIFs** (JPG, JPEG, PNG, GIF, WebP, Up to 10 files · 25 MB each): Uploaded through Slack’s external upload API with alt text, then added to the post’s message.

- **Videos** (MP4, MOV, WebM, Up to 10 files · 100 MB each): Mix freely with photos and documents up to 10 total files per item.

- **Documents** (PDF, DOC, DOCX, PPT, PPTX, Up to 10 files): Release notes, slide decks and briefs. CSV and TXT files aren’t taken: share them as a link.

- **Message & header** (Slack mrkdwn + Block Kit, 40,000 text · 150 header · 75 CTA): Header and CTA render as Block Kit header and actions blocks; long text with them is split across sections (up to 50 blocks).

- **platform key:** slack

- **Account granularity:** 1 PostSyncer account = 1 Slack workspace; channel_id selects the channel per post or via Account Post Defaults.

- **Public channels:** Text posts go out with chat:write.public, without the app joining the channel. A post with files joins a public channel first (conversations.join), since Slack shares files only in channels the app is in.

- **Threads & first comment:** Additional content[] items and first_comment post as replies under the root thread_ts, with optional reply_broadcast.

- **Deleting posts:** DELETE /posts/{id} calls chat.delete on the message (stored as channel_id:ts), its thread replies and the replies sent from PostSyncer, and deletes the post’s files. A message already gone counts as deleted.

- **Text escaping:** &, < and > are escaped, so text shows as typed; user, channel and link markup is kept, and @channel, @here and @everyone never ping.

- **Slow-downs:** Slack’s ratelimited answer is a slow-down, not a refusal: inside a publish PostSyncer waits Slack’s Retry-After and sends again.

- **Analytics metrics:** One reactions.get answer gives reaction totals (likes) and the thread’s reply count (comments). PostSyncer never reads channel history.

## Slack capabilities and settings

Slack is where product teams, customer communities, agencies and internal comms live. PostSyncer brings scheduled Slack publishing into the same API, calendar and defaults workflow as your public social channels.

- **One workspace connection, every channel reachable.** Instead of creating a separate connection per channel, connect each Slack workspace once, list its channels via GET /accounts/{account}/slack/channels, and target any channel_id per post or save a default channel. Private channels are listed only for the person who connected the workspace.

- **Files and text in one message.** Slack retired legacy files.upload in favor of a three-step flow (files.getUploadURLExternal, binary POST to the upload URL, and files.completeUploadExternal). PostSyncer runs all three steps for photos, videos and documents with alt text, then adds the files to the post’s own message, so the text never goes out twice.

- **Structured Block Kit without raw JSON boilerplate.** Pass simple settings keys — title for a bold header block, cta_label and cta_url for an actions link button, username and icon_emoji/icon_url for custom bot identity — and PostSyncer generates valid Block Kit payloads automatically.

- **Threaded announcements & channel broadcast control.** Keep busy channels uncluttered by placing secondary details, links or changelogs in content[1..n] or first_comment. PostSyncer replies cleanly under thread_ts and lets you toggle reply_broadcast when follow-ups should also appear in the main channel.

- `channel_id` (string): Target Slack channel ID (required to publish unless saved in Account Post Defaults).

- `title` (string (≤ 150)): Optional Block Kit header block displayed above the message body.

- `text` (string (≤ 40,000)): Slack-specific mrkdwn text overriding content[0].text.

- `username` (string (≤ 80)): Custom bot display name override (requires chat:write.customize scope).

- `icon_url` (string (https://)): Custom bot avatar URL.

- `icon_emoji` (string): Custom bot emoji icon, such as :rocket: or :coffee:.

- `unfurl_links` (boolean): Enable or disable automatic link preview unfurling (default true).

- `unfurl_media` (boolean): Enable or disable automatic media preview unfurling (default true).

- `reply_broadcast` (boolean): Also broadcast threaded replies into the main channel stream (default false).

- `cta_label` (string (≤ 75)): Interactive Block Kit button label (must be paired with cta_url).

- `cta_url` (string (http/https)): Interactive Block Kit button link URL (must be paired with cta_label).

- `hashtags` (string[]): Up to 30 hashtags appended after the Slack message text.

- `first_comment` (string): Posted as the first thread reply under the Slack message, when the post has no first comment of its own.

- `media` (number[]): Slack-specific media library IDs overriding content[0].media.

## Workspace-level OAuth with channel discovery and Account Post Defaults

Connecting Slack at the workspace level matches how real teams operate: marketing announces launches in #announcements, product posts release summaries in #changelog and customer success shares digests in #community — all inside one workspace. PostSyncer stores one encrypted OAuth connection per Slack workspace and lets every API call pick channel_id dynamically.

If a workspace almost always posts to one primary channel, save channel_id once using PUT /api/v1/accounts/{account}/defaults. Any subsequent POST /api/v1/posts call that omits channel_id inherits your default automatically while still allowing per-post overrides whenever you target another channel.

## Handling Slack’s 3-step external file upload pipeline and thread_ts replies

Slack’s file API requires calling files.getUploadURLExternal with exact byte length and filename, streaming binary bytes to the signed upload_url, and finalizing with files.completeUploadExternal. PostSyncer handles all three stages for up to 10 images, videos or documents, then adds them to the message it posted with the text, header, button and name, so a post is one message, never a copy of the text plus the files.

Text posts reach any public channel through chat:write.public, without the app joining it. A post with files joins the public channel first with conversations.join, before anything goes out, since Slack shares files only in channels the app is in. For private channels, invite the app into the channel once in Slack: until then, a post there fails before anything goes out, with a plain message to add the app.

## Permalinks, deletes and reaction/reply analytics

Every published Slack post records both the channel_id and message timestamp (channel_id:ts) alongside the Slack permalink fetched from chat.getPermalink. That identifier lets DELETE /posts/{id} call chat.delete, and analytics read the right message.

On paid plans, one reactions.get call gives the emoji reaction totals (mapped to likes) and the thread’s reply count (mapped to comments). PostSyncer doesn’t ask for Slack’s history scopes, so it never reads a channel’s other messages.

## Publish to Slack channels from ChatGPT, Claude or Cursor via MCP

Connect your AI assistant to PostSyncer’s MCP server to list workspace channels, schedule Block Kit announcements and post threaded updates alongside all 14 networks.

Related pages: [Slack MCP](https://postsyncer.com/slack-mcp), [Slack scheduler](https://postsyncer.com/slack-scheduler), [Unified social media API](https://postsyncer.com/unified-social-media-api).

## Limits and plans

| Plan | Social accounts | Posts | API posts a day, per network |
| --- | --- | --- | --- |
| Free | 2 | 20 a month | Within the 20 |
| Starter ($29 a month) | 10 | Unlimited | Unlimited |
| Pro ($49 a month) | 30 | Unlimited | Unlimited |
| Agency ($99 a month) | 100, then $1/mo each | Unlimited | Unlimited |

Every plan: 60 requests a minute for each PostSyncer user, across all their keys, the API and the MCP server together.

## FAQ

### Does each Slack channel count as a separate account?

No. One connected Slack workspace counts as one account in PostSyncer, and each post picks its channel with channel_id: any public channel, or a private one the app was invited to.

### How do I find Slack channel IDs through the API?

Call GET /api/v1/accounts/{account}/slack/channels with an API key carrying accounts:read. It returns the public channels, and the private channels the app was invited to when the key belongs to the person who connected the workspace.

### Can I upload PDFs and videos to Slack via the API?

Yes. Pass up to 10 images, videos or documents (PDF, DOC, DOCX, PPT, PPTX) and PostSyncer uploads them into the post’s message. CSV and TXT files aren’t taken.

### Does Slack support threads and first comments?

Yes. Extra items in content[] and first_comment post as replies under the root message’s thread_ts, with optional reply_broadcast.

### Can I customize the bot name and icon per post?

Yes. Set username, icon_emoji or an https:// icon_url in accounts[].settings or save them in Account Post Defaults.

### What happens if the app is not in a public channel yet?

A text post goes out anyway, through chat:write.public. For a post with files, PostSyncer joins the public channel first with conversations.join. A private channel needs the app invited once with /invite @PostSyncer.

---

Page: https://postsyncer.com/slack-api · Updated 2026-11-27
