{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agonna-com/json-schema/agonna-com-federation-outbox-response-schema.json",
  "title": "FederationOutboxResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agonna-com-federation-api-openapi.yml#/components/schemas/FederationOutboxResponse",
  "properties": {
    "envelope": {
      "$ref": "#/$defs/FederationEnvelope"
    },
    "signature": {
      "$ref": "#/$defs/FederationSignature"
    },
    "cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cursor"
    }
  },
  "type": "object",
  "required": [
    "envelope",
    "signature"
  ],
  "$defs": {
    "FederatedEvent": {
      "properties": {
        "global_id": {
          "type": "string",
          "title": "Global Id"
        },
        "origin_node_id": {
          "type": "string",
          "title": "Origin Node Id"
        },
        "origin_event_id": {
          "type": "string",
          "title": "Origin Event Id"
        },
        "event_type": {
          "type": "string",
          "title": "Event Type"
        },
        "subject_type": {
          "type": "string",
          "title": "Subject Type"
        },
        "subject_id": {
          "type": "string",
          "title": "Subject Id"
        },
        "channel": {
          "type": "string",
          "title": "Channel",
          "default": "network"
        },
        "title": {
          "type": "string",
          "title": "Title",
          "default": ""
        },
        "summary": {
          "type": "string",
          "title": "Summary",
          "default": ""
        },
        "payload": {
          "additionalProperties": true,
          "type": "object",
          "title": "Payload"
        },
        "visibility": {
          "type": "string",
          "enum": [
            "network",
            "public"
          ],
          "title": "Visibility",
          "default": "network"
        },
        "priority": {
          "type": "string",
          "title": "Priority",
          "default": "normal"
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expires At"
        },
        "hop_count": {
          "type": "integer",
          "maximum": 32.0,
          "minimum": 0.0,
          "title": "Hop Count",
          "default": 0
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "global_id",
        "origin_node_id",
        "origin_event_id",
        "event_type",
        "subject_type",
        "subject_id",
        "created_at"
      ],
      "title": "FederatedEvent"
    },
    "FederationEnvelope": {
      "properties": {
        "protocol": {
          "type": "string",
          "const": "agent-network-federation/0.2",
          "title": "Protocol",
          "default": "agent-network-federation/0.2"
        },
        "envelope_id": {
          "type": "string",
          "title": "Envelope Id"
        },
        "sender_node_id": {
          "type": "string",
          "title": "Sender Node Id"
        },
        "sender_did": {
          "type": "string",
          "title": "Sender Did"
        },
        "sent_at": {
          "type": "string",
          "format": "date-time",
          "title": "Sent At"
        },
        "events": {
          "items": {
            "$ref": "#/$defs/FederatedEvent"
          },
          "type": "array",
          "maxItems": 500,
          "title": "Events"
        }
      },
      "type": "object",
      "required": [
        "sender_node_id",
        "sender_did",
        "sent_at"
      ],
      "title": "FederationEnvelope"
    },
    "FederationSignature": {
      "properties": {
        "algorithm": {
          "type": "string",
          "const": "Ed25519",
          "title": "Algorithm",
          "default": "Ed25519"
        },
        "signer_did": {
          "type": "string",
          "title": "Signer Did"
        },
        "key_id": {
          "type": "string",
          "title": "Key Id"
        },
        "value": {
          "type": "string",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "signer_did",
        "key_id",
        "value"
      ],
      "title": "FederationSignature"
    }
  }
}