{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/weftly-ai/json-schema/weftly-ai-create-job-request-schema.json",
  "title": "CreateJobRequest",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/weftly-ai-openapi.yml#/components/schemas/CreateJobRequest",
  "type": "object",
  "properties": {
    "job_type": {
      "type": "string",
      "enum": [
        "transcribe",
        "summarize",
        "find_clips",
        "extract_clip",
        "extract_vertical_clip",
        "publish_youtube",
        "clips_vertical",
        "clips_from_video",
        "clips_youtube",
        "edit_from_transcript",
        "edit_from_multiple_cameras",
        "audio_from_job"
      ],
      "description": "Type of job to run"
    },
    "filename": {
      "type": "string"
    },
    "content_type": {
      "type": "string"
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "source_job_id": {
      "type": "string",
      "format": "uuid"
    },
    "segments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExtractClipSegment"
      },
      "minItems": 1,
      "maxItems": 50
    },
    "include_transcript": {
      "type": "boolean"
    },
    "title": {
      "type": "string",
      "maxLength": 200
    },
    "start": {
      "type": "number",
      "minimum": 0
    },
    "end": {
      "type": "number",
      "minimum": 0
    },
    "profile": {
      "type": "string",
      "enum": [
        "tiktok-primary",
        "tiktok-primary-720p",
        "instagram-reels",
        "instagram-stories"
      ],
      "description": "extract_vertical_clip. Encoding profile to use. tiktok-primary (default): 1080×1920 H.264 fast preset, CRF 22, 6 Mbps cap. tiktok-primary-720p: 720×1280, CBR 3 Mbps — half-resolution mobile-optimized, ~40% faster wall time. instagram-reels: 1080×1920 H.264 slow preset, CBR 4 Mbps. instagram-stories: same encode shape as instagram-reels. All four apply loudness normalization to -14 LUFS / -1.5 dBTP. This also sets the per-clip duration cap (see VERTICAL_CLIP_MAX_SECONDS_BY_PROFILE)."
    },
    "subject": {
      "type": "string",
      "enum": [
        "center",
        "manual",
        "auto",
        "subject_id",
        "follow"
      ],
      "description": "extract_vertical_clip: reframing strategy — \"center\" (default), \"manual\", \"auto\", \"subject_id\", or \"follow\". See /.well-known/weftly-subjects-v1.schema.json."
    },
    "subject_id": {
      "type": "string",
      "maxLength": 64
    },
    "subject_box": {
      "$ref": "#/$defs/SubjectBox"
    },
    "t_ref": {
      "type": "number",
      "minimum": 0
    },
    "subject_x_offset": {
      "type": "number",
      "minimum": 0
    },
    "captions": {
      "type": "boolean",
      "description": "extract_vertical_clip. Burn word-level captions onto the clip (docs/vertical-clip-captions-plan.md). Defaults to true. Best-effort: a missing or unusable source transcript renders without captions rather than failing the job."
    },
    "edited_transcript": {
      "type": "string",
      "minLength": 1,
      "description": "edit_from_transcript. The full edited copy of the `edit` transcript format, with every [NNNN] marker kept. Max 262144 UTF-8 bytes."
    },
    "output_role": {
      "type": "string",
      "maxLength": 64,
      "description": "Required only when the parent has multiple delivered videos (a clips_horizontal/clips_vertical bundle) — names which one to extract audio from."
    },
    "artist": {
      "type": "string",
      "maxLength": 255,
      "description": "Optional ID3v2.3 artist tag for an extracted audio track."
    },
    "album": {
      "type": "string",
      "maxLength": 255,
      "description": "Optional ID3v2.3 album tag for an extracted audio track."
    },
    "date": {
      "type": "string",
      "maxLength": 32,
      "description": "Optional ID3v2.3 date tag for an extracted audio track."
    },
    "thread_id": {
      "type": "string",
      "format": "uuid",
      "description": "The chat thread this job belongs to, if created from a /chat handoff. Optional. Ownership is enforced at payment-settle time, not here — see notifyThreadPaid."
    }
  },
  "$defs": {
    "ExtractClipSegment": {
      "type": "object",
      "properties": {
        "start": {
          "type": "number",
          "minimum": 0
        },
        "end": {
          "type": "number",
          "minimum": 0
        },
        "label": {
          "type": "string",
          "maxLength": 200
        }
      },
      "required": [
        "start",
        "end"
      ]
    },
    "SubjectBox": {
      "type": "object",
      "properties": {
        "x": {
          "type": "number",
          "minimum": 0,
          "description": "Box top-left x in source pixels."
        },
        "y": {
          "type": "number",
          "minimum": 0,
          "description": "Box top-left y in source pixels."
        },
        "w": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Box width in source pixels."
        },
        "h": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Box height in source pixels."
        }
      },
      "required": [
        "x",
        "y",
        "w",
        "h"
      ]
    }
  }
}