{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emailconnect/main/json-schema/emailconnect-create-domain-payload-schema.json",
  "title": "CreateDomainPayload",
  "x-generated": "2026-10-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emailconnect-openapi.json#/components/schemas/CreateDomainPayload",
  "type": "object",
  "properties": {
    "domain": {
      "type": "string",
      "description": "Domain name to add"
    },
    "webhookId": {
      "type": "string",
      "description": "ID of existing webhook to use"
    },
    "webhookUrl": {
      "type": "string",
      "format": "uri",
      "description": "URL for new webhook (alternative to webhookId)"
    },
    "webhookName": {
      "type": "string",
      "description": "Name for new webhook (used with webhookUrl)"
    },
    "webhookDescription": {
      "type": "string",
      "description": "Description for new webhook"
    },
    "createCatchAll": {
      "type": "boolean",
      "default": true,
      "description": "Whether to create a catch-all alias (*@domain.com)"
    },
    "active": {
      "type": "boolean",
      "default": true,
      "description": "Whether domain should be active"
    }
  },
  "required": [
    "domain"
  ],
  "oneOf": [
    {
      "required": [
        "domain",
        "webhookId"
      ]
    },
    {
      "required": [
        "domain",
        "webhookUrl",
        "webhookName"
      ]
    }
  ]
}