---
title: "Create Webhook Trigger"
method: POST
path: "/agent_api_keys/webhook-trigger"
tags: ["Agent APIKeys"]
---

# Create Webhook Trigger

`POST /agent_api_keys/webhook-trigger`

Wire a webhook trigger in one call.

Registers the source's signature-verification key (github/slack) for the agent and
returns the ready-to-paste forward webhook URL plus the signing secret (shown once).
The webhook then flows through the existing /agents/forward ingress, which verifies
the signature against this key. Bundles the existing key-create + URL composition so
a UI (or a curl) can set up a trigger without two steps.

## Request body

- CreateWebhookTriggerRequest — One-call setup for a webhook trigger: register the source's signature key and get back the ready-to-paste forward webhook URL.
  - `agent_name` string, required — The agent the webhook drives.
  - `source` 'internal' | 'external' | 'github' | 'slack'
  - `name` string, required — Signature-lookup key: the repo full_name (github) or api_app_id (slack) that the forward ingress matches the incoming webhook against.
  - `forward_path` string, required — 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` string, nullable — 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` string, nullable — Optional public agentex base URL for the returned webhook_url; defaults to the AGENTEX_PUBLIC_URL env var.

## Response `200`

Successful Response

- CreateWebhookTriggerResponse
  - `key_id` string, required — The created agent API key id.
  - `agent_name` string, required — The agent the webhook drives.
  - `source` 'internal' | 'external' | 'github' | 'slack', required
  - `name` string, required — Signature-lookup key (repo full_name / api_app_id).
  - `secret` string, required — The signing secret — shown once; paste into the source's webhook config.
  - `webhook_path` string, required — The forward path to POST webhooks to.
  - `webhook_url` string, nullable — Full webhook URL to paste into the source (None if no base URL configured).

## Other responses

- `422` — Validation Error

## Changes

> 55 revisions in range; 4 could not be searched.

- **2026-07-10** `fbecbdbd7dc5` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/scaleapi/apis/agentex-api/changes/agent_api_keys/webhook-trigger/post.md)

---

[API](https://skmtc.dev/scaleapi/apis/agentex-api.md) · [All operations](https://skmtc.dev/scaleapi/apis/agentex-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scaleapi/agentex-api/revisions/1e0aaafd5780/schema)
