---
search:
  tags:
    - Posts
    - POST
seo:
  description: >-
    Checks a post without making it, and changes nothing: send what create
    takes, or a… Reference for the POST /api/v1/posts/validate endpoint in the
    Peal API.
sidebar:
  label: Validate a post
  badge: POST
title: Validate a post
type: openapi-operation
---
Checks a post without making it, and changes nothing: send what `create` takes, or a draft (no `when`). It answers 200 whether or not the post would go through, with `valid` and everything that would refuse it, all at once: per channel, the text the channel receives, counted as its platform counts it against each of its limits, its hashtags, mentions, links and media, and every violation of the platform's rules (text, media formats, sizes, counts and durations, options) and of the account's own where its platform tells them; the channels and media that are not the workspace's; and, when `when` is given, whether the time can be kept (for `queue`, the slot it would take now, `queueSlot`, or why there is none, `queueNoRoom`: QueueNotFound when the queue is not the workspace's), whether the workspace's plan has room, and the channels that already have the same content from another post (`duplicates`, as DuplicatePost tells them; none with `allowDuplicate`). A post that is valid now can still be refused later: a channel disconnected, a plan's month filled meanwhile. Needs post:read and channel:read, and media:read when it shows media.

`POST /api/v1/posts/validate`

**Request body** (`application/json`, required)

- `allowDuplicate` (boolean)
- `channelIds` (string[], required)
- `channelSets` (string[])
- `content` (PostContent, required)
- `defaultSignatures` (boolean)
- `options` (ChannelOptions[])
- `shortenLinks` (boolean)
- `signatureId` (string)
- `when` (PostTiming)

Request body example:

```json
{
  "allowDuplicate": true,
  "channelIds": [
    "string"
  ],
  "channelSets": [
    "string"
  ],
  "content": {
    "followUps": [
      {
        "delaySeconds": 0,
        "media": [
          {
            "altText": "string",
            "mediaId": "string"
          }
        ],
        "overrides": [
          {
            "channelId": "string",
            "media": [
              {
                "altText": "string",
                "mediaId": "string"
              }
            ],
            "text": "string"
          }
        ],
        "text": "string"
      }
    ],
    "media": [
      {
        "altText": "string",
        "mediaId": "string"
      }
    ],
    "overrides": [
      {
        "channelId": "string",
        "media": [
          {
            "altText": "string",
            "mediaId": "string"
          }
        ],
        "text": "string"
      }
    ],
    "poll": {
      "choices": [
        "string"
      ],
      "durationMinutes": 1,
      "multipleChoice": true
    },
    "text": "string"
  },
  "defaultSignatures": true,
  "options": [
    {
      "channelId": "string",
      "options": {
        "categoryId": "string",
        "containsSyntheticMedia": true,
        "defaultLanguage": "string",
        "embeddable": true,
        "license": "youtube",
        "madeForKids": true,
        "notifySubscribers": true,
        "platform": "youtube",
        "privacy": "public",
        "publicStatsViewable": true,
        "recordingDate": "string",
        "tags": [
          "string"
        ],
        "thumbnailMediaId": "string",
        "title": "string"
      }
    }
  ],
  "shortenLinks": true,
  "signatureId": "string",
  "when": {
    "_tag": "now",
    "timeZone": "string"
  }
}
```

**Responses**

- `200` — PostValidation
- `400` — The request names no workspace, and its credential belongs to none: send the workspace's id in the \`Peal-Workspace\` header. Nothing was done.
- `401` — Sign in, or send an API key as a bearer token: the request has no valid credentials.
- `403` — The credentials are valid but do not allow this request. \`reason\` says why: the OAuth client was not given the scope the request takes (\`missingScope\`, with \`scope\` and \`permission\`: the user connects the client again and allows it), the member's role or the API key lacks a permission (\`missingPermission\`, with \`permission\`: an owner or an admin changes the role, or creates a key with it), only a person in their own session may do it (\`personRequired\`), the key or token belongs to another workspace (\`wrongWorkspace\`), the account is suspended (\`suspended\`), a browser sent the cookie from another site (\`untrustedOrigin\`), or the workspace requires two-step verification and the member's account does not have it on (\`twoStepRequired\`: they turn it on in the web app's account settings, and their sessions, applications and command line work again at once; API keys are never refused for it).
- `404` — The workspace has no channel set with this id, or of this name where a request names one. | The workspace has no signature with this id. | The workspace has no queue with this id, or of this name where a request names one; or, where a post is added to its default queue, the workspace has no default queue. | No workspace with this id is open to the caller.
- `429` — This credential sent more than \`limit\` requests in \`windowSeconds\` seconds: nothing was done. Wait \`retryAfterSeconds\` seconds, as the \`Retry-After\` header says, then send the request again. Every answer to a key or a token carries the \`RateLimit-Policy\` and \`RateLimit\` headers, which say how many requests are left. \`policy\` says which limit applied: on a server that bills, a billing account without a payment method sends fewer (\`free\`), and \`withPaymentMethod\` is what a payment method gives.

Response example, 200:

```json
{
  "awaitsApproval": true,
  "channels": [
    {
      "channelId": "string",
      "hashtags": {
        "count": -9007199254740991,
        "maximum": -9007199254740991
      },
      "links": {
        "count": -9007199254740991,
        "maximum": -9007199254740991
      },
      "media": {
        "count": -9007199254740991,
        "maximum": -9007199254740991
      },
      "mentions": {
        "count": -9007199254740991,
        "maximum": -9007199254740991
      },
      "parts": [
        {
          "hashtags": {
            "count": -9007199254740991,
            "maximum": -9007199254740991
          },
          "links": {
            "count": -9007199254740991,
            "maximum": -9007199254740991
          },
          "media": {
            "count": -9007199254740991,
            "maximum": -9007199254740991
          },
          "mentions": {
            "count": -9007199254740991,
            "maximum": -9007199254740991
          },
          "part": -9007199254740991,
          "text": "string",
          "textCounts": [
            {
              "length": -9007199254740991,
              "maximum": -9007199254740991,
              "unit": "graphemes"
            }
          ]
        }
      ],
      "platform": "x",
      "text": "string",
      "textCounts": [
        {
          "length": -9007199254740991,
          "maximum": -9007199254740991,
          "unit": "graphemes"
        }
      ],
      "textNotSent": true,
      "violations": [
        {
          "_tag": "noChannels"
        }
      ]
    }
  ],
  "duplicates": [
    {
      "channelId": "string",
      "postId": "string"
    }
  ],
  "planLimit": {
    "allowed": -9007199254740991,
    "billingUrl": "string",
    "limit": "channels",
    "plan": "free",
    "planWithRoom": "starter",
    "used": -9007199254740991
  },
  "queueNoRoom": "noSlots",
  "queueSlot": "string",
  "schedule": "ok",
  "unknownChannels": [
    "string"
  ],
  "unknownMedia": [
    "string"
  ],
  "valid": true,
  "violations": [
    {
      "_tag": "noChannels"
    }
  ],
  "warnings": [
    {
      "_tag": "channelsDropped",
      "channelIds": [
        "string"
      ],
      "channelSetId": "string",
      "channelSetName": "string"
    }
  ]
}
```
