API Reference

Validate

Validate is the recommended preflight endpoint for automation and AI workflows. It accepts the same request shape as `POST /v1/social-posts`, but performs checks without creating posts, charging quota, or touching downstream platforms.

Why use Validate

Validate is what makes AI-assisted or automated publishing safe. Instead of letting a model guess whether a caption, media mix, or platform-specific option will work, you can ask UniPost before anything is written or published.

Request shape

The request body matches the publish endpoint. You can validate either the recommended platform_posts[] shape or the older caption + account_ids shape.

curl -X POST https://api.unipost.dev/v1/social-posts/validate \
  -H "Authorization: Bearer up_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "platform_posts": [
      {
        "account_id": "sa_twitter_1",
        "caption": "A platform-specific draft to validate"
      }
    ]
  }'

What it checks

CategoryExamples
Account stateUnknown account, disconnected account, account outside workspace
Content limitsCaption too long, too many media items, unsupported media mix
Platform supportFirst comment not supported, threading not supported
SchedulingScheduled time in the past or too close to now

Response shape

The response is designed to tell your client what to fix, not just that something failed. Fatal issues should block publish. Non-fatal issues can be surfaced as warnings.

FieldMeaning
okWhether the request is safe to publish as-is
errors[]Per-account or per-platform validation issues
errors[].fatalWhether the issue should block publish