---
title: "Create a webhook"
method: POST
path: "/api/v1/chatbots/{id}/webhooks"
---

# Create a webhook

`POST /api/v1/chatbots/{id}/webhooks`

## Request

- Base URL: `https://smartwebchat.eu`
- URL: `https://smartwebchat.eu/api/v1/chatbots/{id}/webhooks`
- Auth: HTTP bearer

The response contains the signing secret exactly once (secretShown true). A retry with the same Idempotency-Key returns the same webhook with secret null and secretShown false; if secretShown is false, delete and recreate the webhook to get a new secret. The target must resolve to a public address (400 target_not_allowed).

## Path parameters

- `id` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `name` string, required
  - `url` string, uri, required

## Response `201`

Webhook created

- object
  - `data` object
    - `id` string
    - `chatbotId` string
    - `name` string
    - `url` string
    - `active` boolean
    - `createdAt` string, date-time
    - `secret` string, nullable: Signing secret; only in the first response
    - `secretShown` boolean: true in the first response; false on an idempotent retry. If secretShown is false, delete and recreate the webhook to get a new secret.
  - `error` unknown

## Other responses

- `400`: Invalid name or url, or target_not_allowed
- `401`: Invalid or missing API key, or a read key
- `404`: Chatbot not found (also for a chatbot of another account)
- `409`: A request with this Idempotency-Key is still being processed. Retry after the seconds given in Retry-After (2).
- `422`: Idempotency-Key was already used with a different request body. Use a new key for a new request.
- `429`: Rate limit exceeded: 600 requests per minute per account across all /api/v1/ routes. Wait for the seconds given in Retry-After (60) and retry.

---

[API](https://skmtc.dev/smartwebchat/apis/smartwebchat-api.md) · [All operations](https://skmtc.dev/smartwebchat/apis/smartwebchat-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smartwebchat/apis/smartwebchat-api/revisions/1b052502dacb?raw)
