> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# 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

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
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);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

published = client.posts.create_post(
    content="Deploy finished :rocket:",
    platforms=[
        {"platform": "slack", "accountId": "66b2e19d8c3f5a7e9d0b1c2d"}
    ],
    publish_now=True
)

print(published["post"]["platforms"][0]["platformPostUrl"])
```
</Tab>
<Tab value="curl">
```bash
curl -X POST https://zernio.com/api/v1/posts \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Deploy finished :rocket:",
    "platforms": [
      {"platform": "slack", "accountId": "66b2e19d8c3f5a7e9d0b1c2d"}
    ],
    "publishNow": true
  }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "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.

<Callout type="warn">
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`.
</Callout>

## Thread reply

`threadTs` posts the message inside an existing thread. Pass the parent message's timestamp:

```json
{
  "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:

```json
"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](/accounts/get-slack-settings). The per-post fields still win.

```json
{
  "platform": "slack",
  "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
  "platformSpecificData": {
    "unfurlLinks": false,
    "username": "Status Bot",
    "iconUrl": "https://example.com/status.png"
  }
}
```

## Edit and delete

[Edit post](/posts/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.