{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/capepartners-fr/json-schema/capepartners-fr-a2-asend-message-request-schema.json",
  "title": "A2ASendMessageRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/capepartners-fr-exchange-api-openapi.yml#/components/schemas/A2ASendMessageRequest",
  "type": "object",
  "required": [
    "message"
  ],
  "properties": {
    "message": {
      "$ref": "#/$defs/A2AMessage"
    },
    "configuration": {
      "type": "object",
      "description": "A push-notification config here is refused with PushNotificationNotSupportedError (we never push)."
    },
    "metadata": {
      "type": "object"
    },
    "tenant": {
      "type": "string"
    }
  },
  "$defs": {
    "A2AMessage": {
      "type": "object",
      "required": [
        "role",
        "parts"
      ],
      "properties": {
        "messageId": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "enum": [
            "ROLE_USER",
            "ROLE_AGENT"
          ]
        },
        "parts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/A2APart"
          }
        },
        "contextId": {
          "type": "string"
        },
        "taskId": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "description": "Optional data. `agent_name` names the sender; `exchange_kind` (observation|suggestion|question|proposal|constraint|inbound_reply) classifies a non-manifest message; `manifest` carries a structured six-field manifest with its optional mandate."
        },
        "extensions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "A2APart": {
      "type": "object",
      "description": "One content part. `text` is read; a `data` part is serialised as JSON. File parts (url/raw) are ignored, never fetched.",
      "properties": {
        "text": {
          "type": "string"
        },
        "data": {},
        "url": {
          "type": "string"
        },
        "raw": {
          "type": "string",
          "contentEncoding": "base64"
        },
        "filename": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        }
      }
    }
  }
}