{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aidelly-ai/json-schema/aidelly-ai-task-envelope-schema.json",
  "title": "TaskEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aidelly-ai-tasks-api-openapi.yml#/components/schemas/TaskEnvelope",
  "allOf": [
    {
      "$ref": "#/$defs/EnvelopeBase"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "properties": {
            "task": {
              "$ref": "#/$defs/Task"
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "EnvelopeBase": {
      "type": "object",
      "required": [
        "success",
        "request_id"
      ],
      "properties": {
        "success": {
          "type": "boolean"
        },
        "request_id": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "Task": {
      "type": "object",
      "required": [
        "id",
        "title",
        "status",
        "priority",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "todo",
            "in_progress",
            "blocked",
            "done",
            "canceled"
          ]
        },
        "priority": {
          "type": "string",
          "enum": [
            "low",
            "normal",
            "high",
            "urgent"
          ]
        },
        "assignee_user_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "due_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "linked_post_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "linked_idea_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "source": {
          "type": "string",
          "enum": [
            "manual",
            "suggestion",
            "recurring"
          ]
        },
        "created_by_user_id": {
          "type": "string",
          "format": "uuid"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "completed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}