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

# Inbox

TikTok direct messages, comments, pinned comments and webhooks.

TikTok supports DMs and comments for accounts connected through TikTok's Business app, which every new TikTok connection uses. An account still connected through TikTok's developer app gets a `400` with code `PLATFORM_LIMITATION` for both.

## Direct messages

TikTok decides which accounts can use DMs:

- The account is a TikTok Business Account. TikTok refuses personal accounts.
- The account's sign-up region is outside the EEA, Switzerland and the UK.
- The account accepts DMs, from everyone or by accepting message requests. Otherwise TikTok sends no webhook for incoming messages.

You can only reply: TikTok does not let a business start a conversation.

After the user's last message, TikTok accepts up to 10 messages within 48 hours. A send outside that window fails with TikTok's error.

| Feature | Supported |
|---------|-----------|
| List conversations | <Yes /> |
| Fetch messages | <Yes /> |
| Send text messages | <Yes /> (up to 6,000 characters) |
| Send an image | <Yes /> (one JPG or PNG, up to 3 MB) |
| Start a conversation | <No /> |

Reply with [Send message](/messages/send-inbox-message) (`POST /v1/inbox/conversations/{conversationId}/messages`). A message is text or one image, never both: a request with `message` and an attachment returns `400` with code `PLATFORM_LIMITATION`.

## Comments

Comment management does not need a Business Account.

- Read comments: `GET /v1/inbox/comments/{postId}` (TikTok video id). Each top-level comment includes up to three inline replies; pass `commentId` to page the full reply list for one comment.
- Post a comment, reply, and like, hide or unhide any comment. Delete works on your own comments and replies.
- Read image comments: `attachment` on a comment or reply with `type` `image` and `imageUrl`.
- Pin and unpin a top-level comment, as shown below.

## Pin and unpin comments

Pin a top-level comment:

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="curl">
```bash
curl -X POST https://zernio.com/api/v1/inbox/comments/{postId}/{commentId}/pin \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "66b2e19d8c3f5a7e9d0b1c2d"
  }'
```
</Tab>
<Tab value="Node.js">
```javascript
import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data } = await zernio.request({
  method: 'POST',
  path: `/v1/inbox/comments/${postId}/${commentId}/pin`,
  body: { accountId: '66b2e19d8c3f5a7e9d0b1c2d' }
});

console.log(data);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

data = client.request(
    method="POST",
    path=f"/v1/inbox/comments/{post_id}/{comment_id}/pin",
    body={"accountId": "66b2e19d8c3f5a7e9d0b1c2d"},
)

print(data)
```
</Tab>
</Tabs>

Unpin a previously pinned comment:

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="curl">
```bash
curl -X DELETE "https://zernio.com/api/v1/inbox/comments/{postId}/{commentId}/pin?accountId=66b2e19d8c3f5a7e9d0b1c2d" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```
</Tab>
<Tab value="Node.js">
```javascript
import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data } = await zernio.request({
  method: 'DELETE',
  path: `/v1/inbox/comments/${postId}/${commentId}/pin`,
  query: { accountId: '66b2e19d8c3f5a7e9d0b1c2d' }
});

console.log(data);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

data = client.request(
    method="DELETE",
    path=f"/v1/inbox/comments/{post_id}/{comment_id}/pin",
    query={"accountId": "66b2e19d8c3f5a7e9d0b1c2d"},
)

print(data)
```
</Tab>
</Tabs>

## Webhooks

TikTok supports `comment.received`, `message.received` and `message.sent` webhooks. Comment events include only the author id (no username, picture, or owner flag).