{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/octopost-ink/json-schema/octopost-ink-create-post-schema.json",
  "title": "CreatePost",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/octopost-ink-openapi.json#/components/schemas/CreatePost",
  "type": "object",
  "required": [
    "content",
    "platforms"
  ],
  "properties": {
    "content": {
      "type": "string",
      "minLength": 1,
      "maxLength": 5000,
      "description": "Main post text. X counts links as 23 characters."
    },
    "platforms": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/Platform"
      }
    },
    "scheduledFor": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "ISO 8601 with a timezone offset."
    },
    "published": {
      "type": "boolean",
      "default": false,
      "description": "true = publish now."
    },
    "queueStatus": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "queued",
        "pending",
        null
      ],
      "description": "queued = interval queue; pending = wait for approval."
    },
    "mediaUrls": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Media"
      },
      "maxItems": 4
    },
    "segments": {
      "type": "array",
      "maxItems": 24,
      "description": "Thread replies after the main post.",
      "items": {
        "type": "object",
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "mediaUrls": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/Media"
            }
          }
        }
      }
    },
    "poll": {
      "type": "object",
      "properties": {
        "options": {
          "type": "array",
          "minItems": 2,
          "maxItems": 4,
          "items": {
            "type": "string",
            "maxLength": 25
          }
        },
        "durationMinutes": {
          "type": "integer",
          "minimum": 5,
          "maximum": 10080
        }
      }
    }
  },
  "$defs": {
    "Media": {
      "oneOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "object",
          "properties": {
            "url": {
              "type": "string",
              "format": "uri"
            },
            "altText": {
              "type": "string",
              "maxLength": 1000
            }
          },
          "required": [
            "url"
          ]
        }
      ]
    },
    "Platform": {
      "type": "string",
      "enum": [
        "twitter",
        "threads",
        "bluesky",
        "linkedin",
        "mastodon"
      ],
      "description": "twitter is live; threads after Meta approval; bluesky, linkedin, mastodon in testing."
    }
  }
}