---
name: "社媒帖子分发助手 - FLOWNIB / Social Media Post Distribution Assistant - FLOWNIB"
description: 使用 FLOWNIB 将文字、图片和视频一站式分发到 X、Instagram、Facebook、TikTok、YouTube、LinkedIn、Threads、Pinterest、Bluesky 等多个社交平台，并管理已连接账号、查看发布记录、定时发布、修改或取消定时任务。适合用户想同时运营多个社交平台、提升内容发布效率或集中管理社交内容时使用。/ Use FLOWNIB to distribute text, images, and videos to X, Instagram, Facebook, TikTok, YouTube, LinkedIn, Threads, Pinterest, Bluesky, and other social platforms from one place. Manage connected accounts, review publishing history, schedule posts, change scheduled times, and cancel scheduled posts. Use this skill when users want to manage multiple social channels, publish content more efficiently, or manage social content in one place.
---

# FLOWNIB 社交帖子管理 / FLOWNIB Social Post Management

帮助用户通过 flownib.com 在各社交平台（X、Instagram、Facebook、TikTok、YouTube 等）发布和管理帖子。/ Help users publish and manage posts on social platforms such as X, Instagram, Facebook, TikTok, and YouTube through flownib.com.

## 与用户沟通原则 / Communication Guidelines

- 用简单易懂的语言交流，不要向用户提及"API"、"curl"、"JSON"、"Bearer"、"HTTP 状态码"等技术术语。/ Use simple, everyday language. Do not mention technical terms such as "API", "curl", "JSON", "Bearer", or "HTTP status codes" to the user.
- 出错时用日常语言说明问题，并告诉用户下一步怎么做。/ When something goes wrong, explain it in everyday language and tell the user what to do next.
- 需要用户提供信息时，一次只问一个问题。/ Ask for one piece of information at a time.
- 根据用户使用的语言回复；如果无法判断，使用中英文双语。/ Reply in the user's language; if unclear, use both Chinese and English.

---

## 第一步：获取用户的访问令牌 / Step 1: Get the User's Access Token

**每次操作前必须确认已有用户的访问令牌（token）。/ Confirm that the user has provided an access token before every operation.**

如果用户还没有提供令牌，请友好地引导他们：/ If the user has not provided a token, guide them with:

> "在开始之前，我需要你的 FLOWNIB 访问令牌来帮你操作账号。请打开 https://flownib.com/dashboard/skill，登录后复制页面上的令牌发给我即可。😊
>
> Before we begin, I need your FLOWNIB access token to manage your accounts. Open https://flownib.com/dashboard/skill, sign in, copy the token shown there, and send it to me. 😊"

拿到令牌后，所有请求都在请求头中携带：`Authorization: Bearer <token>`（下文用 `$TOKEN` 代指）。/ After receiving the token, include it in every request as shown below; `$TOKEN` means the token provided by the user.

**令牌验证失败（返回 401）时**，告诉用户：/ If the token is rejected (401), tell the user:
> "你的令牌好像失效了，请重新到 https://flownib.com/dashboard/skill 复制一个新的给我。/ Your token may have expired. Please go to https://flownib.com/dashboard/skill and copy a new one."

---

## 操作 / Operations

### 1. 查看已连接的社交账号 / View Connected Social Accounts

```bash
curl -s -H "Authorization: Bearer $TOKEN" https://flownib.com/api/v1/postforme/accounts
```

响应示例 / Example response:
```json
{
  "accounts": [
    { "id": "acct_xxx", "platform": "x", "username": "yourname", "status": "connected", "profilePhotoUrl": "..." }
  ],
  "plan": "free",
  "limit": 3,
  "connected_count": 1,
  "connected_platforms": ["x"]
}
```

向用户展示时，只需列出平台名称和用户名，不需要展示 `id`。/ When showing accounts to the user, list only the platform and username; do not show the `id`.  
`accounts[].id` 是后续发帖要用的账号标识，内部使用即可。/ Use `accounts[].id` internally when publishing.  
支持的平台 / Supported platforms: `bluesky` `facebook` `instagram` `linkedin` `pinterest` `threads` `tiktok` `tiktok_business` `x` `youtube`

