{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/handover-sh/json-schema/handover-sh-create-connector-destination-schema.json",
  "title": "CreateConnectorDestination",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/handover-sh-openapi.json#/components/schemas/CreateConnectorDestination",
  "type": "object",
  "required": [
    "displayName",
    "provider",
    "config"
  ],
  "properties": {
    "displayName": {
      "type": "string",
      "maxLength": 120
    },
    "workspaceId": {
      "type": "string",
      "pattern": "^wsp_"
    },
    "provider": {
      "type": "string",
      "enum": [
        "github",
        "http"
      ]
    },
    "config": {
      "oneOf": [
        {
          "type": "object",
          "title": "GitHub destination",
          "required": [
            "owner",
            "repository"
          ],
          "properties": {
            "owner": {
              "type": "string"
            },
            "repository": {
              "type": "string"
            },
            "branch": {
              "type": "string",
              "default": "main"
            },
            "basePath": {
              "type": "string",
              "default": "handovers"
            }
          }
        },
        {
          "type": "object",
          "title": "Signed HTTP destination",
          "required": [
            "url",
            "secretEnv"
          ],
          "properties": {
            "url": {
              "type": "string",
              "format": "uri",
              "description": "HTTPS receiver endpoint."
            },
            "secretEnv": {
              "type": "string",
              "pattern": "^HANDOVER_WEBHOOK_[A-Z0-9_]+$",
              "description": "Runtime environment key containing the HMAC secret. The secret value is never stored in destination metadata."
            }
          }
        }
      ]
    }
  }
}