{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scribetools-com/json-schema/scribetools-com-create-job-request-schema.json",
  "title": "CreateJobRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/scribetools-com-api-openapi.json#/components/schemas/CreateJobRequest",
  "properties": {
    "pipeline": {
      "anyOf": [
        {
          "$ref": "#/$defs/PipelineDefinition"
        },
        {
          "type": "null"
        }
      ],
      "description": "Pipeline definition. Defaults to OCR only."
    },
    "gcs_uris": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Gcs Uris",
      "description": "List of GCS URIs to process (files must exist)"
    },
    "file_pages": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "integer",
            "maximum": 2000.0,
            "minimum": 1.0
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "File Pages",
      "description": "Per-URI page counts used for upfront credit estimation. The worker re-counts pages and charges actual usage, so this is an authorization gate, not a billing source of truth."
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name",
      "description": "Human-readable job name. Auto-generated from filenames if omitted."
    },
    "outcome": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Outcome",
      "description": "Product outcome id chosen in the create flow (e.g. 'editable_document', 'translation'). Persisted on jobs.job_type for outcome-level analytics; inferred from the pipeline when omitted. Unknown values are ignored."
    },
    "idempotency_key": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Idempotency Key",
      "description": "Client-generated submission id. Replays with the same user/key return the original job instead of creating another."
    },
    "custom_data_beta_acknowledged": {
      "type": "boolean",
      "title": "Custom Data Beta Acknowledged",
      "description": "Explicit opt-in required only while custom-data rollout mode is beta.",
      "default": false
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "gcs_uris"
  ],
  "$defs": {
    "PipelineDefinition": {
      "properties": {
        "steps": {
          "items": {
            "$ref": "#/$defs/StepDefinition"
          },
          "type": "array",
          "minItems": 1,
          "title": "Steps"
        }
      },
      "type": "object",
      "required": [
        "steps"
      ],
      "title": "PipelineDefinition",
      "description": "Complete pipeline with dependency validation."
    },
    "StepDefinition": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Unique step name (e.g., 'extract_text')"
        },
        "provider": {
          "type": "string",
          "title": "Provider",
          "description": "Provider to execute step (e.g., 'google_docai')"
        },
        "depends_on": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Depends On",
          "description": "List of step names this depends on"
        },
        "settings": {
          "type": "object",
          "title": "Settings",
          "description": "Provider-specific settings"
        }
      },
      "type": "object",
      "required": [
        "name",
        "provider"
      ],
      "title": "StepDefinition",
      "description": "Definition of a single pipeline step."
    }
  }
}