---
title: "Creates a new webhook. Restricted to admins only."
method: POST
path: "/workspaces/{workspace_domain}/webhooks"
tags: ["Webhook API"]
---

# Creates a new webhook. Restricted to admins only.

`POST /workspaces/{workspace_domain}/webhooks`

## Path parameters

- `workspace_domain` string, required

## Request body

- AddUpdateWebhookRequest
  - `target_url` string, required — The URL to which the payload will be sent
  - `secret_key` string — The value sent in the payload required by the webservice to validate the request
  - `name` string — The name of the webhook
  - `projects` string[] — The array of project name IDs from which webhooks will be executed
  - `events` string[], required — Set of events that trigger the webhook

## Response `200`

- WebhookView
  - `url` string — API endpoint to GET this object
  - `html_url` string — Web URL to view this object in Buddy.works
  - `id` integer — The ID of the webhook
  - `target_url` string — The URL to which the payload will be sent
  - `name` string — The name of the webhook
  - `secret_key` string — The value sent in the payload required by the webservice to validate the request
  - `projects` string[] — The array of project name IDs from which webhooks will be executed
  - `events` string[] — Set of events that trigger the webhook
  - `requests` WebhookRequestView[] — Collection of recent webhook requests
    - `url` string — API endpoint to GET this object
    - `html_url` string — Web URL to view this object in Buddy.works
    - `post_date` string, date-time — The timestamp when the webhook request was made
    - `response_status` integer — The HTTP response code of the webhook request
    - `body` string — The request body sent to the webhook

---

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