HTTP 422 Invalid publication. Post content, targets, destination resolution, or settings fail validation on create, update, or publish.
When it happens
Each failure is one entry in issues.
3 operations declare it: POST /api/v1/posts, POST /api/v1/posts/{postId}/publish, and PATCH /api/v1/posts/{postId}.
Response body
{
"type": "https://pubnio.com/docs/problems/invalid-publication/",
"status": 422,
"title": "Invalid publication",
"code": "invalid_publication",
"issues": [
{
"code": "caption_too_long",
"path": ["targets", 0, "text"],
"message": "This caption contains 2301 characters. The limit is 2200."
}
],
"nextAction": "Fix the reported issues and retry.",
"requestId": "0f8e4c2a-6b1d-4e3f-8a9b-7c6d5e4f3a21"
}| Field | Type | Always present |
|---|---|---|
issues |
array of PostIssue | Yes |
candidates |
array of ProblemCandidate | No |
nextAction |
string | No |
Recovery for agents
- Fix every entry in
issuesat itspath; each issue code has its own page. Whencandidatesis present, resend with oneaccountIdfrom it. - Do what
nextActionsays. - Resend with one
accountIdfromcandidatesinstead of the ambiguous selector. - Each entry in
issueshas one of 29codevalues that block publishing; the post issue codes section of the problem reference says how to fix each.
Retryable
No: the SDKs mark HTTP 422 not retryable.
Limits
- Match on
typeorcode, not ondetail.