{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/classquill-com/json-schema/classquill-com-blog-post-create-schema.json",
  "title": "BlogPostCreate",
  "description": "POST /v1/blog-posts → blog_posts. Creates a post on the calling key's OWN\norganisation blog — the post is scoped to the org the API key belongs to, so most\ncallers send only `title` (+ `content` and other optional fields) and nothing else.\nDefaults status='draft' (never auto-publish an unreviewed post). organization_id /\ncreated_by / timestamps are server-set, never accepted.\n\n`target` / `brand` are reserved for EquateIt-operated marketing sites and are NOT\nneeded for normal org publishing: `target='platform'` writes to a public marketing\nblog and requires the key's `allow_platform_blog` capability (not granted to ordinary\norg keys), with `brand` selecting the surface.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/classquill-com-openapi.json#/components/schemas/BlogPostCreate",
  "properties": {
    "title": {
      "type": "string",
      "maxLength": 300,
      "minLength": 1,
      "title": "Title"
    },
    "slug": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200,
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Slug",
      "description": "URL slug; slugified from the title when omitted. Unique per org."
    },
    "excerpt": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Excerpt"
    },
    "content": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200000
        },
        {
          "type": "null"
        }
      ],
      "title": "Content",
      "description": "Markdown body."
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "maxItems": 50,
      "title": "Tags"
    },
    "featured_image": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Featured Image"
    },
    "author": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "null"
        }
      ],
      "title": "Author"
    },
    "category": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "null"
        }
      ],
      "title": "Category"
    },
    "date": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Date",
      "description": "ISO date; defaults to today."
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "published"
      ],
      "title": "Status",
      "default": "draft"
    },
    "publish_to_website": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Publish To Website"
    },
    "publish_to_portal": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Publish To Portal"
    },
    "target": {
      "type": "string",
      "enum": [
        "platform",
        "org"
      ],
      "title": "Target",
      "description": "Leave as 'org' (the default) to post to your own organisation's blog. 'platform' targets an EquateIt-operated marketing site and requires the key's platform-blog capability.",
      "default": "org"
    },
    "brand": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "equateit",
            "classquill"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Brand",
      "description": "Only for platform posts — which marketing surface (equateit → equateit.com.au, classquill → classquill.com). Omit for org posts."
    },
    "scheduled_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Scheduled At",
      "description": "ISO 8601 datetime (e.g. '2026-08-01T09:00:00Z'). When set with status='draft', the post will be published automatically by a background job within 15 minutes of this time. Pass null to cancel a scheduled publish."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "title"
  ]
}