Schedule and publish
Create scheduled posts, publish now, and post X threads.
Post routes need Bearer auth and X-Workspace-Id.
Schedule a post
POST /api/posts/schedule
curl -X POST https://api.dunsocial.com/api/posts/schedule \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"socialAccountIds": ["ACCOUNT_ID"],
"content": "Shipping something small today.",
"scheduledAt": "2026-08-01T15:00:00.000Z",
"mediaUrls": []
}'Returns 201 with one post per social account.
Publish now
POST /api/posts/publish-now
Same body as schedule, without scheduledAt. Optional naturalPosting boolean.
Threads (X only)
| Method | Path |
|---|---|
POST |
/api/posts/schedule-thread |
POST |
/api/posts/publish-thread-now |
Body shape:
{
"socialAccountId": "ACCOUNT_ID",
"scheduledAt": "2026-08-01T15:00:00.000Z",
"tweets": [
{ "content": "First tweet", "mediaUrls": [] },
{ "content": "Second tweet" }
]
}Threads need 2–25 tweets. Response includes threadHeadPost, totalTweets, and postIds.
Platform options in metadata
Pass platform-specific fields in metadata when needed:
| Platform | Field | Examples |
|---|---|---|
metadata.reddit |
subreddit, title, kind, flair |
|
metadata.instagram |
format, caption |
|
metadata.pinterest |
boardId, title, description — exactly one image |
Media on a post
mediaUrls can be media asset ids, https://media.dunsocial.com/... URLs, or storage keys like media/uploads/....
Common errors
| Status | Cause |
|---|---|
| 400 | Character limits, invalid platform options, bad media |
| 404 | Media asset missing |
| 429 | X monthly posting cap |
Check cap usage: GET /api/posts/x-cap-usage