{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/restivity-ai/json-schema/restivity-ai-create-task-input-schema.json",
  "title": "CreateTaskInput",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/restivity-ai-openapi.json#/components/schemas/CreateTaskInput",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "description": {
      "description": "`description` takes HTML or marked text, at most 10,000 characters. HTML is kept as the task editor writes it (`<p>`, `<strong>`, `<em>`, `<ul>`/`<ol>` with `<li>`, `<code>`, `<a href=\"https://…\">`) and sanitized by allow-list; marked text (blank-line paragraphs, `- ` and `1. ` lists, a `### ` heading opening a block, `**bold**`, `*italic*`, `` `code` ``, `[text](https://…)` links, code blocks fenced by three backticks) is rendered by the server into that HTML, so the board shows no asterisks or backticks. In one text the two do not mix: a text holding an HTML tag is stored as sent, markers included. A read returns the HTML in `description` and the same content without tags in `description_text`",
      "default": "",
      "type": "string",
      "maxLength": 10000
    },
    "status": {
      "description": "The task's lifecycle state. Not sent with `project_status_id`: the task takes that column's category. Neither sent: `todo`. Both sent: they must agree, a status of another stage than the column is refused `status_category_mismatch`",
      "$ref": "#/$defs/TaskStatus"
    },
    "priority": {
      "default": "medium",
      "$ref": "#/$defs/TaskPriority"
    },
    "project_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "due_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "is_for_today": {
      "default": false,
      "type": "boolean"
    },
    "is_important": {
      "default": false,
      "type": "boolean"
    },
    "is_urgent": {
      "default": false,
      "type": "boolean"
    },
    "estimated_pomodoros": {
      "default": 0,
      "type": "integer",
      "minimum": 0,
      "maximum": 100000
    },
    "is_recurring": {
      "default": false,
      "type": "boolean"
    },
    "recurrence_model": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "materialized",
            "reminder_only"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "recurring_frequency": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "daily",
            "weekly",
            "monthly",
            "yearly"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "recurring_end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "recurring_days": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "recurrence_start_date": {
      "description": "When the series starts (the first occurrence is on or after this day). Defaults to today. For a `reminder_only` master the server sets `due_date` to the first occurrence and owns it from then on (a client `due_date` is ignored); for a `materialized` master `due_date` stays null and every child occurrence carries its own.",
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "assigned_to": {
      "description": "Without `assigned_to` the task is assigned to the person the agent acts for; `assigned_to: null` leaves it unassigned; an id assigns that person when they may be (the creator, or a member of the task’s project; anyone else is refused).",
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "project_status_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "tag_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
      }
    },
    "subtasks": {
      "maxItems": 200,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Existing subtask id → that row is updated in place; omitted → the subtask is created. On `PATCH /tasks/{id}`, subtasks present in the database but absent from this array are deleted, and an empty array clears all. On `POST /tasks` every subtask is created (id is ignored).",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "completed": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "title"
        ]
      }
    }
  },
  "required": [
    "title"
  ],
  "$defs": {
    "TaskPriority": {
      "type": "string",
      "enum": [
        "low",
        "medium",
        "high",
        "urgent"
      ]
    },
    "TaskStatus": {
      "description": "Lifecycle state of a task.",
      "type": "string",
      "enum": [
        "todo",
        "in_progress",
        "completed",
        "archived"
      ]
    }
  }
}