{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commareports-com/json-schema/commareports-com-routine-create-request-schema.json",
  "title": "RoutineCreateRequest",
  "description": "At least one of trigger_url or skill_id is required.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commareports-com-openapi.yml#/components/schemas/RoutineCreateRequest",
  "type": "object",
  "properties": {
    "report_id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "maxLength": 200,
      "description": "Defaults to 'Untitled routine'."
    },
    "schedule_cron": {
      "type": "string",
      "description": "Valid 5-field cron expression."
    },
    "trigger_url": {
      "type": "string",
      "format": "uri",
      "maxLength": 2048,
      "description": "Webhook mode: Comma POSTs here on each tick."
    },
    "trigger_auth_header": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 1024,
      "description": "Encrypted at rest; never returned."
    },
    "payload": {
      "description": "JSON forwarded to trigger_url; max 8 KiB serialized."
    },
    "enabled": {
      "type": "boolean",
      "default": true
    },
    "skill_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "In-Comma run mode: the skill executes and appends a revision. Must be owned by you."
    },
    "connector_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Connectors the skill may read through. Each must be owned by you."
    }
  },
  "required": [
    "report_id",
    "schedule_cron"
  ]
}