PostSyncer Social Media Assistant
Autonomously manage social media through PostSyncer using the REST API.
Setup
- 1. Create a PostSyncer account at app.postsyncer.com
- Connect social profiles (Instagram, TikTok, YouTube, X, LinkedIn, etc.)
- Go to Settings → API Integrations and create a personal access token with abilities:
workspaces, accounts, posts, and (if you use them) labels, INLINECODE4 - Add to
.env: INLINECODE6
PostSyncer MCP (optional)
PostSyncer MCP uses the same Bearer token as REST. Typical tools: list-workspaces, list-accounts, post CRUD, list-media, get-media, upload-media-from-url, delete-media, list-folders, create-folder, get-folder, update-folder, delete-folder, comments, labels, campaigns, analytics.
Multipart file upload is only via REST: POST /api/v1/media/upload/file (not exposed as an MCP tool). Use upload-media-from-url or REST URL import when the client cannot send multipart.
How to Make API Calls
All requests go to https://postsyncer.com/api/v1 with the header:
CODEBLOCK0
Use web_fetch, curl, or any HTTP tool available. Always read $POSTSYNCER_API_TOKEN from the environment.
API Reference
Discovery (Call First)
List Workspaces — INLINECODE24
CODEBLOCK1
Returns workspaces with id, name, slug, timezone.
List Accounts — INLINECODE29
CODEBLOCK2
Returns accounts with id, platform, username, workspace_id.
Media library
Requires the posts ability. Responses include id, workspace_id, folder_id, and asset metadata.
List Media — INLINECODE38
CODEBLOCK3
Query params: workspace_id, folder_id, root_only (true/false), page, per_page (max 100).
Get Media — INLINECODE44
CODEBLOCK4
Import from URLs — INLINECODE45
CODEBLOCK5
Upload file (multipart) — INLINECODE46
Use multipart/form-data with fields such as workspace_id, file (and optional chunk/chunk metadata if your client uses chunked upload). Not JSON.
Delete Media — DELETE /api/v1/media/{media_id} (confirm first)
CODEBLOCK6
Media folders
Requires the posts ability.
List Folders — INLINECODE52
CODEBLOCK7
Query params: workspace_id, parent_id, root (top-level only).
Create Folder — INLINECODE56
CODEBLOCK8
Get Folder — INLINECODE57
Update Folder — INLINECODE58
CODEBLOCK9
Delete Folder — DELETE /api/v1/folders/{id} (confirm first)
Posts
List Posts — INLINECODE60
CODEBLOCK10
Query params: page, per_page (max 100), include_comments (true/false).
Get Post — INLINECODE64
CODEBLOCK11
Create Post — INLINECODE65
CODEBLOCK12
- -
schedule_type: publish_now | schedule | INLINECODE69 - INLINECODE70 : Optional scheduling object used when
schedule_type is schedule. Provide {"date": "YYYY-MM-DD", "time": "HH:MM", "timezone": "..."} to schedule for a specific date/time, or omit/leave empty to auto-schedule to the next available time slot - INLINECODE74 : Array of thread items. Each needs
text and/or media: an array of library media IDs (integers) and/or HTTPS URL strings (import or list media first when you want stable IDs) - INLINECODE77 : Array of
{id, settings?}. Platform-specific options go in INLINECODE79
Update Post — INLINECODE80
CODEBLOCK13
Only posts that have not been published yet can be updated.
Delete Post — DELETE /api/v1/posts/{id} (confirm with user first)
CODEBLOCK14
Comments
List Comments — INLINECODE82
CODEBLOCK15
Query params: post_id (required), per_page, page, include_replies, platform.
Get Comment — INLINECODE88
CODEBLOCK16
Create Comment / Reply — INLINECODE89
CODEBLOCK17
Optional media: array of integer library IDs and/or HTTPS URLs (same shape as post content[].media; do not use a deprecated media_urls field).
Update Comment — INLINECODE93
CODEBLOCK18
Hide Comment — INLINECODE94
CODEBLOCK19
Delete Comment — DELETE /api/v1/comments/{id} (confirm first)
CODEBLOCK20
Sync Comments from Platforms — INLINECODE96
CODEBLOCK21
Labels
List Labels — INLINECODE97
CODEBLOCK22
Get Label — INLINECODE98
Create Label — INLINECODE99
CODEBLOCK23
Update Label — INLINECODE100
Delete Label — DELETE /api/v1/labels/{id} (confirm first)
Analytics
All analytics endpoints require the posts API ability.
All Workspaces — INLINECODE103
CODEBLOCK24
By Workspace — INLINECODE104
CODEBLOCK25
By Post — INLINECODE105
CODEBLOCK26
By Account — INLINECODE106
CODEBLOCK27
Sync Post Analytics — INLINECODE107
CODEBLOCK28
Queues background jobs to refresh metrics. Does not return metrics directly — call GET after sync.
Account Management
Delete Account — DELETE /api/v1/accounts/{id} (destructive, confirm first)
CODEBLOCK29
Platform-Specific Settings
Pass per-platform options in accounts[].settings when creating/updating posts:
Pinterest: INLINECODE110
X/Twitter:
CODEBLOCK30
TikTok:
CODEBLOCK31
Instagram: {"post_type": "POST"} — options: REELS, STORIES, INLINECODE114
YouTube:
CODEBLOCK32
LinkedIn: {"visibility": "PUBLIC"} — options: PUBLIC, CONNECTIONS, INLINECODE118
Bluesky: INLINECODE119
Telegram: {"disable_notification": false, "protect_content": false}
Common Workflows
Schedule a Post to Multiple Platforms
- 1.
GET /api/v1/workspaces → get INLINECODE122 - INLINECODE123 → get
ids for target platforms - Optionally
POST /api/v1/media/upload/url (or MCP upload-media-from-url) → use returned ids in INLINECODE128 - INLINECODE129 with
schedule_type: "schedule" and INLINECODE131
Reply to Comments
- 1.
GET /api/v1/posts → find post INLINECODE133 - INLINECODE134 with INLINECODE135
- INLINECODE136
- INLINECODE137 with
post_id and optional INLINECODE139
Check Performance
- 1.
GET /api/v1/analytics/posts/{id} for a specific post - If stale:
POST /api/v1/analytics/posts/{id}/sync, then re-fetch
Best Practices
- - Always start with
GET /workspaces and GET /accounts to discover IDs; use GET /folders and GET /media when organizing or attaching library assets - New automations: Use
schedule_type: "draft" or confirm before INLINECODE147 - Destructive actions: State what will happen, confirm before delete operations
- Multi-network: One post can target multiple accounts; check per-platform
status in the response - Rate limits: 60 requests/minute — don't call sync endpoints repeatedly
- Hashtags: Keep relevant and limited (3–5 per post)
Error Handling
| Status | Meaning |
|---|
| INLINECODE149 | Token missing or invalid |
| INLINECODE150 |
Token lacks required ability (e.g.
posts) |
|
404 | Resource not found or no access |
|
422 | Validation error — check required fields and formats |
|
429 | Rate limited — wait before retrying |
Links
PostSyncer 社交媒体助手
通过 REST API 使用 PostSyncer 自主管理社交媒体。
设置
- 1. 在 app.postsyncer.com 创建 PostSyncer 账户
- 关联社交媒体账号(Instagram、TikTok、YouTube、X、LinkedIn 等)
- 前往 设置 → API 集成 创建个人访问令牌,权限包括:workspaces、accounts、posts,以及(如使用)labels、campaigns
- 在 .env 中添加:POSTSYNCERAPITOKEN=yourtoken
PostSyncer MCP(可选)
PostSyncer MCP 使用与 REST 相同的 Bearer 令牌。常用工具:list-workspaces、list-accounts、帖子 CRUD、list-media、get-media、upload-media-from-url、delete-media、list-folders、create-folder、get-folder、update-folder、delete-folder、评论、标签、营销活动、分析。
多部分文件上传仅通过 REST 实现:POST /api/v1/media/upload/file(不作为 MCP 工具公开)。当客户端无法发送多部分请求时,使用 upload-media-from-url 或 REST URL 导入。
如何进行 API 调用
所有请求均发送至 https://postsyncer.com/api/v1,并包含以下标头:
Authorization: Bearer $POSTSYNCERAPITOKEN
Content-Type: application/json
使用 webfetch、curl 或任何可用的 HTTP 工具。始终从环境中读取 $POSTSYNCERAPI_TOKEN。
API 参考
发现(优先调用)
列出工作区 — GET /api/v1/workspaces
bash
curl https://postsyncer.com/api/v1/workspaces \
-H Authorization: Bearer $POSTSYNCERAPITOKEN
返回包含 id、name、slug、timezone 的工作区。
列出账号 — GET /api/v1/accounts
bash
curl https://postsyncer.com/api/v1/accounts \
-H Authorization: Bearer $POSTSYNCERAPITOKEN
返回包含 id、platform、username、workspace_id 的账号。
媒体库
需要 posts 权限。响应包含 id、workspaceid、folderid 和资产元数据。
列出媒体 — GET /api/v1/media
bash
curl -G https://postsyncer.com/api/v1/media \
--data-urlencode workspace_id=12 \
--data-urlencode page=1 \
--data-urlencode per_page=50 \
-H Authorization: Bearer $POSTSYNCERAPITOKEN
查询参数:workspaceid、folderid、rootonly(true/false)、page、perpage(最大 100)。
获取媒体 — GET /api/v1/media/{media_id}
bash
curl https://postsyncer.com/api/v1/media/999 \
-H Authorization: Bearer $POSTSYNCERAPITOKEN
从 URL 导入 — POST /api/v1/media/upload/url
bash
curl -X POST https://postsyncer.com/api/v1/media/upload/url \
-H Authorization: Bearer $POSTSYNCERAPITOKEN \
-H Content-Type: application/json \
-d {workspaceid: 12, urls: [https://example.com/photo.jpg], folderid: null}
上传文件(多部分) — POST /api/v1/media/upload/file
使用 multipart/form-data,包含 workspace_id、file 等字段(如果客户端使用分块上传,还可包含可选的 chunk/chunk 元数据)。非 JSON 格式。
删除媒体 — DELETE /api/v1/media/{media_id} (先确认)
bash
curl -X DELETE https://postsyncer.com/api/v1/media/999 \
-H Authorization: Bearer $POSTSYNCERAPITOKEN
媒体文件夹
需要 posts 权限。
列出文件夹 — GET /api/v1/folders
bash
curl -G https://postsyncer.com/api/v1/folders \
--data-urlencode workspace_id=12 \
--data-urlencode root=1 \
-H Authorization: Bearer $POSTSYNCERAPITOKEN
查询参数:workspaceid、parentid、root(仅顶层)。
创建文件夹 — POST /api/v1/folders
bash
curl -X POST https://postsyncer.com/api/v1/folders \
-H Authorization: Bearer $POSTSYNCERAPITOKEN \
-H Content-Type: application/json \
-d {workspaceid: 12, name: 营销活动素材, color: #3b82f6, parentid: null}
获取文件夹 — GET /api/v1/folders/{id}
更新文件夹 — PUT /api/v1/folders/{id}
bash
curl -X PUT https://postsyncer.com/api/v1/folders/5 \
-H Authorization: Bearer $POSTSYNCERAPITOKEN \
-H Content-Type: application/json \
-d {name: 重命名文件夹}
删除文件夹 — DELETE /api/v1/folders/{id} (先确认)
帖子
列出帖子 — GET /api/v1/posts
bash
curl https://postsyncer.com/api/v1/posts?page=1&perpage=20&includecomments=false \
-H Authorization: Bearer $POSTSYNCERAPITOKEN
查询参数:page、perpage(最大 100)、includecomments(true/false)。
获取帖子 — GET /api/v1/posts/{id}
bash
curl https://postsyncer.com/api/v1/posts/123 \
-H Authorization: Bearer $POSTSYNCERAPITOKEN
创建帖子 — POST /api/v1/posts
bash
curl -X POST https://postsyncer.com/api/v1/posts \
-H Authorization: Bearer $POSTSYNCERAPITOKEN \
-H Content-Type: application/json \
-d {
workspace_id: 12,
schedule_type: schedule,
content: [{text: 标题 #标签, media: [42, https://example.com/image.jpg]}],
accounts: [{id: 136}, {id: 95, settings: {board_id: 123}}],
schedulefor: {date: 2026-03-26, time: 14:30, timezone: America/NewYork},
labels: [5],
repeatable: false
}
- - scheduletype:publishnow | schedule | draft
- schedulefor:可选的排期对象,当 scheduletype 为 schedule 时使用。提供 {date: YYYY-MM-DD, time: HH:MM, timezone: ...} 以排期到特定日期/时间,或省略/留空以自动排期到下一个可用时间段
- content:帖子线程项数组。每项需要 text 和/或 media:一个包含媒体库 ID(整数)和/或 HTTPS URL 字符串的数组(需要稳定 ID 时,先导入或列出媒体)
- accounts:{id, settings?} 数组。平台特定选项放在 settings 中
更新帖子 — PUT /api/v1/posts/{id}
bash
curl -X PUT https://postsyncer.com/api/v1/posts/123 \
-H Authorization: Bearer $POSTSYNCERAPITOKEN \
-H Content-Type: application/json \