---
title: "Create a webhook"
method: POST
path: "/webhook"
tags: ["Webhooks"]
---

# Create a webhook

`POST /webhook`

Create a new webhook with subscriptions for specific agents and events.

**400 is also returned when the endpoint URL is already registered:**
`"A webhook with this URL has already been registered"`

## Request body

- object
  - `endpoint` string, required — The webhook endpoint URL
  - `description` string, required — The description of the webhook
  - `events` object[], required — Array of events to subscribe to
    - `agentId` string, required — The ID of the agent
    - `eventType` 'pre-conversation' | 'post-conversation' | 'analytics-completed', required — The type of event to subscribe to

## Response `201`

Webhook created successfully

- object
  - `status` boolean
  - `data` string — The ID of the created webhook

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `500` — Internal server error

## Changes

- **2026-05-26** `0001c2ca9897` — 2 breaking
  - the request property `events/items/agentId` became required
  - the request property `events/items/eventType` became required
- **2026-05-11** `2790c9edc50e` — 1 info
  - added the new `analytics-completed` enum value to the request property `events/items/eventType`

[Change history](https://skmtc.dev/smallest-inc/apis/agent-management-api/changes/webhook/post.md)

---

[API](https://skmtc.dev/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.dev/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/2bfbd089ccb3/schema)
