{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-application-interaction-response-schema.json",
  "title": "ApplicationInteractionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-chatthreads-api-openapi.yml#/components/schemas/ApplicationInteractionResponse",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "input": {
      "additionalProperties": true,
      "type": "object",
      "title": "Input"
    },
    "output": {
      "additionalProperties": true,
      "type": "object",
      "title": "Output"
    },
    "aggregated": {
      "type": "boolean",
      "title": "Aggregated",
      "description": "Boolean of whether this interaction has been uploaded to s3 bucket yet, default is false",
      "can_patch": false
    },
    "application_spec_id": {
      "type": "string",
      "title": "Application Spec Id"
    },
    "application_variant_id": {
      "type": "string",
      "title": "Application Variant Id"
    },
    "start_timestamp": {
      "type": "string",
      "format": "date-time",
      "title": "Start Timestamp"
    },
    "duration_ms": {
      "type": "integer",
      "title": "Duration Ms",
      "description": "How much time the step took in milliseconds(ms)"
    },
    "operation_status": {
      "$ref": "#/$defs/ApplicationOperationStatus",
      "description": "The outcome of the operation"
    },
    "operation_metadata": {
      "title": "Operation Metadata",
      "description": "The JSON representation of the metadata insights emitted through the execution. This can differ based on different types of operations",
      "additionalProperties": true,
      "type": "object"
    },
    "models": {
      "title": "Models",
      "description": "The models used for this interaction",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "chat_thread_id": {
      "title": "Chat Thread Id",
      "can_patch": false,
      "type": "string"
    },
    "interaction_source": {
      "$ref": "#/$defs/ApplicationInteractionSource"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "The date and time when the entity was created in ISO format."
    }
  },
  "type": "object",
  "required": [
    "id",
    "input",
    "output",
    "aggregated",
    "application_spec_id",
    "application_variant_id",
    "start_timestamp",
    "duration_ms",
    "operation_status",
    "created_at"
  ],
  "$defs": {
    "ApplicationInteractionSource": {
      "type": "string",
      "enum": [
        "EXTERNAL_AI",
        "EVALUATION",
        "SGP_CHAT",
        "AGENTS_SERVICE"
      ],
      "title": "ApplicationInteractionSource"
    },
    "ApplicationOperationStatus": {
      "type": "string",
      "enum": [
        "SUCCESS",
        "ERROR",
        "CANCELED"
      ],
      "title": "ApplicationOperationStatus"
    }
  }
}