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:
- Send the user to
authUrl; they authorize the workspace on Slack's consent screen. - Zernio lists the workspace's channels and the user picks one.
POST /v1/connect/slacksaves 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=66a1f0c2a4b9d3e8f1a2b3c4Another channel from the same workspace needs no second OAuth:
- Call
GET /v1/connect/slackwithprofileIdandaccountIdof an existing Slack account to list the channels. POSTwithaccountIdinstead ofpendingDataToken.
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.
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.