Zernio
APIFor you
Zernio
APIFor you
Platforms

Slack

Overview

Set up

Connect

Publish

PublishPlatform Fields & Media

Engage

Inbox

Reference

Limits & Errors
Dashboard
OverviewPlatformsAPI ReferenceResources
Slack

Connect

Connect a Slack account with the Zernio API, every step with code.


Call GET /v1/connect/slack with profileId on List Slack channels.

With no pendingDataToken or accountId, it returns the authUrl and state that start OAuth, like GET /v1/connect/{platform} does for other platforms.

Slack installs the bot into a workspace, not a channel, so the flow ends with a channel choice:

  1. Send the user to authUrl; they authorize the workspace on Slack's consent screen.
  2. Zernio lists the workspace's channels and the user picks one.
  3. POST /v1/connect/slack saves the channel as an account.

In headless mode (headless=true), the post-OAuth redirect carries a pendingDataToken and connect_token. List the channels yourself:

curl "https://zernio.com/api/v1/connect/slack?profileId=66a1f0c2a4b9d3e8f1a2b3c4&pendingDataToken=$PENDING_DATA_TOKEN" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"

Response (200):

{
  "team": { "id": "T0123456789", "name": "Example Co", "icon": "https://..." },
  "channels": [
    { "id": "C0123456789", "name": "marketing", "isPrivate": false, "isMember": true },
    { "id": "G0123456789", "name": "launch-room", "isPrivate": true, "isMember": false }
  ]
}

Channels are read live from Slack, public and private, archived excluded, up to 2,000. isMember says whether the bot is already in the channel.

Then finalize with Connect Slack channel:

curl -X POST https://zernio.com/api/v1/connect/slack \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "profileId": "66a1f0c2a4b9d3e8f1a2b3c4",
    "channelId": "C0123456789",
    "pendingDataToken": "'"$PENDING_DATA_TOKEN"'"
  }'

Response (200):

{
  "message": "Slack channel connected successfully",
  "account": {
    "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
    "platform": "slack",
    "username": "marketing",
    "displayName": "marketing",
    "isActive": true,
    "channelId": "C0123456789",
    "teamId": "T0123456789",
    "teamName": "Example Co"
  }
}

account.accountId is the id every sample below uses. The channel is now an account in that profile, so it also shows up in:

GET /v1/accounts?profileId=66a1f0c2a4b9d3e8f1a2b3c4

Another channel from the same workspace needs no second OAuth:

  1. Call GET /v1/connect/slack with profileId and accountId of an existing Slack account to list the channels.
  2. POST with accountId instead of pendingDataToken.

The connecting accounts guide covers the flow and scopes in general.

OAuth scopes

Workspaces connected before the inbox shipped must reconnect once. Existing bot tokens keep the scopes they were granted, so inbound messages fail with missing_scope until the workspace re-authorizes from the dashboard.

Was this page helpful?

Slack

Publish messages and thread replies to a Slack channel with the Zernio API, with file uploads, a per-message bot identity, and an inbox that receives DMs and mentions in realtime.

Publish

Publish channel messages, thread replies and files to Slack, set the message identity, and edit or delete them.

On this page

OAuth scopes