{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mammoth-io/json-schema/mammoth-io-agent-session-summary-schema.json",
  "title": "AgentSessionSummary",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mammoth-io-agents-api-openapi.yml#/components/schemas/AgentSessionSummary",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "agent_key": {
      "type": "string"
    },
    "scope_type": {
      "type": "string"
    },
    "scope_id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "title": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string"
    },
    "visibility": {
      "type": "string",
      "enum": [
        "private",
        "shared"
      ]
    },
    "owner_user_id": {
      "type": "integer"
    },
    "is_owner": {
      "type": "boolean"
    },
    "project_scope": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "project_id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": [
        "null",
        "string"
      ],
      "enum": [
        "ask",
        "build",
        null
      ]
    },
    "channel": {
      "type": [
        "null",
        "string"
      ],
      "enum": [
        "email",
        "slack",
        null
      ]
    },
    "origin": {
      "oneOf": [
        {
          "$ref": "#/$defs/AgentSessionOrigin"
        },
        {
          "type": "null"
        }
      ]
    },
    "from_chat": {
      "oneOf": [
        {
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "workflow_id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "scope": {
      "oneOf": [
        {
          "$ref": "#/$defs/AgentObjectScope"
        },
        {
          "type": "null"
        }
      ]
    },
    "object_chat": {
      "oneOf": [
        {
          "$ref": "#/$defs/AgentObjectChat"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_active_at": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "attention": {
      "type": [
        "null",
        "string"
      ],
      "enum": [
        "question",
        "approval",
        "stopped",
        "failed",
        "new_result",
        "waiting_job",
        "waiting_time",
        "paused",
        "capped",
        null
      ]
    },
    "unseen": {
      "type": "boolean",
      "default": false
    },
    "needs_you": {
      "type": "boolean",
      "default": false
    },
    "made": {
      "oneOf": [
        {
          "$ref": "#/$defs/AgentSessionMade"
        },
        {
          "type": "null"
        }
      ]
    },
    "match": {
      "oneOf": [
        {
          "$ref": "#/$defs/AgentSessionMatch"
        },
        {
          "type": "null"
        }
      ]
    },
    "pinned_at": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "title_source": {
      "type": [
        "null",
        "string"
      ],
      "enum": [
        "auto",
        "result",
        "user",
        null
      ]
    }
  },
  "type": "object",
  "required": [
    "agent_key",
    "is_owner",
    "owner_user_id",
    "scope_type",
    "session_id",
    "status",
    "visibility"
  ],
  "$defs": {
    "AgentObjectChat": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "workflow",
            "view",
            "dataset",
            "automation",
            "automations",
            "lineage"
          ]
        },
        "id": {
          "type": "integer"
        },
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "project_id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "dataset_id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "dataset_name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "id",
        "kind"
      ],
      "title": "AgentObjectChat"
    },
    "AgentObjectScope": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "workflow",
            "dataset"
          ]
        },
        "id": {
          "type": "integer"
        },
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "project_id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "id",
        "kind"
      ],
      "title": "AgentObjectScope"
    },
    "AgentSessionMade": {
      "properties": {
        "kind": {
          "type": "string"
        },
        "id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ]
        },
        "name": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "id",
        "kind",
        "name"
      ],
      "title": "AgentSessionMade"
    },
    "AgentSessionMatch": {
      "properties": {
        "field": {
          "type": "string",
          "enum": [
            "title",
            "message",
            "made"
          ]
        },
        "snippet": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "field",
        "snippet"
      ],
      "title": "AgentSessionMatch"
    },
    "AgentSessionOrigin": {
      "properties": {
        "subject": {
          "type": "string"
        },
        "sender": {
          "type": "string"
        },
        "at": {
          "type": "string"
        },
        "folder_id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "folder_name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "at",
        "sender",
        "subject"
      ],
      "title": "AgentSessionOrigin"
    }
  }
}