{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sprkly-app/json-schema/sprkly-app-create-post-request-schema.json",
  "title": "CreatePostRequest",
  "description": "Send platforms, profileIds, or both. profileIds alone is enough: the accounts name the platforms.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sprkly-app-openapi.yml#/components/schemas/CreatePostRequest",
  "type": "object",
  "properties": {
    "platforms": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "instagram",
          "tiktok",
          "youtube",
          "threads",
          "facebook",
          "bluesky",
          "x",
          "linkedin",
          "telegram"
        ]
      }
    },
    "profileIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Connected account IDs from GET /api/v1/connections."
    },
    "caption": {
      "type": "string"
    },
    "title": {
      "type": "string",
      "description": "Required for YouTube and TikTok."
    },
    "mediaUrls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "Publicly reachable URLs, in slide order. Usable for every platform: Instagram and Threads fetch them directly, and for TikTok, YouTube and Facebook sprkly downloads the file into its own storage during this request, so a bad link is a 422 here rather than a publish-time failure later. Google Drive and Dropbox share links are converted automatically. 50 MB per file. Use mediaIds instead when the file is already in sprkly or is going on several posts."
    },
    "mediaId": {
      "type": "string",
      "description": "A single id returned from POST /api/v1/media. Shorthand for a one-item mediaIds."
    },
    "mediaIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Ids from POST /api/v1/media, in slide order. This is the carousel and photo-set path. Array order is the published order. Instagram takes at most 20 slides; TikTok photo sets take up to 35 and every image must be the same pixel size (mismatches are padded automatically)."
    },
    "scheduledTime": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601. Omit to publish as soon as possible."
    },
    "externalId": {
      "type": "string",
      "description": "Caller-supplied idempotency key. A repeat answers 409 duplicate_external_id instead of a second post."
    },
    "requiresApproval": {
      "type": "boolean",
      "description": "Hold the post as pending_approval until the owner approves it. A plan without approvals is refused with upgrade_required."
    },
    "postType": {
      "type": "string",
      "description": "What the post is for. Optional label."
    },
    "platformMeta": {
      "type": "object",
      "additionalProperties": true
    }
  }
}