---
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

---

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