{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samva-dev/json-schema/samva-dev-install-extension-payload-schema.json",
  "title": "InstallExtensionPayload",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samva-dev-extension-installations-api-openapi.yml#/components/schemas/InstallExtensionPayload",
  "type": "object",
  "properties": {
    "extension": {
      "type": "string"
    },
    "version": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{1,6}\\.\\d{1,6}\\.\\d{1,6}(?:-[0-9A-Za-z.-]{1,64})?$"
        },
        {
          "type": "null"
        }
      ]
    },
    "mailboxIds": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MailboxId"
          },
          "minItems": 1
        },
        {
          "type": "null"
        }
      ]
    },
    "namespaceId": {
      "anyOf": [
        {
          "$ref": "#/$defs/NamespaceId"
        },
        {
          "type": "null"
        }
      ]
    },
    "permissions": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "read",
              "update",
              "send",
              "quarantine.read"
            ]
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "sendMode": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "send",
            "approval"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "webhookUrl": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "extension"
  ],
  "additionalProperties": false,
  "$defs": {
    "MailboxId": {
      "type": "string",
      "pattern": "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "MailboxId"
    },
    "NamespaceId": {
      "type": "string",
      "pattern": "^ns_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "NamespaceId"
    }
  }
}