{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antwork-io/json-schema/antwork-io-campaign-publish-body-schema.json",
  "title": "CampaignPublishBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antwork-io-campaigns-api-openapi.yml#/components/schemas/CampaignPublishBody",
  "type": "object",
  "properties": {
    "tiktokSettings": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/TikTokSettings"
      },
      "description": "Each TikTok post's settings, keyed by post id."
    }
  },
  "$defs": {
    "TikTokAnswers": {
      "type": "object",
      "description": "The user's own choices for one TikTok post, asked from the `tiktokChoices` of a `tiktok_choices_needed` refusal. Checked against the creator's live options; never chosen for the user.",
      "required": [
        "privacyLevel",
        "allowComment",
        "commercialContent",
        "userConsented"
      ],
      "properties": {
        "privacyLevel": {
          "type": "string",
          "description": "One of `tiktokChoices.privacyLevel.options`. No default."
        },
        "allowComment": {
          "type": "boolean"
        },
        "allowDuet": {
          "type": "boolean",
          "description": "Required for a video."
        },
        "allowStitch": {
          "type": "boolean",
          "description": "Required for a video."
        },
        "commercialContent": {
          "type": "object",
          "required": [
            "enabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "yourBrand": {
              "type": "boolean",
              "description": "Labelled \"Promotional content\"."
            },
            "brandedContent": {
              "type": "boolean",
              "description": "Labelled \"Paid partnership\". Not with `SELF_ONLY`."
            }
          }
        },
        "aiGenerated": {
          "type": "boolean"
        },
        "userConsented": {
          "const": true,
          "description": "The user agreed to the declaration in `tiktokChoices.declaration`."
        }
      }
    },
    "TikTokSettings": {
      "oneOf": [
        {
          "$ref": "#/$defs/TikTokAnswers"
        },
        {
          "$ref": "#/$defs/TikTokUseLast"
        }
      ],
      "description": "The user's choices for one TikTok post: each answer, or `useLast` once they said yes to the `lastUsed` settings offered."
    },
    "TikTokUseLast": {
      "type": "object",
      "description": "The account's last answers (`tiktokChoices.lastUsed`), re-checked against the creator's live options. Send only after the user said yes to them for this post; nothing stored applies without it.",
      "required": [
        "useLast",
        "userConsented"
      ],
      "additionalProperties": false,
      "properties": {
        "useLast": {
          "const": true
        },
        "userConsented": {
          "const": true,
          "description": "The user agreed to their usual settings and the declaration for this post."
        }
      }
    }
  }
}