{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-task-schema.json",
  "title": "Task",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-tasks-api-openapi.yml#/components/schemas/Task",
  "properties": {
    "id": {
      "type": "string",
      "title": "Unique Task ID"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Unique name of the task"
    },
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/TaskStatus"
        },
        {
          "type": "null"
        }
      ],
      "title": "The current status of the task"
    },
    "status_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "The reason for the current task status"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "The timestamp when the task was created"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "The timestamp when the task was last updated"
    },
    "cleaned_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "The timestamp when the task's content was cleaned for retention compliance; null when active"
    },
    "params": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Task parameters"
    },
    "task_metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Task metadata"
    }
  },
  "type": "object",
  "required": [
    "id"
  ],
  "$defs": {
    "TaskStatus": {
      "type": "string",
      "enum": [
        "CANCELED",
        "COMPLETED",
        "FAILED",
        "RUNNING",
        "INTERRUPTED",
        "TERMINATED",
        "TIMED_OUT",
        "DELETED"
      ],
      "title": "TaskStatus"
    }
  }
}