{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trytaskin-ai/json-schema/trytaskin-ai-task-schema.json",
  "title": "Task",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trytaskin-ai-openapi.json#/components/schemas/Task",
  "type": "object",
  "required": [
    "object",
    "reference",
    "state"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "task"
    },
    "reference": {
      "type": "string",
      "description": "Save this. Pass it to getTask to retrieve the result."
    },
    "state": {
      "type": "string",
      "enum": [
        "draft",
        "preflight_failed",
        "open",
        "matching",
        "awaiting_participant",
        "accepted",
        "in_flight",
        "submitted",
        "settled",
        "declined",
        "cancelled"
      ]
    },
    "execution_mode": {
      "type": "string",
      "enum": [
        "digital",
        "physical",
        "hybrid"
      ]
    },
    "participant_slug": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "next_step": {
      "type": "string",
      "description": "What happens next, in plain language."
    },
    "result": {
      "type": [
        "object",
        "null"
      ],
      "description": "The structured result submitted by the participant. Null until state reaches submitted."
    },
    "evidence": {
      "type": "array",
      "description": "Artifacts named in expected_result, supplied by the participant.",
      "items": {
        "type": "object"
      }
    },
    "url": {
      "type": "string",
      "format": "uri"
    }
  }
}