---
title: Create Webhook Slot
description: "Create a new inbound webhook slot with an auto-generated secret for authenticating incoming payloads. Webhooks forward external data to the Mudabbir agent for processing."
api: POST /api/webhooks/add
baseUrl: http://localhost:8888
layout: '@/layouts/APIEndpointLayout.astro'
auth: bearer
section: API Reference
ogType: article
keywords: ["create webhook", "webhook secret", "inbound webhook"]
tags: ["api", "webhooks"]
---

## Overview

Creates a new inbound webhook slot. A unique secret is auto-generated for signature verification. The webhook URL follows the pattern `/webhook/inbound/{name}`.

## Request Body

<ParamTable type="body">
  <Param name="name" type="string" required>
    Webhook slug name (used in the URL). Must be URL-safe.
  </Param>
  <Param name="description" type="string">
    Human-readable description of what this webhook receives.
  </Param>
</ParamTable>

## Response

<ResponseField name="status" type="string">`"ok"` on success</ResponseField>
<ResponseField name="webhook" type="object">
  <ResponseField name="name" type="string">Webhook name</ResponseField>
  <ResponseField name="secret" type="string">Auto-generated verification secret</ResponseField>
  <ResponseField name="description" type="string">Webhook description</ResponseField>
</ResponseField>

<RequestExample>
<Tabs items={["cURL", "JavaScript", "Python"]}>
  <Tab title="cURL">
    ```bash
    curl -X POST "http://localhost:8888/api/webhooks/add" \
      -H "Authorization: Bearer <token>" \
      -H "Content-Type: application/json" \
      -d '{"name": "github-events", "description": "GitHub repository webhooks"}'
    ```
  </Tab>
  <Tab title="JavaScript">
    ```javascript
    const response = await fetch("http://localhost:8888/api/webhooks/add", {
      method: "POST",
      headers: {
        "Authorization": "Bearer <token>",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        name: "github-events",
        description: "GitHub repository webhooks"
      })
    });
    const data = await response.json();
    console.log(data);
    ```
  </Tab>
  <Tab title="Python">
    ```python
    import requests

    response = requests.post(
        "http://localhost:8888/api/webhooks/add",
        headers={"Authorization": "Bearer <token>"},
        json={
            "name": "github-events",
            "description": "GitHub repository webhooks"
        }
    )
    print(response.json())
    ```
  </Tab>
</Tabs>
</RequestExample>

<ResponseExample>
<Tabs items={["200"]}>
  <Tab title="200">
    ```json
    {
      "status": "ok",
      "webhook": {
        "name": "github-events",
        "secret": "whsec_a1b2c3d4e5f6...",
        "description": "GitHub repository webhooks"
      }
    }
    ```
  </Tab>
</Tabs>
</ResponseExample>