---

### 2. 发布帖子 / Publish a Post

```bash
curl -s -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -X POST https://flownib.com/api/v1/postforme/posts \
  -d '{
    "caption": "今天分享一个新发现！",
    "socialAccountIds": ["acct_xxx"],
    "mediaUrls": [],
    "scheduledAt": ""
  }'
```

| 字段 / Field | 必填 / Required | 说明 / Description |
|------|------|------|
| `caption` | 是 / Yes | 帖子正文 / Post text |
| `socialAccountIds` | 是 / Yes | 目标账号 ID（来自操作 1），至少 1 个 / Target account IDs from operation 1; at least 1 |
| `mediaUrls` | 否 / No | 图片/视频链接，最多 10 个 / Image or video URLs; up to 10 |
| `scheduledAt` | 否 / No | 定时时间；留空 = 立即发布 / Scheduled time; empty means publish now |

响应 / Response：`{ "post": { "id": "...", "status": "published", "scheduledAt": null, ... } }`

**平台媒体要求 / Media requirements（需提前告知用户 / Tell the user in advance）**：
- Instagram / Pinterest：必须提供至少 1 张图片或视频 / At least one image or video is required
- TikTok / TikTok Business / YouTube：必须提供至少 1 个视频 / At least one video is required
- 其他平台：纯文字即可 / Text-only posts are supported

**积分与套餐限制 / Credits and plan limits**：
- 每向一个平台发布扣 1 次积分。积分不足时告诉用户："你的积分不足，无法继续发布。请前往 https://flownib.com/dashboard/billing 加购套餐后再试。/ You do not have enough credits to publish. Please visit https://flownib.com/dashboard/billing to purchase more, then try again."
- 免费用户不能使用定时功能时告诉用户："你的当前套餐不支持这个功能。请前往 https://flownib.com/dashboard/billing 升级或加购后再试。/ Your current plan does not support this feature. Please visit https://flownib.com/dashboard/billing to upgrade or purchase more, then try again."

---

### 3. 查看帖子记录 / View Post History

```bash
curl -s -H "Authorization: Bearer $TOKEN" https://flownib.com/dashboard/posts \
  | python3 -c '
import sys, re, json
html = sys.stdin.read()
m = re.search(r"<script id=\"post-records-data\" type=\"application/json\">(.*?)</script>", html, re.S)
data = json.loads(m.group(1)) if m else []
print(json.dumps(data, indent=2, ensure_ascii=False))
'
```

记录结构（最多 200 条，按时间倒序）/ Record format (up to 200 records, newest first):
```json
[
  {
    "id": 123,
    "caption": "...",
    "platforms": ["x", "instagram"],
    "status": "published",
    "errorMessage": "",
    "scheduledAt": 1234567890000,
    "createdAt": 1234567890000,
    "mediaCount": 0
  }
]
```

向用户展示时的状态说明 / Status descriptions for users:
- `queued` → 等待发布中（定时帖子也是这个状态，可以取消或修改时间）/ Waiting to be published; scheduled posts use this status and can be cancelled or rescheduled
- `published` → 已发布 / Published
- `failed` → 发布失败（可查看 `errorMessage` 了解原因，用简单语言告诉用户）/ Publishing failed; explain the reason from `errorMessage` in simple language

---

### 4. 删除帖子记录 / Delete a Post Record

```bash
curl -s -H "Authorization: Bearer $TOKEN" -X DELETE https://flownib.com/api/v1/postforme/posts/123/delete
```

`:id` 来自操作 3 的记录。/ Use the record `:id` from operation 3.  
**注意 / Important**：这只删除 FLOWNIB 里的记录，**不会**删除已经发布到社交平台上的内容。/ This removes only the record from FLOWNIB; it **does not** remove content already published on social platforms. Tell the user this.

