{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/metricool/json-schema/metricool-agency-smtp-configuration-update-dto-schema.json",
  "title": "AgencySmtpConfigurationUpdateDto",
  "description": "Agency SMTP configuration to save",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/metricool-agency-customization-kit-api-service-api-openapi.yml#/components/schemas/AgencySmtpConfigurationUpdateDto",
  "required": [
    "enabled"
  ],
  "type": "object",
  "properties": {
    "enabled": {
      "type": "boolean",
      "description": "true to send with the agency SMTP (settings required), false to go back to the Metricool server keeping the stored configuration"
    },
    "settings": {
      "$ref": "#/$defs/AgencySmtpSettingsDto"
    },
    "provider": {
      "type": "string",
      "description": "Provider preset chosen in the form, for analytics only",
      "enum": [
        "GOOGLE",
        "MICROSOFT",
        "AMAZON_SES",
        "SENDGRID",
        "MAILGUN",
        "BREVO",
        "OTHER"
      ]
    }
  },
  "$defs": {
    "AgencySmtpSettingsDto": {
      "required": [
        "from",
        "host",
        "port",
        "user"
      ],
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "description": "Outgoing mail server, without protocol"
        },
        "port": {
          "type": "integer",
          "description": "Server port: 25, 465, 587, 2465, 2525 or 2587",
          "format": "int32"
        },
        "user": {
          "type": "string",
          "description": "Authentication user"
        },
        "password": {
          "type": "string",
          "description": "Password or API key in clear text. Empty keeps the stored one"
        },
        "from": {
          "type": "string",
          "description": "Sender email"
        },
        "fromLabel": {
          "type": "string",
          "description": "Sender name. When empty, the agency name is used"
        }
      },
      "description": "SMTP server values filled in the form. Authentication is always on; ports 465 and 2465 use implicit SSL and any other port mandatory STARTTLS"
    }
  }
}