{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dystro-dev/json-schema/dystro-dev-create-post-body-schema.json",
  "title": "CreatePostBody",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dystro-dev-openapi.json#/components/schemas/CreatePostBody",
  "type": "object",
  "properties": {
    "projectId": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "platforms": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "idempotency_key": {
      "type": "string",
      "description": "Mandatory unless the Idempotency-Key header is sent. Replaying the same key returns the original post."
    },
    "schedule": {
      "type": "object",
      "description": "{ kind: 'one_shot', scheduledFor: epoch-ms } or recurring shapes."
    },
    "save_as_draft": {
      "type": "boolean"
    },
    "overrides": {
      "type": "object",
      "description": "Per-platform diff over the base: { <platform>: { text?, media? } }."
    },
    "platform_settings": {
      "type": "object",
      "description": "Per-platform publish settings, validated against GET /v1/platforms."
    },
    "media": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MediaItem"
      }
    }
  },
  "required": [
    "projectId",
    "text",
    "platforms"
  ],
  "$defs": {
    "MediaItem": {
      "type": "object",
      "properties": {
        "mediaId": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "image",
            "video",
            "gif"
          ]
        },
        "mimeType": {
          "type": "string"
        },
        "bytes": {
          "type": "number"
        },
        "durationMs": {
          "type": "number"
        },
        "altText": {
          "type": "string",
          "description": "Accessibility description for image/gif media."
        },
        "aspectRatio": {
          "type": "object",
          "properties": {
            "width": {
              "type": "number"
            },
            "height": {
              "type": "number"
            }
          }
        }
      },
      "required": [
        "kind",
        "mimeType",
        "bytes"
      ]
    }
  }
}