---
title: "Create a webhook"
method: POST
path: "/workspaces/{workspace_id}/projects/{project_id}/webhooks"
tags: ["Webhooks"]
---

# Create a webhook

`POST /workspaces/{workspace_id}/projects/{project_id}/webhooks`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/projects/{project_id}/webhooks`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Create a webhook dataset.

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.
- `project_id` integer, required: Project ID of the workspace

## Request body

- WebhookSpec: create webhook
  - `folder_resource_id` string, nullable: Folder resource id
  - `name` string: Name of the webhook
  - `mode` 'replace' | 'combine': Mode of the webhook
  - `origins` string: Origins
  - `is_secure` boolean: Is secure

## Response `201`

Document created, URL follows

- WebhookDetails
  - `webhook` WebhookStandardSchema, required
    - `id` integer, required: ID of the webhook
    - `name` string, required: Name of the webhook
    - `mode` 'replace' | 'combine', required: Mode of the webhook
    - `uri` string, required: URL of the webhook
    - `ds_id` integer, required: DS ID of the source
    - `origins` string, nullable: Origins
    - `secret` string, nullable: Secret

## Other responses

- `400`: Bad request syntax or unsupported method

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/4b2c943a00dc?raw)
