API Reference

Drafts and Preview Links

Drafts are real social-post rows stored with status `draft`. They let you save content before publish, run review flows, and generate signed preview links that show platform-specific output before anything goes live.

Draft model

Drafts are not a separate resource type. They are created with the same endpoint as normal posts, but with status: "draft". That means the same request body, validation behavior, and future publish semantics all stay aligned.

Create a draft

curl -X POST https://api.unipost.dev/v1/social-posts \
  -H "Authorization: Bearer up_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "account_ids": ["sa_twitter_1"],
    "caption": "Work in progress",
    "status": "draft"
  }'

Publish a draft

When you are ready, promote the draft into a live publish using the publish endpoint. UniPost uses optimistic locking so concurrent draft promotions do not create duplicate platform posts.

curl -X POST https://api.unipost.dev/v1/social-posts/post_abc123/publish \
  -H "Authorization: Bearer up_live_xxxx"

Generate a preview link

Preview links are signed and time-bounded. They let a human review the resolved content before you commit to publish. This is especially useful when an LLM or automation generated the first draft.

curl -X POST https://api.unipost.dev/v1/social-posts/post_abc123/preview-link \
  -H "Authorization: Bearer up_live_xxxx"

When drafts are the right choice

Use caseWhy drafts help
Human review requiredA reviewer can inspect content before the publish step
AI-generated first draftThe model can draft, validate, and wait for approval
Internal editorial workflowsDrafts give you a save-now, publish-later state