---
title: "Invalid publication (invalid-publication)"
description: "PubNio invalid-publication problem, HTTP 422: Post content, targets, destination resolution, or settings fail validation on create, update, or publish."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Invalid publication (invalid-publication)

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`](https://pubnio.com/api/v1/docs#tag/posts/POST/api/v1/posts), [`POST /api/v1/posts/{postId}/publish`](https://pubnio.com/api/v1/docs#tag/posts/POST/api/v1/posts/{postId}/publish), and [`PATCH /api/v1/posts/{postId}`](https://pubnio.com/api/v1/docs#tag/posts/PATCH/api/v1/posts/{postId}).

## Response body

```json
{
  "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 `issues` at its `path`; each issue code has its own page. When `candidates` is present, resend with one `accountId` from it.
- Do what `nextAction` says.
- Resend with one `accountId` from `candidates` instead of the ambiguous selector.
- Each entry in `issues` has one of 29 `code` values 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 `type` or `code`, not on `detail`.

## Related

- [Publishing problems](https://pubnio.com/docs/problems/#publishing)
- [Post issue codes](https://pubnio.com/docs/problems/#post-issue-codes)
- [API reference](https://pubnio.com/docs/api/)

Source: https://pubnio.com/docs/problems/invalid-publication/index.mdx
