Preview and validate before publishing
Resolve provider and account constraints before a draft enters review or dispatch.
POST the proposed content to /v1/social-post-previews before creation or publication. The response returns account-level render data and structured errors so a composer can show the exact target affected, the constraint violated, and the correction required.
What this means in practice
POST the proposed content to /v1/social-post-previews before creation or publication. The response returns account-level render data and structured errors so a composer can show the exact target affected, the constraint violated, and the correction required.
Use the documented brand and account boundaries consistently across the scheduler, REST API, SDK, MCP tools, SSE consumers, and webhooks. That makes the same social operation explainable to an operator and reproducible by an integration.
Implementation checklist
Preview after account selection, media processing, or any override change.
Group validation feedback by target account and provider.
Block create or publish when an error is actionable and provider-enforced.
Distinguish warnings, unsupported optional fields, and hard validation failures.
Store the approved revision and require another review when material content changes.
Example request
This example uses a server-side API key and an explicit brand selection. Replace placeholder values and keep credentials out of browser bundles, client logs, and source control.
curl --request POST \
--url 'https://postapi.app9.co/v1/social-post-previews' \
--header 'Authorization: Bearer APP9_POST_API_KEY' \
--header 'X-App9-Post-Brand: BRAND_ID' \
--header 'Content-Type: application/json' \
--data '{
"caption": "Preview this campaign before scheduling.",
"mode": "draft",
"target_account_ids": [
"acct_x",
"acct_youtube"
],
"media_ids": [
"media_demo"
]
}'Operational details
Preview does not reserve credits or publish remote content.
A preview is time-sensitive because account permissions and provider policies can change.
The server validates again at creation and dispatch to protect non-UI clients.
Common mistakes to avoid
- Do not present a generic 'invalid post' message when target-level fields are available.
- Do not treat preview output as a guarantee that a provider will accept a later request.
- Do not let an AI assistant hide validation failures from the confirming user.