API errors

UniPost errors are designed to be actionable without parsing provider payloads. Preserve the structured fields, show request_id in support surfaces, and use /v1/posts as the canonical publishing route family.

Error envelope

ParameterTypeRequiredDescription
error.codestringStable API error code. Existing CLI output normalizes this value for backward compatibility.
error.normalized_codestringLowercase machine-readable alias for routing and support automation.
error.messagestringCustomer-safe summary of what failed.
error.hintstringXShort remediation guidance when UniPost can safely suggest one.
error.next_actionstringXStable action enum for client UI and automation. Present only on actionable errors.
error.is_retriablebooleanXWhether retrying the same request later is expected to help.
error.error_sourcestringXWhere the failure originated: unipost, platform, worker, or unknown.
error.error_temporalitystringXWhether the condition is temporary, permanent, or unknown.
error.provider_errorobjectXSanitized provider fields such as provider, http_status, code, subcode, type, reason, domain, quota_limit, quota_location, and is_transient.
error.retry_policyobjectXBest-effort retry snapshot. Use will_retry for automatic retry state; use is_retriable for retry eligibility.
error.docs_urlstringXRelevant documentation URL for the failed request.
error.issuesarrayXField-level validation issues. Preserve this array in clients instead of parsing message text.
request_idstringRequest identifier to include when contacting support.

Validation issues

Validation details appear in error.issues for failed create requests and in data.errors or data.warnings from POST/v1/posts/validate. Client UIs should render these fields directly instead of matching strings in error.message.

ParameterTypeRequiredDescription
platform_post_indexintegerX0-based index from platform_posts[] when the issue belongs to one destination.
account_idstringXConnected account associated with the issue.
platformstringXResolved platform, such as tiktok, instagram, youtube, or linkedin.
fieldstringXRequest field that needs a change, for example caption or platform_options.youtube.title.
codestringMachine-readable issue code, such as exceeds_max_length or missing_required_field.
messagestringCustomer-facing explanation for this one issue.
hintstringXSpecific fix guidance for this issue.
next_actionstringXAction enum for blocking validation errors.
actualanyXActual submitted value or count when useful for debugging.
limitanyXPlatform limit that was exceeded or missed.
severitystringerror for blocking issues, warning for non-blocking issues.

Publish failure fields

Failed per-account results returned by GET/v1/posts/:post_id include structured failure fields. Use error_source to distinguish UniPost, worker, and official platform failures. Use error_temporality to distinguish temporary, permanent, and unknown conditions. Use retry_policy.will_retry to know whether UniPost has actually scheduled automatic retry; is_retriable only means retrying may help. Do not parse error_message for branching.

CodeHTTPDescription
validation_error400The request or post payload is invalid. Inspect issues and fix the listed fields.
platform_request_invalid400The provider rejected platform options or metadata. Review privacy, title, disclosure, or content options.
media_error400The provider rejected media format, dimensions, duration, URL, or processing state.
temporary_platform_error503The platform or async worker path failed transiently. Check retry_policy.will_retry to know whether UniPost scheduled retry.
rate_limit429Wait before retrying. Respect Retry-After when present.
account_reconnect_required409Reconnect the affected social account before retrying.
missing_permission403Reconnect or update platform permissions and scopes.
target_not_found404The selected platform target no longer exists or is not visible to the account.
platform_error502A provider failure that UniPost cannot classify more specifically.
unknown_error500The failure is unknown. Contact support with request_id.

next_action values

ParameterTypeRequiredDescription
fix_requestvalidationXChange the request payload, then validate again.
shorten_captionvalidationXShorten the caption or title to the platform limit.
review_platform_optionspublishXCheck privacy, disclosure, content, or destination options for the platform.
fix_mediapublishXReplace or re-encode the media to meet platform requirements.
retry_laterpublishXThe platform or worker path is temporarily unavailable.
wait_and_retryrate limitXRespect Retry-After or wait before sending the same request again.
review_quotaquotaXReduce usage or upgrade capacity before retrying.
reconnect_accountauthXReconnect the affected social account.
reconnect_or_update_permissionsauthXReconnect with the required scopes or permissions.
select_valid_targetpublishXChoose a valid account, page, board, post, or other platform target.
contact_supportsupportXSend the request_id to UniPost support. Do not parse provider payloads yourself.

Route naming

The canonical public publishing routes are /v1/posts, /v1/posts/validate, and /v1/posts/:post_id. Older client references to /v1/social-posts should be migrated to /v1/posts; new docs, CLI, MCP, and SDK examples use the canonical route names.