{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendmux-ai/json-schema/sendmux-ai-provider-create-body-schema.json",
  "title": "ProviderCreateBody",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openapi-app.json#/components/schemas/ProviderCreateBody",
  "additionalProperties": false,
  "properties": {
    "from_email": {
      "description": "Default From email address for an SMTP account.",
      "format": "email",
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ]
    },
    "from_name": {
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "percentage": {
      "maximum": 100,
      "minimum": 0,
      "type": "integer"
    },
    "quotas": {
      "additionalProperties": false,
      "properties": {
        "per_day": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "$ref": "#/$defs/ProviderQuotaRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Quota value. Use a number for a fixed cap, a min/max range, or null to clear on PATCH."
        },
        "per_hour": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "$ref": "#/$defs/ProviderQuotaRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Quota value. Use a number for a fixed cap, a min/max range, or null to clear on PATCH."
        },
        "per_minute": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "$ref": "#/$defs/ProviderQuotaRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Quota value. Use a number for a fixed cap, a min/max range, or null to clear on PATCH."
        },
        "per_second": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "$ref": "#/$defs/ProviderQuotaRange"
            },
            {
              "type": "null"
            }
          ],
          "description": "Quota value. Use a number for a fixed cap, a min/max range, or null to clear on PATCH."
        }
      },
      "type": "object"
    },
    "reply_to_email": {
      "format": "email",
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ]
    },
    "reply_to_name": {
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ]
    },
    "smtp_host": {
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "smtp_password": {
      "maxLength": 500,
      "minLength": 1,
      "type": "string"
    },
    "smtp_port": {
      "maximum": 65535,
      "minimum": 1,
      "type": "integer"
    },
    "smtp_protocol": {
      "enum": [
        "tls",
        "ssl",
        "none",
        "starttls"
      ],
      "type": "string"
    },
    "smtp_username": {
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "tracking_domain": {
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ]
    },
    "variables": {
      "$ref": "#/$defs/ProviderVariables"
    }
  },
  "required": [
    "name",
    "smtp_host",
    "smtp_port",
    "smtp_protocol",
    "smtp_username",
    "smtp_password"
  ],
  "type": "object",
  "$defs": {
    "ProviderQuotaRange": {
      "additionalProperties": false,
      "properties": {
        "max": {
          "exclusiveMinimum": 0,
          "type": "integer"
        },
        "min": {
          "exclusiveMinimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "min",
        "max"
      ],
      "type": "object"
    },
    "ProviderVariables": {
      "additionalProperties": {
        "maxLength": 4096,
        "type": "string"
      },
      "description": "Per-account string variables. PATCH omission preserves the current map, a supplied map replaces it, and an empty map clears it. Detail responses return an empty map when no variables are set.",
      "maxProperties": 50,
      "propertyNames": {
        "maxLength": 64,
        "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$",
        "type": "string"
      },
      "type": "object"
    }
  }
}