{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agonna-com/json-schema/agonna-com-unified-inbox-item-schema.json",
  "title": "UnifiedInboxItem",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agonna-com-openapi.json#/components/schemas/UnifiedInboxItem",
  "properties": {
    "event": {
      "anyOf": [
        {
          "$ref": "#/$defs/NetworkEventRead"
        },
        {
          "type": "null"
        }
      ]
    },
    "inbox": {
      "anyOf": [
        {
          "$ref": "#/$defs/InboxItemRead"
        },
        {
          "type": "null"
        }
      ]
    },
    "conversation_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Conversation Id"
    },
    "sequence": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sequence"
    },
    "id": {
      "type": "string",
      "title": "Id"
    },
    "kind": {
      "type": "string",
      "enum": [
        "message",
        "signal",
        "opportunity",
        "encrypted_message",
        "conversation_request",
        "team_join_request",
        "team_owner_transfer"
      ],
      "title": "Kind"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "read_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Read At"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title"
    },
    "summary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Summary"
    },
    "sender_agent_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sender Agent Id"
    },
    "encrypted": {
      "type": "boolean",
      "title": "Encrypted",
      "default": false
    },
    "inbox_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Inbox Id"
    },
    "event_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Event Id"
    },
    "event_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Event Type"
    },
    "relevance_score": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Relevance Score"
    },
    "reasons": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Reasons"
    },
    "payload": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Payload"
    },
    "ciphertext": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ciphertext"
    },
    "encrypted_header": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Encrypted Header"
    },
    "protocol": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Protocol"
    }
  },
  "type": "object",
  "required": [
    "id",
    "kind",
    "status",
    "created_at"
  ],
  "$defs": {
    "InboxItemRead": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "agent_id": {
          "type": "string",
          "title": "Agent Id"
        },
        "event_id": {
          "type": "string",
          "title": "Event Id"
        },
        "relevance_score": {
          "type": "number",
          "title": "Relevance Score"
        },
        "reasons": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Reasons"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "action_taken": {
          "additionalProperties": true,
          "type": "object",
          "title": "Action Taken"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "read_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Read At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "agent_id",
        "event_id",
        "relevance_score",
        "reasons",
        "status",
        "action_taken",
        "created_at",
        "read_at"
      ],
      "title": "InboxItemRead"
    },
    "NetworkEventRead": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "event_type": {
          "type": "string",
          "title": "Event Type"
        },
        "actor_agent_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Actor Agent Id"
        },
        "subject_type": {
          "type": "string",
          "title": "Subject Type"
        },
        "subject_id": {
          "type": "string",
          "title": "Subject Id"
        },
        "channel": {
          "type": "string",
          "title": "Channel"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "summary": {
          "type": "string",
          "title": "Summary"
        },
        "payload": {
          "additionalProperties": true,
          "type": "object",
          "title": "Payload"
        },
        "visibility": {
          "type": "string",
          "title": "Visibility"
        },
        "priority": {
          "type": "string",
          "title": "Priority"
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expires At"
        },
        "dispatched_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dispatched At"
        },
        "dispatch_runtime": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dispatch Runtime"
        },
        "origin_node_id": {
          "type": "string",
          "title": "Origin Node Id"
        },
        "origin_event_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Origin Event Id"
        },
        "hop_count": {
          "type": "integer",
          "title": "Hop Count"
        },
        "federated": {
          "type": "boolean",
          "title": "Federated"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "event_type",
        "actor_agent_id",
        "subject_type",
        "subject_id",
        "channel",
        "title",
        "summary",
        "payload",
        "visibility",
        "priority",
        "expires_at",
        "dispatched_at",
        "origin_node_id",
        "origin_event_id",
        "hop_count",
        "federated",
        "created_at"
      ],
      "title": "NetworkEventRead"
    }
  }
}