{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-create-webhook-trigger-request-schema.json",
  "title": "CreateWebhookTriggerRequest",
  "description": "One-call setup for a webhook trigger: register the source's signature key and\nget back the ready-to-paste forward webhook URL.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-agent-apikeys-api-openapi.yml#/components/schemas/CreateWebhookTriggerRequest",
  "properties": {
    "agent_name": {
      "type": "string",
      "title": "Agent Name",
      "description": "The agent the webhook drives."
    },
    "source": {
      "$ref": "#/$defs/AgentAPIKeyType",
      "description": "Webhook source whose signature is verified (github or slack).",
      "default": "github"
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Signature-lookup key: the repo full_name (github) or api_app_id (slack) that the forward ingress matches the incoming webhook against."
    },
    "forward_path": {
      "type": "string",
      "title": "Forward Path",
      "description": "Subpath the agent's own route handles, e.g. 'github-pr/<config-id>'. Appended to /agents/forward/name/{agent_name}/ to form the webhook URL."
    },
    "secret": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Secret",
      "description": "Signing secret. For GitHub, omit to generate one, or provide an existing webhook secret. For Slack, this is required and must be the Slack app's Signing Secret."
    },
    "base_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Base Url",
      "description": "Optional public agentex base URL for the returned webhook_url; defaults to the AGENTEX_PUBLIC_URL env var."
    }
  },
  "type": "object",
  "required": [
    "agent_name",
    "name",
    "forward_path"
  ],
  "$defs": {
    "AgentAPIKeyType": {
      "type": "string",
      "enum": [
        "internal",
        "external",
        "github",
        "slack"
      ],
      "title": "AgentAPIKeyType"
    }
  }
}