{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.netify.ai/developer/agent/v5/schemas/netify-sink-http.json",
  "title": "Netify Sink HTTP Configuration",
  "description": "JSON Schema for the Netify Sink HTTP Plugin configuration.",
  "type": "object",
  "properties": {
    "timeout_connect": {
      "type": "integer",
      "default": 30,
      "description": "Default connection timeout in seconds."
    },
    "timeout_transfer": {
      "type": "integer",
      "default": 300,
      "description": "Default transfer timeout in seconds."
    },
    "channels": {
      "type": "object",
      "description": "Channel configurations.",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "enable": {
            "type": "boolean",
            "default": true,
            "description": "State of the output channel."
          },
          "timeout_connect": {
            "type": "integer",
            "description": "Connection timeout override in seconds."
          },
          "timeout_transfer": {
            "type": "integer",
            "description": "Transfer timeout override in seconds."
          },
          "url": {
            "type": "string",
            "description": "The destination URL. Supports variables like ${uuid_agent}.",
            "pattern": "^https?://[a-zA-Z0-9\\.\\-_/\\${}]+$",
            "examples": ["https://api.example.com/v1/${uuid_agent}/telemetry"]
          },
          "headers": {
            "type": "object",
            "description": "HTTP headers to add to the request. Supports variables like ${uuid_agent}.",
            "additionalProperties": {
              "type": "string"
            },
            "examples": [
              {
                "X-UUID": "${uuid_agent}",
                "X-UUID-Serial": "${uuid_serial}"
              }
            ]
          }
        },
        "required": ["url", "headers"]
      },
      "examples": [
        {
          "flows": {
            "enable": true,
            "url": "https://sink.example.com/v1/flows",
            "headers": {
              "X-UUID": "${uuid_agent}",
              "X-UUID-Serial": "${uuid_serial}"
            }
          },
          "intel": {
            "enable": true,
            "url": "https://sink.example.com/v1/intel",
            "headers": {
              "X-UUID": "${uuid_agent}",
              "X-UUID-Serial": "${uuid_serial}"
            }
          }
        }
      ]
    }
  }
}