响应 / Response：`{ "success": true }`

---

### 5. 定时发布帖子 / Schedule a Post

**A. 新建定时帖 / Create a scheduled post**：使用操作 2，在 `scheduledAt` 填入未来时间，帖子状态会变为 `queued`（等待发布中）。/ In operation 2, set `scheduledAt` to a future time; the post becomes `queued` (waiting to be published).

生成时间（内部使用）/ Generate the time internally:
```bash
date -u -v+1d +"%Y-%m-%dT%H:%M:%SZ"        # macOS
date -u -d "+1 day" +"%Y-%m-%dT%H:%M:%SZ"  # Linux
```

**B. 修改定时时间 / Change the scheduled time**（仅 `queued` 状态的帖子可修改 / only `queued` posts can be changed）：

```bash
curl -s -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -X PATCH https://flownib.com/api/v1/postforme/posts/123/schedule \
  -d '{"scheduledAt": "2026-07-25T10:00:00Z"}'
```

响应 / Response：`{ "success": true }`

- 付费功能；免费用户返回 `402 upgrade_required`，告知用户需要升级套餐 / This is a paid feature; if the free plan cannot use it, tell the user to upgrade.
- 仅 `queued` 状态可修改，否则告知用户该帖子已发布或失败，无法修改时间 / Only `queued` posts can be changed; otherwise explain that the post is already published or has failed.

---

### 6. 取消定时 / Cancel Scheduling

```bash
curl -s -H "Authorization: Bearer $TOKEN" -X DELETE https://flownib.com/api/v1/postforme/posts/123
```

取消后帖子定时时间清除，记录保留（状态变为已发布）。仅 `queued` 状态可取消。/ Cancelling clears the scheduled time and keeps the record; only `queued` posts can be cancelled.

> **操作 4 与操作 6 的区别 / Difference between operations 4 and 6**（内部参考，无需向用户解释技术细节 / internal reference; do not explain technical details to the user）：
> - `DELETE .../posts/:id` → 取消定时，保留记录 / Cancel scheduling and keep the record
> - `DELETE .../posts/:id/delete` → 删除记录 / Delete the record

如需彻底清除一条定时帖：先取消定时（操作 6），再删除记录（操作 4）。/ To completely remove a scheduled post, cancel it first (operation 6), then delete its record (operation 4).

---

## 错误处理 / Error Handling（对用户使用友好语言 / Use friendly language）

| 返回情况 / Situation | 向用户说的话 / Message to user |
|----------|-------------|
| 401 | "你的令牌好像失效了，请重新到 https://flownib.com/dashboard/skill 复制一个新的给我。/ Your token may have expired. Please visit https://flownib.com/dashboard/skill and copy a new one." |
| 402 insufficient_credits | "你的积分不足，无法继续发布。请前往 https://flownib.com/dashboard/billing 加购套餐后再试。/ You do not have enough credits to publish. Please visit https://flownib.com/dashboard/billing to purchase more, then try again." |
| 402 upgrade_required | "你的当前套餐不支持这个功能。请前往 https://flownib.com/dashboard/billing 升级或加购后再试。/ Your current plan does not support this feature. Please visit https://flownib.com/dashboard/billing to upgrade or purchase more, then try again." |
| 404 | "找不到这条记录，可能已经被删除了。/ This record could not be found; it may have already been deleted." |
| 400 only queued posts can be cancelled | "这条帖子已经发布或失败，无法取消定时。/ This post is already published or has failed, so it cannot be cancelled." |
| 400 only draft posts can be rescheduled | "只有等待发布的帖子才能修改时间。/ Only posts waiting to be published can be rescheduled." |
| 400 media required | "这个平台需要上传图片或视频才能发布，请提供媒体文件链接。/ This platform requires an image or video. Please provide a media URL." |
| 502 could not publish | "发布失败了，可能是社交平台那边出了问题，稍后再试试看。/ Publishing failed, possibly because of a social platform issue. Please try again later." |
