What triggers it
- Required field missing (e.g. no
targets[], notext). - Type mismatch (e.g.
text: 42instead of a string). - Out-of-range value (e.g.
limit: -1on a list endpoint). - Bad pattern match (e.g.
mediaId: "foo"— must match^med_[0-9A-Za-z]{22}$). - Constraint violation (e.g.
scheduledAtparses but is in the past). - Batch-level rules listed below.
Batch and target rules
These rules fire onPOST /v1/posts after schema parsing but before preflight. They map directly to the validation layer in apps/api/src/routes/posts.ts.
rule | meaning | remediation |
|---|---|---|
targets.required | targets[] was empty | Send at least one target. |
targets.max | targets[] exceeded 25 entries | Split the publish into batches of at most 25 targets. |
target.account.not_connected | A target’s platform matched zero connected accounts in the org+profile scope | Connect the platform first, or pass an explicit accountId. |
target.account.ambiguous | A target’s platform matched 2+ connected accounts; we won’t guess | Pass an explicit accountId (the remediation field lists the candidate ids). |
targets.options.platform_mismatch | A target’s options.platform doesn’t match the resolved account’s platform | Drop options, or set options.platform to match. |
targets.account.platform_mismatch | A target carried both accountId and platform and they disagreed | Drop platform, or set it to match the account. |
mode_conflict | publishNow: true AND scheduledAt both set | Drop one of the two — they’re mutually exclusive. |
scheduledAt.future | scheduledAt was less than 1 second in the future | Send a timestamp at least 1 second ahead. |
scheduledAt.text_only | Scheduled post carried media or firstComment (not supported in v1) | Publish synchronously, or drop media/firstComment. |
body.json | Request body wasn’t valid JSON | Send a JSON body with Content-Type: application/json. |
Response shape
validation_failed.json
rule is the dot-joined Zod path and platformResponse carries the full Zod issues array — every issue, not just the first — so a UI can render them inline next to the right field:
zod-issues.json
Reproducing it
reproduce.sh
Remediation
Read therule field and either fix the field at that path, or follow the batch-rule table above. For pure Zod failures, rule is the path of the first issue; check platformResponse for the full list when you’re rendering form errors to a user.
Related
preflight_failed— passes schema, fails platform constraints.idempotency_conflict— same key, different body.- API reference — every endpoint’s request schema.

