{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postplanify-com/json-schema/postplanify-com-create-post-request-schema.json",
  "title": "CreatePostRequest",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/postplanify-com-api-openapi.json#/components/schemas/CreatePostRequest",
  "type": "object",
  "required": [
    "workspaceId",
    "socialAccountId",
    "scheduledAt"
  ],
  "properties": {
    "workspaceId": {
      "type": "string",
      "format": "uuid",
      "description": "The workspace this post belongs to"
    },
    "socialAccountId": {
      "type": "string",
      "format": "uuid",
      "description": "The social account to publish to"
    },
    "caption": {
      "type": "string",
      "description": "Post text/caption. Length limits vary by platform (e.g. Instagram 2200, Threads 500, Bluesky 300)."
    },
    "scheduledAt": {
      "type": "string",
      "format": "date-time",
      "description": "When to publish (UTC, must be in the future)"
    },
    "mediaIds": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Media IDs to attach, from `GET /media` (API uploads or the workspace's dashboard library) or `POST /media/upload`. Library media must belong to this post's `workspaceId`. Requirements vary by platform."
    },
    "isStory": {
      "type": "boolean",
      "default": false,
      "description": "Post as a story (Instagram and Facebook only, requires exactly 1 media file)"
    },
    "youtubeParams": {
      "$ref": "#/$defs/YouTubeParams"
    },
    "tiktokParams": {
      "$ref": "#/$defs/TikTokParams"
    },
    "pinterestParams": {
      "$ref": "#/$defs/PinterestParams"
    },
    "googleBusinessParams": {
      "$ref": "#/$defs/GoogleBusinessParams"
    },
    "xCommunityId": {
      "type": "string",
      "description": "X community ID (X posts only)"
    },
    "xTaggedUsers": {
      "type": "string",
      "description": "Comma-separated X usernames to tag in media (X posts only, max 10)"
    },
    "igTrialGraduationStrategy": {
      "type": "string",
      "enum": [
        "MANUAL",
        "SS_PERFORMANCE"
      ],
      "description": "Instagram only: post the video as a Trial Reel, shown to non-followers first. Needs exactly 1 video and not a story. `MANUAL`: you decide in the Instagram app whether to share it with your followers. `SS_PERFORMANCE`: Instagram shares it with your followers automatically if it performs well."
    },
    "shortenLinks": {
      "type": "boolean",
      "default": false,
      "description": "Shorten links in the caption, thread posts and first comment with the workspace's connected Bitly account when the post is published. Ignored if the workspace has no Bitly connected (the original links are posted). See \"Link shortening\" under Create post."
    },
    "utmCampaign": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 100,
      "description": "Value for `utm_campaign` added to links when `shortenLinks` is true. `utm_source` (the platform) and `utm_medium=social` are added automatically."
    }
  },
  "$defs": {
    "GoogleBusinessParams": {
      "type": "object",
      "description": "Google Business Profile post parameters. Only applicable to Google Business posts.\n\nThree post types are supported:\n- **STANDARD**: General update or announcement (default)\n- **EVENT**: Promote an event with dates. Requires `eventTitle`, `startDate`, and `endDate`.\n- **OFFER**: Share a deal or promotion. Requires `eventTitle`, `startDate`, and `endDate`. Automatically includes a \"View offer\" button: do not set `actionType`.\n",
      "properties": {
        "topicType": {
          "type": "string",
          "enum": [
            "STANDARD",
            "EVENT",
            "OFFER"
          ],
          "default": "STANDARD",
          "description": "Post type"
        },
        "actionType": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "BOOK",
            "ORDER",
            "SHOP",
            "LEARN_MORE",
            "SIGN_UP",
            "CALL"
          ],
          "description": "CTA button type. Not supported for OFFER posts (they get an automatic \"View offer\" button). CALL uses the business profile phone number and does not require `actionUrl`."
        },
        "actionUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "CTA button URL. Required when `actionType` is set (except CALL)."
        },
        "eventTitle": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 58,
          "description": "Event or offer title (max 58 characters). Required for EVENT and OFFER posts."
        },
        "startDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Event/offer start date (ISO 8601). Required for EVENT and OFFER posts. Must be before `endDate`."
        },
        "endDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Event/offer end date (ISO 8601). Required for EVENT and OFFER posts. Must be after `startDate`."
        },
        "couponCode": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 58,
          "description": "Coupon code for OFFER posts (max 58 characters)"
        },
        "redeemOnlineUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "Redemption URL for OFFER posts"
        },
        "termsConditions": {
          "type": [
            "string",
            "null"
          ],
          "description": "Terms and conditions for OFFER posts"
        }
      }
    },
    "PinterestParams": {
      "type": "object",
      "description": "Pinterest-specific parameters. Only applicable to Pinterest posts.",
      "required": [
        "boardId"
      ],
      "properties": {
        "title": {
          "type": "string",
          "maxLength": 100,
          "description": "Pin title"
        },
        "boardId": {
          "type": "string",
          "description": "Target board ID (required). Use `GET /social-accounts/{id}/pinterest-boards` to list available boards and their IDs."
        },
        "boardName": {
          "type": "string",
          "description": "Board name: stored for reference, auto-filled from the selected board"
        },
        "link": {
          "type": "string",
          "description": "Destination URL when the pin is clicked. Must be a valid URL (contain a dot, no spaces)."
        },
        "altText": {
          "type": "string",
          "maxLength": 500,
          "description": "Alt text for accessibility (max 500 characters)"
        }
      }
    },
    "TikTokParams": {
      "type": "object",
      "description": "TikTok-specific parameters. Only applicable to TikTok posts.",
      "properties": {
        "privacyLevel": {
          "type": "string",
          "enum": [
            "SELF_ONLY",
            "MUTUAL_FOLLOW_FRIENDS",
            "FOLLOWER_OF_CREATOR",
            "PUBLIC_TO_EVERYONE"
          ],
          "description": "Who can view the post. Defaults to `PUBLIC_TO_EVERYONE`."
        },
        "disableDuet": {
          "type": "boolean",
          "default": false,
          "description": "Prevent others from creating duets with this video"
        },
        "disableComment": {
          "type": "boolean",
          "default": false,
          "description": "Disable comments on the post"
        },
        "disableStitch": {
          "type": "boolean",
          "default": false,
          "description": "Prevent others from stitching this video"
        },
        "isDraftType": {
          "type": "boolean",
          "default": false,
          "description": "Save as draft in TikTok inbox instead of publishing directly"
        },
        "isCommercialContent": {
          "type": "boolean",
          "default": false,
          "description": "Disclose the post as commercial content"
        },
        "isYourBrand": {
          "type": "boolean",
          "default": false,
          "description": "The post promotes your own brand or business"
        },
        "isBrandedContent": {
          "type": "boolean",
          "default": false,
          "description": "The post is a paid partnership or sponsored content. Cannot be `true` when `privacyLevel` is `SELF_ONLY`."
        },
        "autoAddMusic": {
          "type": "boolean",
          "default": true,
          "description": "Automatically add music to photo posts"
        },
        "photosPostTitle": {
          "type": "string",
          "maxLength": 90,
          "description": "Title for photo/carousel posts only (max 90 characters)"
        }
      }
    },
    "YouTubeParams": {
      "type": "object",
      "description": "YouTube-specific parameters. Only applicable to YouTube posts.",
      "required": [
        "title"
      ],
      "properties": {
        "title": {
          "type": "string",
          "maxLength": 100,
          "description": "Video title (required)"
        },
        "selfDeclaredMadeForKids": {
          "type": "boolean",
          "default": false,
          "description": "Whether the video is made for kids (COPPA compliance)"
        },
        "categoryId": {
          "type": "string",
          "default": "22",
          "description": "YouTube video category ID. Defaults to \"22\" (People & Blogs). Common categories: \"1\" Film & Animation, \"2\" Autos & Vehicles, \"10\" Music, \"15\" Pets & Animals, \"17\" Sports, \"19\" Travel & Events, \"20\" Gaming, \"22\" People & Blogs, \"23\" Comedy, \"24\" Entertainment, \"25\" News & Politics, \"26\" Howto & Style, \"27\" Education, \"28\" Science & Technology.\n",
          "enum": [
            "1",
            "2",
            "10",
            "15",
            "17",
            "18",
            "19",
            "20",
            "21",
            "22",
            "23",
            "24",
            "25",
            "26",
            "27",
            "28",
            "29",
            "30",
            "31",
            "32",
            "33",
            "34",
            "35",
            "36",
            "37",
            "38",
            "39",
            "40",
            "41",
            "42",
            "43",
            "44"
          ]
        },
        "tags": {
          "type": "string",
          "maxLength": 500,
          "description": "Comma-separated tags (e.g. \"tech,tutorial,howto\")"
        }
      }
    }
  }
}