# POST /validate_post

Source: https://heyeveryone.ai/docs/api/validate_post

> https://heyeveryone.ai/api/v1/validate_post

## Operation

```json
{
  "post": {
    "description": "Check a post against a platform's rules before scheduling it: text length (counted the platform's way, e.g. X's weighted count where links are 23 characters), thread length, media count, types, sizes, video length and aspect ratio, alt text, and required settings. Returns issues in plain words; 'error' issues block publishing, 'warning' issues don't. Pass postId for a saved post, or channelAccountId (or platform) with format, segments (text plus mediaAssetIds from the media library) and settings for a draft. A Sandbox account that emulates a platform is checked by that platform's rules and takes its prefixed formats (x__text, tiktok__video...). Reads only; nothing is saved.",
    "operationId": "validate_post",
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "workspaceId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              },
              "postId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              },
              "channelAccountId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              },
              "platform": {
                "enum": [
                  "x",
                  "linkedin",
                  "threads",
                  "bluesky",
                  "instagram",
                  "facebook",
                  "tiktok",
                  "youtube",
                  "sandbox"
                ],
                "type": "string"
              },
              "format": {
                "pattern": "^[a-z][a-z0-9_]*$",
                "type": "string"
              },
              "segments": {
                "items": {
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "media": {
                      "items": {
                        "properties": {
                          "mediaAssetId": {
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                            "type": "string"
                          },
                          "altText": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        },
                        "required": [
                          "mediaAssetId"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "text",
                    "media"
                  ],
                  "type": "object"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              "settings": {
                "additionalProperties": {},
                "default": {},
                "propertyNames": {
                  "type": "string"
                },
                "type": "object"
              }
            },
            "required": [
              "workspaceId"
            ],
            "type": "object"
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "content": {
          "application/json": {
            "schema": {
              "additionalProperties": false,
              "properties": {
                "platform": {
                  "enum": [
                    "x",
                    "linkedin",
                    "threads",
                    "bluesky",
                    "instagram",
                    "facebook",
                    "tiktok",
                    "youtube",
                    "sandbox"
                  ],
                  "type": "string"
                },
                "format": {
                  "type": "string"
                },
                "publishable": {
                  "type": "boolean"
                },
                "issues": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "severity": {
                        "enum": [
                          "error",
                          "warning"
                        ],
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "message": {
                        "type": "string"
                      },
                      "path": {
                        "items": {
                          "type": [
                            "string",
                            "number"
                          ]
                        },
                        "type": "array"
                      },
                      "limit": {
                        "type": "number"
                      },
                      "actual": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "severity",
                      "code",
                      "message",
                      "path"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "required": [
                "platform",
                "format",
                "publishable",
                "issues"
              ],
              "type": "object"
            }
          }
        },
        "description": "Success"
      },
      "400": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "invalid_input: the body does not match the schema"
      },
      "401": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "unauthenticated: missing, invalid, expired or revoked token"
      },
      "403": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "forbidden: the agent may not do this (for example, another workspace)"
      },
      "404": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "not_found"
      },
      "409": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "conflict"
      },
      "429": {
        "$ref": "#/components/responses/RateLimited"
      },
      "500": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "internal_error"
      }
    },
    "summary": "Check a post against a platform's rules",
    "tags": [
      "workspace"
    ],
    "x-heyeveryone-kind": "query"
  }
}
```

## Referenced definitions

```json
{
  "schemas": {
    "Error": {
      "properties": {
        "error": {
          "description": "A stable error code, for example forbidden.",
          "type": "string"
        },
        "message": {
          "description": "What went wrong, in plain words.",
          "type": "string"
        }
      },
      "required": [
        "error",
        "message"
      ],
      "type": "object"
    }
  },
  "responses": {
    "RateLimited": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "rate_limited: too many requests from this agent, account or address (docs/setup/agents.md, Rate limits); wait the Retry-After seconds, then retry",
      "headers": {
        "Retry-After": {
          "description": "Seconds to wait before retrying.",
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    }
  }
}
```

## Authentication

```json
{
  "bearer": {
    "description": "Personal access token (hey_pat_...)",
    "scheme": "bearer",
    "type": "http"
  },
  "oauth": {
    "flows": {
      "authorizationCode": {
        "authorizationUrl": "https://heyeveryone.ai/oauth/authorize",
        "refreshUrl": "https://heyeveryone.ai/oauth/token",
        "scopes": {
          "agent": "Act as your agent in the workspaces you choose"
        },
        "tokenUrl": "https://heyeveryone.ai/oauth/token"
      }
    },
    "type": "oauth2"
  }
}
```

## Security requirements

```json
[
  {
    "bearer": []
  },
  {
    "oauth": [
      "agent"
    ]
  }
]
```
