{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postproxy-dev/json-schema/postproxy-dev-post-create-request-schema.json",
  "title": "PostCreateRequest",
  "description": "Request body for creating a post. Some platforms require media (Instagram, TikTok, YouTube); some platforms require text content.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postproxy-dev-posts-api-openapi.yml#/components/schemas/PostCreateRequest",
  "type": "object",
  "required": [
    "profiles"
  ],
  "properties": {
    "post": {
      "type": "object",
      "properties": {
        "body": {
          "type": "string",
          "description": "Text content of the post"
        },
        "scheduled_at": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp to schedule the post. Do not pass together with queue_id — the queue determines the scheduled time automatically"
        },
        "draft": {
          "type": "boolean",
          "description": "If true, creates a draft that won't publish until reviewed"
        }
      }
    },
    "profiles": {
      "type": "array",
      "description": "Array of profile IDs or platform names (e.g. \"twitter\", \"instagram\" — uses the first connected profile for that platform). All resolved profiles must belong to the same profile group.",
      "items": {
        "type": "string"
      }
    },
    "media": {
      "type": "array",
      "description": "Array of media URLs, base64 data URIs, or file uploads (multipart)",
      "items": {
        "type": "string"
      }
    },
    "platforms": {
      "type": "object",
      "description": "Platform-specific parameters, keyed by platform name (e.g. instagram, youtube). See Platform Parameters docs for all available options.",
      "additionalProperties": true
    },
    "thread": {
      "type": "array",
      "description": "Array of thread child posts. Threads are only supported on X (Twitter) and Threads; other platforms return a 422.",
      "items": {
        "$ref": "#/$defs/PostThreadItemRequest"
      }
    },
    "profile_group_id": {
      "type": "string",
      "description": "ID of the profile group to resolve profiles against. If omitted, platform names resolve in the default group (first one on the account) and profile IDs are looked up across all groups your API key / user can access"
    },
    "queue_id": {
      "type": "string",
      "description": "Queue ID — adds the post to a queue. The queue must belong to the same profile group as the resolved profiles"
    },
    "queue_priority": {
      "type": "string",
      "description": "Queue priority (default: medium)",
      "enum": [
        "high",
        "medium",
        "low"
      ],
      "default": "medium"
    }
  },
  "$defs": {
    "PostThreadItemRequest": {
      "type": "object",
      "description": "A thread child post. Position is determined by array order (first item = first reply).",
      "required": [
        "body"
      ],
      "properties": {
        "body": {
          "type": "string",
          "description": "Text content for this thread post"
        },
        "media": {
          "type": "array",
          "description": "Array of media URLs (same format as top-level media)",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}