{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/singlestore/main/json-schema/singlestore-job-create-schema.json",
  "title": "JobCreate",
  "description": "Request body for creating a new scheduled notebook job.",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/singlestore-jobs-api-openapi.yml#/components/schemas/JobCreate",
  "type": "object",
  "required": [
    "schedule",
    "executionConfig",
    "targetConfig"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Human-readable name for the job."
    },
    "description": {
      "type": "string",
      "description": "Optional description of the job's purpose."
    },
    "schedule": {
      "$ref": "#/$defs/JobSchedule"
    },
    "executionConfig": {
      "$ref": "#/$defs/JobExecutionConfig"
    },
    "targetConfig": {
      "$ref": "#/$defs/JobTargetConfig"
    },
    "parameters": {
      "type": "array",
      "description": "Optional parameters to pass to the notebook at execution time.",
      "items": {
        "$ref": "#/$defs/JobParameter"
      }
    }
  },
  "$defs": {
    "JobExecutionConfig": {
      "type": "object",
      "description": "Configuration specifying the notebook to execute and runtime environment.",
      "required": [
        "notebookPath"
      ],
      "properties": {
        "notebookPath": {
          "type": "string",
          "description": "Path to the notebook file within SingleStore Spaces to execute."
        },
        "runtimeName": {
          "type": "string",
          "description": "Name of the runtime environment to use for notebook execution."
        },
        "createSnapshot": {
          "type": "boolean",
          "description": "When true, a snapshot of the executed notebook with outputs is saved after each execution."
        }
      }
    },
    "JobParameter": {
      "type": "object",
      "description": "A parameter passed to a notebook at job execution time.",
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Parameter name as referenced in the notebook."
        },
        "value": {
          "type": "string",
          "description": "Parameter value passed to the notebook."
        },
        "type": {
          "type": "string",
          "description": "Data type of the parameter value."
        }
      }
    },
    "JobSchedule": {
      "type": "object",
      "description": "Schedule configuration defining when and how often a job runs.",
      "properties": {
        "mode": {
          "type": "string",
          "description": "Scheduling mode controlling execution frequency. Use Once for a single immediate execution or Recurring for interval-based scheduling.",
          "enum": [
            "Once",
            "Recurring"
          ]
        },
        "startAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp for when the job should first execute."
        },
        "executionIntervalInMinutes": {
          "type": "integer",
          "description": "Number of minutes between recurring executions. Required when mode is Recurring.",
          "minimum": 1
        }
      }
    },
    "JobTargetConfig": {
      "type": "object",
      "description": "Configuration specifying the workspace and database the notebook job should connect to.",
      "required": [
        "targetID",
        "targetType"
      ],
      "properties": {
        "targetID": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier of the workspace or workspace group to target."
        },
        "targetType": {
          "type": "string",
          "description": "Type of target resource. Use Workspace to target a specific workspace.",
          "enum": [
            "Workspace"
          ]
        },
        "databaseName": {
          "type": "string",
          "description": "Name of the database within the workspace to connect to during execution."
        },
        "resumeTarget": {
          "type": "boolean",
          "description": "When true, automatically resumes a suspended workspace before executing the notebook."
        }
      }
    }
  }
}