{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/viralnote-app/json-schema/viralnote-app-ad-job-schema.json",
  "title": "AdJob",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/viralnote-app-openapi.json#/components/schemas/AdJob",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "video"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "scripting",
        "awaiting_script",
        "shooting",
        "composing",
        "ready",
        "failed"
      ],
      "description": "awaiting_script: started with reviewScript, the script is written and nothing is made until it is approved or cancelled."
    },
    "productId": {
      "type": "string"
    },
    "format": {
      "type": "string",
      "enum": [
        "ugc-broll",
        "lifestyle",
        "showcase",
        "ugc-avatar"
      ]
    },
    "model": {
      "type": "string",
      "enum": [
        "omni-1-2",
        "kling-3",
        "seedance-2-fast",
        "seedance-2"
      ]
    },
    "aspectRatio": {
      "type": "string",
      "enum": [
        "9:16",
        "16:9"
      ]
    },
    "variantCount": {
      "type": "integer"
    },
    "progress": {
      "type": "object",
      "properties": {
        "shotsReady": {
          "type": "integer"
        },
        "shotsTotal": {
          "type": "integer"
        },
        "voiceoversReady": {
          "type": "integer"
        },
        "variantsAssembled": {
          "type": "integer"
        }
      }
    },
    "creditsEstimated": {
      "type": "integer"
    },
    "scriptReview": {
      "type": [
        "object",
        "null"
      ],
      "description": "Set while status is awaiting_script.",
      "properties": {
        "limits": {
          "type": "object",
          "description": "Most words a rewritten line may have. A line left as drafted is always accepted.",
          "properties": {
            "avatarLineWords": {
              "type": "integer"
            },
            "voiceoverWords": {
              "type": "integer"
            }
          }
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "description": "When an unapproved script is cancelled and refunded."
        }
      }
    },
    "scriptWarnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Claims in a rewritten script that the product page doesn't support. Check them before publishing."
    },
    "variants": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "angle": {
            "type": "string"
          },
          "hookText": {
            "type": "string"
          },
          "avatarLine": {
            "type": [
              "string",
              "null"
            ],
            "description": "ugc-avatar: what the presenter says on camera."
          },
          "voiceover": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "hashtags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "adCopy": {
            "type": "object",
            "properties": {
              "primaryText": {
                "type": "string"
              },
              "headline": {
                "type": "string"
              },
              "cta": {
                "type": "string"
              }
            }
          },
          "mediaId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Finished video in the media library."
          },
          "publicUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "durationSec": {
            "type": [
              "number",
              "null"
            ]
          },
          "postId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Draft post for this variant, ready to schedule."
          }
        }
      }
    },
    "error": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "status",
    "productId",
    "variantCount"
  ]
}