Drafts
Save posts you're not ready to publish as drafts through the DunSocial API. Drafts are per user per workspace and automatically expire after 14 days.
Drafts are per user inside a workspace. They auto-expire after about 14 days. Needs Bearer + X-Workspace-Id.
List drafts
GET /api/drafts?limit=&offset=
Create a draft
POST /api/drafts
curl -X POST https://api.dunsocial.com/api/drafts \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"content": "Rough idea for tomorrow",
"selectedPlatforms": ["x", "linkedin"],
"socialAccountIds": [],
"mediaUrls": []
}'Useful fields: content, platformContent, socialAccountIds, selectedPlatforms, name, mediaUrls, platformMedia.
For Pinterest drafts, set selectedPlatforms: ["pinterest"] and optional Pinterest options.
Returns 201.
Get, update, delete
| Method | Path | Notes |
|---|---|---|
GET |
/api/drafts/:id |
— |
PATCH |
/api/drafts/:id |
Body must include id (same as the path) plus fields to update |
DELETE |
/api/drafts/:id |
— |
Clear all drafts
DELETE /api/drafts → { deletedCount } for the current user in that workspace.
Remove a media key from drafts
POST /api/drafts/remove-media with { "storageKey": "..." } → { updatedCount }.