{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/taskhold-com/json-schema/taskhold-com-task-create-schema.json",
  "title": "TaskCreate",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/taskhold-com-openapi.yml#/components/schemas/TaskCreate",
  "type": "object",
  "required": [
    "title"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "description": "Short task title"
    },
    "description": {
      "type": "string",
      "maxLength": 10000,
      "description": "Details"
    },
    "project_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Project; omit for none"
    },
    "project": {
      "type": "string",
      "maxLength": 100,
      "description": "Project by name instead of id: matched case-insensitively, created on first use. project_id wins when both are sent"
    },
    "priority": {
      "type": "string",
      "enum": [
        "low",
        "medium",
        "high",
        "urgent"
      ],
      "default": "medium",
      "description": "Priority"
    },
    "status": {
      "type": "string",
      "enum": [
        "todo",
        "in_progress",
        "blocked",
        "done"
      ],
      "default": "todo",
      "description": "Initial status"
    },
    "labels": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "string",
        "maxLength": 50
      },
      "description": "Label names; created if missing"
    },
    "code_file_path": {
      "type": "string",
      "maxLength": 500,
      "description": "File a TODO came from"
    },
    "code_line_number": {
      "type": "integer",
      "minimum": 1,
      "description": "Line of that TODO"
    },
    "parent_task_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Create it as a step of this top-level task"
    },
    "agent_name": {
      "type": "string",
      "maxLength": 100,
      "description": "API key callers: label for the agent doing the work"
    },
    "repeat": {
      "$ref": "#/$defs/RepeatInput"
    }
  },
  "$defs": {
    "RepeatInput": {
      "description": "Text such as \"every monday at 9am\", \"weekdays at 8:30\", \"monthly on the 1st\", \"every 3 days\", \"daily at 7am America/Chicago\" (\"off\", \"pause\", \"resume\" on updates), or an object. Times are in the person's time zone unless one is given.",
      "oneOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "object",
          "required": [
            "every"
          ],
          "properties": {
            "every": {
              "type": "string",
              "enum": [
                "day",
                "weekday",
                "week",
                "month"
              ]
            },
            "on": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "sun",
                  "mon",
                  "tue",
                  "wed",
                  "thu",
                  "fri",
                  "sat"
                ]
              },
              "description": "every week: which days"
            },
            "day": {
              "type": "integer",
              "minimum": 1,
              "maximum": 31,
              "description": "every month: day of the month; the 31st runs on the last day of shorter months"
            },
            "interval": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365,
              "description": "every day: every N days"
            },
            "at": {
              "type": "string",
              "default": "09:00",
              "description": "09:00 or 5:30pm"
            },
            "timezone": {
              "type": "string",
              "description": "IANA zone; default the person's"
            }
          }
        }
      ]
    }
  }
}