Publish
Publish channel messages, thread replies and files to Slack, set the message identity, and edit or delete them.
A plain post becomes a message in the channel the account was connected to.
Fields in platformSpecificData on the Slack entry turn it into a thread reply, control unfurling and override the bot's identity.
Channel message
import Zernio from '@zernio/node';
const zernio = new Zernio();
const { data: published } = await zernio.posts.createPost({
body: {
content: 'Deploy finished :rocket:',
platforms: [
{ platform: 'slack', accountId: '66b2e19d8c3f5a7e9d0b1c2d' }
],
publishNow: true
}
});
console.log(published.post.platforms[0].platformPostUrl);Response (201):
{
"post": {
"_id": "65f1c0a9e2b5af0012ab34cd",
"status": "published",
"platforms": [
{
"platform": "slack",
"status": "published",
"platformPostUrl": "https://example-co.slack.com/archives/C0123456789/p1785320613863000"
}
]
}
}Every sample below changes only the mediaItems or the platforms entry of this request.
There is no channelId field on a post; passing it in platformSpecificData returns a 400. The channel is whichever one the account was connected to, so connect the channel you want and target its accountId.
Thread reply
threadTs posts the message inside an existing thread. Pass the parent message's timestamp:
{
"platform": "slack",
"accountId": "66b2e19d8c3f5a7e9d0b1c2d",
"platformSpecificData": { "threadTs": "1785320613.863000" }
}Files
Up to 10 files per post, uploaded through Slack's file API with the text as the caption:
"mediaItems": [
{ "type": "image", "url": "https://cdn.example.com/dashboard.png" },
{ "type": "image", "url": "https://cdn.example.com/error-rate.png" }
]Message identity
username and iconUrl override the bot's display name and avatar for one message.
The override is cosmetic. Slack still shows an APP badge, and the app's identity in the sidebar stays "Zernio".
Set a default identity for every post from the channel with Slack account settings. The per-post fields still win.
{
"platform": "slack",
"accountId": "66b2e19d8c3f5a7e9d0b1c2d",
"platformSpecificData": {
"unfurlLinks": false,
"username": "Status Bot",
"iconUrl": "https://example.com/status.png"
}
}Edit and delete
Edit post replaces the message text up to 4,000 characters. Media cannot be swapped.
Longer messages cannot be edited, because Slack's edit limit is stricter than its posting limit.
There is no time window unless workspace admins restrict message editing.
Unpublishing deletes the Slack message. Workspace retention or compliance settings can block the deletion; that is an admin setting, not a Zernio error.
Media posts occasionally cannot be edited or deleted, when Slack returned no message reference at publish time.