FabricFabricSDK
Plugins

Slack

Send messages, manage channels, and list users in Slack workspaces.

Authentication

TypeDefaultDetails
bot_tokenBot User OAuth Token (xoxb-...) passed as Authorization: Bearer
oauth_2Slack OAuth v2 flow for user tokens

Slack Bot Tokens are the common server-side path. The token is sent as a Bearer header on every request to https://slack.com/api.

Endpoints

PathRiskDescription
messages.sendwriteSend a message to a channel or DM.
messages.deletedestructiveDelete a previously sent message.
channels.listreadList channels in the workspace.
channels.createwriteCreate a new public or private channel.
channels.archivedestructiveArchive a channel (recoverable).
channels.invitewriteInvite one or more users to a channel.
users.listreadList workspace users.
users.getreadGet info about a single user.

messages.send

Send a message to a public channel, private channel, or DM.

Input:

FieldTypeRequiredDescription
channelstringChannel ID (e.g. C01...) or DM ID
textstringMessage text
thread_tsstringThread timestamp to reply in a thread

Output: { ok: boolean; channel?: string; ts?: string }

messages.delete

Delete a previously sent message.

Input:

FieldTypeRequiredDescription
channelstringChannel ID containing the message
tsstringMessage timestamp

Output: { ok: boolean }

channels.list

List channels in the workspace with pagination.

Input:

FieldTypeDescription
cursorstringPagination cursor
limitnumberMax results per page

Output: { ok: boolean; channels?: SlackChannel[]; response_metadata?: { next_cursor?: string } }

channels.create

Create a new channel.

Input:

FieldTypeRequiredDescription
namestringChannel name (no #)
is_privatebooleanCreate as private channel

Output: { ok: boolean; channel?: SlackChannel }

channels.archive

Archive a channel.

Input:

FieldTypeRequiredDescription
channelstringChannel ID

Output: { ok: boolean }

channels.invite

Invite users to a channel.

Input:

FieldTypeRequiredDescription
channelstringChannel ID
usersstringComma-separated user IDs

Output: { ok: boolean; channel?: SlackChannel }

users.list

List workspace users.

Input:

FieldTypeDescription
cursorstringPagination cursor
limitnumberMax results per page

Output: { ok: boolean; members?: SlackUser[]; response_metadata?: { next_cursor?: string } }

users.get

Get a single user's profile.

Input:

FieldTypeRequiredDescription
userstringUser ID

Output: { ok: boolean; user: SlackUser }

Usage

import { createFabric } from "@fabricorg/integrations";
import { slack } from "@fabricorg/integrations/plugins";

const fabric = createFabric({
  plugins: [
    slack({ authType: "bot_token", botToken: process.env.SLACK_BOT_TOKEN }),
  ],
});

// Send a message
await fabric.slack.api.messages.send({
  channel: "C01ABCDEF",
  text: "Hello from Fabric!",
});

// List channels
const { channels } = await fabric.slack.api.channels.list();

Webhooks

Slack webhooks are not yet implemented in this plugin. Phase 6 will add event subscription support for message, channel, and member events.

Types

interface SlackUser {
  id: string;
  name: string;
  real_name?: string;
  is_bot?: boolean;
  deleted?: boolean;
}

interface SlackChannel {
  id: string;
  name: string;
  is_private?: boolean;
  is_archived?: boolean;
}