Validate post

Runs preflight checks against the same payload shape as publish. Use it before automation or AI-driven posting so content problems are caught before quota is consumed.
https://api.unipost.dev
POST/v1/posts/validate
Authorization
In header · Bearer <token>
Request Body

Authorization

AuthorizationBearer <token>In header
Workspace API key.

Request Body

platform_postsarray
Recommended unified request shape for per-account content.
scheduled_atOptionalstring
Optional scheduled publish time in ISO-8601 format.

platform_posts[]

platform_posts[].account_idstring
Connected social account to validate against.
platform_posts[].captionOptionalstring
Caption or post text to validate.
platform_posts[].media_urlsOptionalstring[]
Public asset URLs to validate for that destination.
platform_posts[].media_idsOptionalstring[]
Media library IDs to validate for that destination. Poll GET/v1/media/:media_id until uploaded before publishing.
platform_posts[].thread_positionOptionalinteger
1-indexed thread slot for X and Bluesky thread validation.
platform_posts[].first_commentOptionalstring
Optional first reply/comment validation for supported platforms.
platform_posts[].platform_optionsOptionalobject
Flat destination options for this platform post, such as { "mediaType": "story" } for Instagram. Do not nest these by platform name inside platform_posts; { "instagram": { "mediaType": "story" } } is legacy-only syntax.

Response Body

200
validboolean
Whether the payload can be published without fatal validation errors.
errorsarray
Blocking validation issues.
errors[].platform_post_indexinteger
0-based input index that produced the issue.
errors[].account_idstring
Account ID associated with the issue when known.
errors[].platformstring
Resolved platform associated with the issue when known.
errors[].fieldstring
Request field that failed validation.
errors[].codestring
Machine-readable validation code.
errors[].messagestring
Human-readable validation message.
errors[].hintOptionalstring
Specific remediation guidance when UniPost can safely suggest a fix.
errors[].next_actionOptionalstring
Stable action enum for blocking validation errors, such as shorten_caption or fix_request.
errors[].actualOptionalany
Actual submitted value or count, such as a caption length of 91.
errors[].limitOptionalany
Platform limit that was exceeded or missed, such as 90 for TikTok photo titles.
errors[].severitystring
Issue severity. Blocking items are returned as "error".
warningsarray
Non-blocking validation issues.
401
error.codestring
Usually "UNAUTHORIZED", "VALIDATION_ERROR", or "INTERNAL_ERROR".
error.normalized_codestring
Lowercase alias such as "unauthorized", "validation_error", or "internal_error".
error.messagestring
Human-readable error message.
error.hintOptionalstring
Remediation guidance for request-shape errors.
error.next_actionOptionalstring
Stable action enum. Request-shape validation errors use "fix_request".
error.is_retriableOptionalboolean
Whether the same request should be retried without changing the payload. Request-shape errors are false.
error.docs_urlOptionalstring
API reference URL for correcting the request.
error.issuesOptionalarray
Structured validation issues when create/publish preflight rejects the payload.
request_idstring
Request identifier for debugging and support.
422
error.codestring
Usually "UNAUTHORIZED", "VALIDATION_ERROR", or "INTERNAL_ERROR".
error.normalized_codestring
Lowercase alias such as "unauthorized", "validation_error", or "internal_error".
error.messagestring
Human-readable error message.
error.hintOptionalstring
Remediation guidance for request-shape errors.
error.next_actionOptionalstring
Stable action enum. Request-shape validation errors use "fix_request".
error.is_retriableOptionalboolean
Whether the same request should be retried without changing the payload. Request-shape errors are false.
error.docs_urlOptionalstring
API reference URL for correcting the request.
error.issuesOptionalarray
Structured validation issues when create/publish preflight rejects the payload.
request_idstring
Request identifier for debugging and support.
500
error.codestring
Usually "UNAUTHORIZED", "VALIDATION_ERROR", or "INTERNAL_ERROR".
error.normalized_codestring
Lowercase alias such as "unauthorized", "validation_error", or "internal_error".
error.messagestring
Human-readable error message.
error.hintOptionalstring
Remediation guidance for request-shape errors.
error.next_actionOptionalstring
Stable action enum. Request-shape validation errors use "fix_request".
error.is_retriableOptionalboolean
Whether the same request should be retried without changing the payload. Request-shape errors are false.
error.docs_urlOptionalstring
API reference URL for correcting the request.
error.issuesOptionalarray
Structured validation issues when create/publish preflight rejects the payload.
request_idstring
Request identifier for debugging and support.

Status Code Boundary

POST /v1/posts/validate separates request-shape errors from publishability checks. A request that follows the API contract returns 200; read data.valid, data.errors, and data.warnings to decide whether the content can be published.

UniPost returns 422 when the JSON request is outside the API contract, including mixed legacy and new publishing shapes. For example, platform_posts[].platform_options.instagram is invalid because the recommended platform_posts[] shape expects flat destination options.

Platform Options Shape

Use one request shape at a time. The legacy account_ids shape accepts top-level platform-scoped options such as platform_options.instagram.mediaType. The recommended platform_posts[] shape is already scoped to one destination, so each platform_posts[].platform_options object must be flat, such as {"mediaType":"story"}.

For Instagram Stories in the recommended shape, send {"mediaType":"story"} directly under platform_posts[].platform_options. Do not send {"instagram":{"mediaType":"story"}} there; that nested object is only valid in the legacy top-level platform_options shape. See Publish Instagram Stories for examples.