Getting Started

5-Minute Quickstart

Goal: Post your first message to a Slack channel using the SDK in your preferred language. By the end of this guide you'll have a working app, a bot token, and a successful API response.

Time to first call: ~5 minutes. This guide assumes you have a Slack workspace where you can install apps. If you don't, create one for free.


Step 1 — Create Your Slack App

  1. Go to api.slack.com/apps and click Create New App.
  2. Choose From scratch.
  3. Name your app (e.g., My First App), pick a workspace, and click Create App.

You'll land on the Basic Information page for your new app.


Step 2 — Add Bot Scopes and Install

Your app needs scopes that describe what it can do.

  1. In the left sidebar, click OAuth & Permissions.
  2. Scroll to Scopes → Bot Token Scopes and add:
    • chat:write — post messages
    • channels:read — list public channels
  3. Scroll to the top and click Install to Workspace → Allow.
  4. Copy the Bot User OAuth Token (starts with xoxb-). Keep it secret.

Treat your bot token like a password. Never commit it to git or paste it into a public channel. Load it from an environment variable.


Step 3 — Invite Your Bot to a Channel

In Slack, open the channel you want to post to (e.g., #general) and run:

/invite @My First App

Replace My First App with whatever you named the bot. Your app can only post to channels it's been invited to.


Step 4 — Install the SDK and Send Your First Message

Pick your language and copy the snippet. Set SLACK_BOT_TOKEN in your environment first:

export SLACK_BOT_TOKEN="xoxb-your-token-here"

TypeScript

npm install slack-apimatic-sdk
import { Client } from 'slack-apimatic-sdk';

const client = new Client({
  token: process.env.SLACK_BOT_TOKEN!,
});

const response = await client.chatController.postMessage({
  channel: '#general',
  text: 'Hello from my first Slack app! :wave:',
});

console.log(response.result);

What Success Looks Like

Every Slack API response includes an ok boolean. A successful post returns:

{
  "ok": true,
  "channel": "C0123456789",
  "ts": "1735689600.000100",
  "message": {
    "text": "Hello from my first Slack app! :wave:",
    "user": "U0123456789",
    "bot_id": "B0123456789",
    "type": "message"
  }
}

Check Slack — your message is in the channel.

You just made your first Slack API call. The ts value is the message timestamp — you can use it to thread replies, add reactions, or edit the message later.


Common First-Call Errors


What's Next

On this page